update prisma migration

This commit is contained in:
Grégoire Chevalier 2023-05-10 14:37:00 +02:00
parent fe315bbbd7
commit 5095082f2e
3 changed files with 12 additions and 10 deletions

View File

@ -26,6 +26,7 @@
"test:e2e": "jest --config ./test/jest-e2e.json",
"generate": "docker exec v3-ad-api sh -c 'npx prisma generate'",
"migrate": "docker exec v3-ad-api sh -c 'npx prisma migrate dev'",
"migrate:init": "docker exec v3-ad-api sh -c 'npx prisma migrate dev --name init'",
"migrate:test": "dotenv -e .env.test -- npx prisma migrate deploy",
"migrate:test:ci": "dotenv -e ci/.env.ci -- npx prisma migrate deploy",
"migrate:deploy": "npx prisma migrate deploy"

View File

@ -8,11 +8,11 @@ CREATE TYPE "AddressType" AS ENUM ('HOUSE_NUMBER', 'STREET_ADDRESS', 'LOCALITY',
CREATE TABLE "ad" (
"uuid" UUID NOT NULL,
"userUuid" UUID NOT NULL,
"driver" BOOLEAN,
"passenger" BOOLEAN,
"frequency" "Frequency" NOT NULL DEFAULT 'RECURRENT',
"driver" BOOLEAN NOT NULL,
"passenger" BOOLEAN NOT NULL,
"frequency" "Frequency" NOT NULL,
"fromDate" DATE NOT NULL,
"toDate" DATE,
"toDate" DATE NOT NULL,
"monTime" TIMESTAMPTZ,
"tueTime" TIMESTAMPTZ,
"wedTime" TIMESTAMPTZ,
@ -27,8 +27,8 @@ CREATE TABLE "ad" (
"friMargin" INTEGER,
"satMargin" INTEGER,
"sunMargin" INTEGER,
"seatsDriver" SMALLINT,
"seatsPassenger" SMALLINT,
"seatsDriver" SMALLINT NOT NULL,
"seatsPassenger" SMALLINT NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
@ -42,12 +42,13 @@ CREATE TABLE "address" (
"position" SMALLINT NOT NULL,
"lon" DOUBLE PRECISION NOT NULL,
"lat" DOUBLE PRECISION NOT NULL,
"name" TEXT,
"houseNumber" TEXT,
"street" TEXT,
"locality" TEXT,
"postalCode" TEXT,
"country" TEXT,
"type" "AddressType" DEFAULT 'OTHER',
"type" "AddressType",
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,

View File

@ -15,7 +15,7 @@ model Ad {
userUuid String @db.Uuid
driver Boolean
passenger Boolean
frequency Frequency @default(RECURRENT)
frequency Frequency
fromDate DateTime @db.Date
toDate DateTime @db.Date
monTime DateTime? @db.Timestamptz()
@ -51,12 +51,13 @@ model Address {
position Int @db.SmallInt
lon Float
lat Float
name String?
houseNumber String?
street String?
locality String?
postalCode String?
country String?
type AddressType? @default(OTHER)
type AddressType?
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
Ad Ad @relation(fields: [adUuid], references: [uuid], onDelete: Cascade)
@ -70,7 +71,6 @@ enum Frequency {
}
enum AddressType {
NAME
HOUSE_NUMBER
STREET_ADDRESS
LOCALITY