mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-28 06:05:24 +00:00
39 lines
1.6 KiB
SQL
39 lines
1.6 KiB
SQL
-- homepage 0001: adopt_homepage_tables
|
|
-- Generated by termix-plugin migrations. Review before committing.
|
|
|
|
CREATE TABLE IF NOT EXISTS "homepage_items" (
|
|
"id" integer PRIMARY KEY AUTOINCREMENT,
|
|
"user_id" text NOT NULL,
|
|
"type_id" text NOT NULL,
|
|
"title" text,
|
|
"config" text NOT NULL DEFAULT '{}',
|
|
"folder_id" integer,
|
|
"sync_id" text UNIQUE,
|
|
"created_at" text NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
"updated_at" text NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
FOREIGN KEY ("user_id") REFERENCES "users" ("id") ON DELETE CASCADE
|
|
);
|
|
CREATE INDEX IF NOT EXISTS "idx_homepage_items_user_id" ON "homepage_items" ("user_id");
|
|
ALTER TABLE "homepage_items" RENAME TO "p_homepage_homepage_items";
|
|
CREATE TABLE IF NOT EXISTS "homepage_layouts" (
|
|
"id" integer PRIMARY KEY AUTOINCREMENT,
|
|
"user_id" text NOT NULL UNIQUE,
|
|
"layout" text NOT NULL DEFAULT '{}',
|
|
"updated_at" text NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
FOREIGN KEY ("user_id") REFERENCES "users" ("id") ON DELETE CASCADE
|
|
);
|
|
ALTER TABLE "homepage_layouts" RENAME TO "p_homepage_homepage_layouts";
|
|
CREATE TABLE IF NOT EXISTS "dashboard_service_links" (
|
|
"id" integer PRIMARY KEY AUTOINCREMENT,
|
|
"user_id" text NOT NULL,
|
|
"label" text NOT NULL,
|
|
"url" text NOT NULL,
|
|
"order" integer NOT NULL DEFAULT 0,
|
|
"sync_id" text UNIQUE,
|
|
"created_at" text NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
"updated_at" text NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
FOREIGN KEY ("user_id") REFERENCES "users" ("id") ON DELETE CASCADE
|
|
);
|
|
CREATE INDEX IF NOT EXISTS "idx_dashboard_service_links_user_id" ON "dashboard_service_links" ("user_id");
|
|
ALTER TABLE "dashboard_service_links" RENAME TO "p_homepage_dashboard_service_links";
|