mirror of
https://github.com/r-ca/kidshift-be.git
synced 2024-10-25 16:14:02 +00:00
add migrate
This commit is contained in:
parent
aa8cd6e0c1
commit
c497b237cd
|
@ -0,0 +1,15 @@
|
|||
-- CreateTable
|
||||
CREATE TABLE "ActiveParentLoginCode" (
|
||||
"id" TEXT NOT NULL,
|
||||
"parent_id" TEXT NOT NULL,
|
||||
"code" INTEGER NOT NULL,
|
||||
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
|
||||
CONSTRAINT "ActiveParentLoginCode_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "ActiveParentLoginCode_code_key" ON "ActiveParentLoginCode"("code");
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "ActiveParentLoginCode" ADD CONSTRAINT "ActiveParentLoginCode_parent_id_fkey" FOREIGN KEY ("parent_id") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
Loading…
Reference in New Issue
Block a user