CSS
This commit is contained in:
@@ -1,21 +1,23 @@
|
||||
-- migrate:up
|
||||
|
||||
CREATE TABLE "users" (
|
||||
CREATE TABLE "accounts" (
|
||||
"id" uuid PRIMARY KEY,
|
||||
"created" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"username" text NOT NULL,
|
||||
"password" text NOT NULL
|
||||
"accountName" text NOT NULL,
|
||||
"apiKey" text,
|
||||
"password" text
|
||||
);
|
||||
CREATE UNIQUE INDEX idx_accountname ON accounts ("accountName");
|
||||
|
||||
CREATE TABLE "usersFields" (
|
||||
CREATE TABLE "accountsFields" (
|
||||
"id" uuid PRIMARY KEY,
|
||||
"created" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"userId" uuid NOT NULL,
|
||||
"accountId" uuid NOT NULL,
|
||||
"name" text NOT NULL,
|
||||
"value" text[] NOT NULL
|
||||
);
|
||||
ALTER TABLE "usersFields"
|
||||
ADD FOREIGN KEY ("userId") REFERENCES "users" ("id") ON DELETE RESTRICT ON UPDATE RESTRICT;
|
||||
CREATE UNIQUE INDEX idx_usersfields ON "usersFields" ("userId", "name");
|
||||
ALTER TABLE "accountsFields"
|
||||
ADD FOREIGN KEY ("accountId") REFERENCES "accounts" ("id") ON DELETE RESTRICT ON UPDATE RESTRICT;
|
||||
CREATE UNIQUE INDEX idx_accountsfields ON "accountsFields" ("accountId", "name");
|
||||
|
||||
-- migrate:down
|
||||
Reference in New Issue
Block a user