Parts schema and scaffolld, with file uploading for the image (through Filestack)
This commit is contained in:
@ -0,0 +1,9 @@
|
||||
-- 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
|
||||
);
|
3
api/db/migrations/migration_lock.toml
Normal file
3
api/db/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 (i.e. Git)
|
||||
provider = "sqlite"
|
@ -8,11 +8,11 @@ generator client {
|
||||
binaryTargets = "native"
|
||||
}
|
||||
|
||||
// Define your own datamodels here and run `yarn redwood prisma migrate dev`
|
||||
// to create migrations for them and apply to your dev DB.
|
||||
// TODO: Please remove the following example:
|
||||
model UserExample {
|
||||
id Int @id @default(autoincrement())
|
||||
email String @unique
|
||||
name String?
|
||||
model Part {
|
||||
id Int @id @default(autoincrement())
|
||||
name String
|
||||
description String? @default("No description provided")
|
||||
availableStock Int @default(0)
|
||||
imageUrl String @default("/no_image.png")
|
||||
createdAt DateTime @default(now())
|
||||
}
|
||||
|
Reference in New Issue
Block a user