1
0
This repository has been archived on 2024-11-10. You can view files and clone it, but cannot push or open issues or pull requests.
Files
arduino-parts-inventory/api/db/migrations/20231031125027_user_and_part/migration.sql
2023-10-31 18:41:57 -04:00

24 lines
671 B
SQL

-- CreateTable
CREATE TABLE "Part" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"name" TEXT NOT NULL,
"description" TEXT DEFAULT 'No description provided',
"availableStock" INTEGER NOT NULL DEFAULT 0,
"imageUrl" TEXT NOT NULL DEFAULT '/no_image.png',
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
-- CreateTable
CREATE TABLE "User" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"name" TEXT,
"email" TEXT NOT NULL,
"hashedPassword" TEXT NOT NULL,
"salt" TEXT NOT NULL,
"resetToken" TEXT,
"resetTokenExpiresAt" DATETIME
);
-- CreateIndex
CREATE UNIQUE INDEX "User_email_key" ON "User"("email");