packages/db-main-prisma/prisma/sqlite/migrations/20240913075658_add_dashboard_plugin/migration.sql
-- AlterTable
ALTER TABLE "users" ADD COLUMN "is_system" BOOLEAN;
-- CreateTable
CREATE TABLE "plugin" (
"id" TEXT NOT NULL PRIMARY KEY,
"name" TEXT NOT NULL,
"description" TEXT,
"detail_desc" TEXT,
"logo" TEXT NOT NULL,
"help_url" TEXT,
"status" TEXT NOT NULL,
"positions" TEXT NOT NULL,
"url" TEXT,
"secret" TEXT NOT NULL,
"masked_secret" TEXT NOT NULL,
"i18n" TEXT,
"plugin_user" TEXT,
"created_time" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"last_modified_time" DATETIME,
"created_by" TEXT NOT NULL,
"last_modified_by" TEXT
);
-- CreateTable
CREATE TABLE "plugin_install" (
"id" TEXT NOT NULL PRIMARY KEY,
"plugin_id" TEXT NOT NULL,
"base_id" TEXT NOT NULL,
"name" TEXT NOT NULL,
"position_id" TEXT NOT NULL,
"position" TEXT NOT NULL,
"storage" TEXT,
"created_time" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"created_by" TEXT NOT NULL,
"last_modified_time" DATETIME,
"last_modified_by" TEXT,
CONSTRAINT "plugin_install_plugin_id_fkey" FOREIGN KEY ("plugin_id") REFERENCES "plugin" ("id") ON DELETE CASCADE ON UPDATE CASCADE
);
-- CreateTable
CREATE TABLE "dashboard" (
"id" TEXT NOT NULL PRIMARY KEY,
"name" TEXT NOT NULL,
"base_id" TEXT NOT NULL,
"layout" TEXT,
"created_by" TEXT NOT NULL,
"created_time" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"last_modified_time" DATETIME,
"last_modified_by" TEXT
);
-- CreateIndex
CREATE UNIQUE INDEX "plugin_secret_key" ON "plugin"("secret");