From 59dbd6603768880497540902d8eab44d7afe6302 Mon Sep 17 00:00:00 2001 From: Mike Macgirvin Date: Mon, 15 Jul 2024 07:44:54 +1000 Subject: [PATCH] create url mapping table for nomadic content imports --- boot.php | 2 +- install/schema_mysql.sql | 10 +++++++ install/schema_postgres.sql | 10 +++++++ src/Update/_1282.php | 53 +++++++++++++++++++++++++++++++++++++ 4 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 src/Update/_1282.php diff --git a/boot.php b/boot.php index 16036888d..70f1843ee 100755 --- a/boot.php +++ b/boot.php @@ -27,7 +27,7 @@ use Code\Lib\Url; */ const REPOSITORY_ID = 'streams'; -const DB_UPDATE_VERSION = 1281; +const DB_UPDATE_VERSION = 1282; const PROJECT_BASE = __DIR__; const ACTIVITYPUB_ENABLED = true; const NOMAD_PROTOCOL_VERSION = '13.3'; diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql index 6065beb3f..e17ae216b 100644 --- a/install/schema_mysql.sql +++ b/install/schema_mysql.sql @@ -728,6 +728,16 @@ CREATE TABLE IF NOT EXISTS listeners ( KEY ltype (ltype) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +CREATE TABLE IF NOT EXISTS locator ( + id int NOT NULL AUTO_INCREMENT, + locate_old varchar(255) CHARACTER SET utf8mb4 NOT NULL DEFAULT '', + locate_new varchar(255) CHARACTER SET utf8mb4 NOT NULL DEFAULT '', + PRIMARY KEY (id), + UNIQUE KEY locate_old (locate_old(191)), + KEY locate_new (locate_new(191)) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + + CREATE TABLE IF NOT EXISTS `menu` ( `menu_id` int unsigned NOT NULL AUTO_INCREMENT, `menu_channel_id` int unsigned NOT NULL DEFAULT 0 , diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql index bdb17a86a..d3b6d1f94 100644 --- a/install/schema_postgres.sql +++ b/install/schema_postgres.sql @@ -749,6 +749,16 @@ CREATE TABLE listeners ( create index "target_id_idx" on listeners ("target_id"); create index "portable_id_idx" on listeners ("portable_id"); create index "ltype_idx" on listeners ("ltype"); + +CREATE TABLE locator ( + id serial NOT NULL, + locate_old text NOT NULL, + locate_new text NOT NULL, + PRIMARY KEY ("id"), + UNIQUE ("locate_old") +); +create index "locate_new_idx" on locator ("locate_new"); + CREATE TABLE "menu" ( "menu_id" serial NOT NULL, "menu_channel_id" bigint NOT NULL DEFAULT '0', diff --git a/src/Update/_1282.php b/src/Update/_1282.php new file mode 100644 index 000000000..aa9720a47 --- /dev/null +++ b/src/Update/_1282.php @@ -0,0 +1,53 @@ +