diff --git a/prisma/migrations/20220110140654_add_user_settings_table/migration.sql b/prisma/migrations/20220110140654_add_user_settings_table/migration.sql new file mode 100644 index 0000000000..40afb53b59 --- /dev/null +++ b/prisma/migrations/20220110140654_add_user_settings_table/migration.sql @@ -0,0 +1,14 @@ +-- CreateTable +CREATE TABLE "UserSettings" ( + "id" SERIAL NOT NULL, + "userId" INTEGER NOT NULL, + "key" TEXT NOT NULL, + "value" TEXT NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "UserSettings_pkey" PRIMARY KEY ("id") +); + +-- RenameIndex +ALTER INDEX "DailyEventReference_bookingId_unique" RENAME TO "DailyEventReference_bookingId_key"; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 505ccd7441..6b9e779a26 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -53,7 +53,7 @@ model EventType { price Int @default(0) currency String @default("usd") slotInterval Int? - smartContractAddress String? + smartContractAddress String? @@unique([userId, slug]) } @@ -195,7 +195,7 @@ model DailyEventReference { dailyurl String @default("dailycallurl") dailytoken String @default("dailytoken") booking Booking? @relation(fields: [bookingId], references: [id]) - bookingId Int? + bookingId Int? @unique } model Booking { @@ -327,3 +327,12 @@ model Webhook { eventTriggers WebhookTriggerEvents[] user User @relation(fields: [userId], references: [id]) } + +model UserSettings { + id Int @id @default(autoincrement()) + userId Int + key String + value String + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt +}