codeの型しゅうせい

This commit is contained in:
ろむねこ 2024-06-19 15:29:18 +09:00
parent 78dd9244d7
commit 7554ed47ef
Signed by: Fujimatsu
GPG Key ID: FA1F39A1BA37D168
3 changed files with 22 additions and 1 deletions

View File

@ -0,0 +1,12 @@
-- CreateTable
CREATE TABLE "ActiveLoginCode" (
"id" TEXT NOT NULL,
"child_id" TEXT NOT NULL,
"code" TEXT NOT NULL,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "ActiveLoginCode_pkey" PRIMARY KEY ("id")
);
-- AddForeignKey
ALTER TABLE "ActiveLoginCode" ADD CONSTRAINT "ActiveLoginCode_child_id_fkey" FOREIGN KEY ("child_id") REFERENCES "Child"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

View File

@ -0,0 +1,9 @@
/*
Warnings:
- Changed the type of `code` on the `ActiveLoginCode` table. No cast exists, the column would be dropped and recreated, which cannot be done if there is data, since the column is required.
*/
-- AlterTable
ALTER TABLE "ActiveLoginCode" DROP COLUMN "code",
ADD COLUMN "code" INTEGER NOT NULL;

View File

@ -76,7 +76,7 @@ model TaskChildLinkage {
model ActiveLoginCode {
id String @id @default(cuid())
child_id String
code String
code Int
created_at DateTime @default(now())
child Child @relation(fields: [child_id], references: [id])
}