start migrationg to prisma-orm
This commit is contained in:
parent
9a8d7a36b9
commit
ae2cd5e61f
18 changed files with 374 additions and 200 deletions
29
prisma/migrations/20251106204934_init/migration.sql
Normal file
29
prisma/migrations/20251106204934_init/migration.sql
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
-- CreateTable
|
||||
CREATE TABLE "users" (
|
||||
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
"email" TEXT NOT NULL,
|
||||
"password" TEXT NOT NULL
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "jobs" (
|
||||
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
"user_id" INTEGER NOT NULL,
|
||||
"date_created" DATETIME NOT NULL,
|
||||
"status" TEXT NOT NULL DEFAULT 'not started',
|
||||
"num_files" INTEGER NOT NULL DEFAULT 0,
|
||||
CONSTRAINT "jobs_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "file_names" (
|
||||
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
"job_id" INTEGER NOT NULL,
|
||||
"file_name" TEXT NOT NULL,
|
||||
"output_file_name" TEXT NOT NULL,
|
||||
"status" TEXT NOT NULL DEFAULT 'not started',
|
||||
CONSTRAINT "file_names_job_id_fkey" FOREIGN KEY ("job_id") REFERENCES "jobs" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "users_email_key" ON "users"("email");
|
||||
3
prisma/migrations/migration_lock.toml
Normal file
3
prisma/migrations/migration_lock.toml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# Please do not edit this file manually
|
||||
# It should be added in your version-control system (e.g., Git)
|
||||
provider = "sqlite"
|
||||
Loading…
Add table
Add a link
Reference in a new issue