Files
Termix/plugins/secret-sources/migrations/postgres/0001_adopt_secret_sources.sql
T

17 lines
724 B
SQL

-- secret-sources 0001: adopt_secret_sources
-- Generated by termix-plugin migrations. Review before committing.
CREATE TABLE IF NOT EXISTS "secret_sources" (
"id" varchar(255) PRIMARY KEY NOT NULL,
"user_id" varchar(255) NOT NULL,
"name" text NOT NULL,
"kind" text NOT NULL DEFAULT 'onepassword-connect',
"base_url" text NOT NULL,
"shared" boolean NOT NULL DEFAULT false,
"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_secret_sources_user" ON "secret_sources" ("user_id");
ALTER TABLE "secret_sources" RENAME TO "p_secret_sources_sources";