Skip to content

Commit 9b1f663

Browse files
committed
feat: updated schema
1 parent ccee807 commit 9b1f663

File tree

6 files changed

+73
-10
lines changed

6 files changed

+73
-10
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
Warnings:
3+
4+
- You are about to drop the column `checkinDate` on the `tickets` table. All the data in the column will be lost.
5+
- You are about to drop the column `isCheckin` on the `tickets` table. All the data in the column will be lost.
6+
- Added the required column `billing` to the `tickets` table without a default value. This is not possible if the table is not empty.
7+
- Added the required column `check_in_date` to the `tickets` table without a default value. This is not possible if the table is not empty.
8+
- Added the required column `is_check_in` to the `tickets` table without a default value. This is not possible if the table is not empty.
9+
10+
*/
11+
-- AlterTable
12+
ALTER TABLE "tickets" DROP COLUMN "checkinDate",
13+
DROP COLUMN "isCheckin",
14+
ADD COLUMN "billing" BOOLEAN NOT NULL,
15+
ADD COLUMN "check_in_date" TIMESTAMP(3) NOT NULL,
16+
ADD COLUMN "is_check_in" BOOLEAN NOT NULL,
17+
ALTER COLUMN "tier_id" DROP NOT NULL;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/*
2+
Warnings:
3+
4+
- You are about to drop the column `atendee` on the `tickets` table. All the data in the column will be lost.
5+
- Added the required column `attendee` to the `tickets` table without a default value. This is not possible if the table is not empty.
6+
7+
*/
8+
-- AlterTable
9+
ALTER TABLE "tickets" DROP COLUMN "atendee",
10+
ADD COLUMN "attendee" TEXT NOT NULL;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
Warnings:
3+
4+
- You are about to drop the column `billing` on the `tickets` table. All the data in the column will be lost.
5+
6+
*/
7+
-- AlterTable
8+
ALTER TABLE "tickets" DROP COLUMN "billing",
9+
ADD COLUMN "paymentStat" BOOLEAN NOT NULL DEFAULT false,
10+
ADD COLUMN "paymetMethode" TEXT,
11+
ALTER COLUMN "check_in_date" DROP NOT NULL,
12+
ALTER COLUMN "is_check_in" SET DEFAULT false;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
Warnings:
3+
4+
- The primary key for the `tickets` table will be changed. If it partially fails, the table could be left without primary key constraint.
5+
- The `id` column on the `tickets` table would be dropped and recreated. This will lead to data loss if there is data in the column.
6+
7+
*/
8+
-- AlterTable
9+
ALTER TABLE "tickets" DROP CONSTRAINT "tickets_pkey",
10+
ADD COLUMN "credential" TEXT,
11+
DROP COLUMN "id",
12+
ADD COLUMN "id" SERIAL NOT NULL,
13+
ADD CONSTRAINT "tickets_pkey" PRIMARY KEY ("id");
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/*
2+
Warnings:
3+
4+
- A unique constraint covering the columns `[credential]` on the table `tickets` will be added. If there are existing duplicate values, this will fail.
5+
6+
*/
7+
-- CreateIndex
8+
CREATE UNIQUE INDEX "tickets_credential_key" ON "tickets"("credential");

prisma/schema.prisma

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -189,16 +189,19 @@ model TierBenefit {
189189
}
190190

191191
model Ticket {
192-
id String @id
193-
atendee String
194-
email String
195-
phone String
196-
isCheckin Boolean
197-
checkinDate DateTime
198-
createdAt DateTime @default(now()) @map("created_at")
199-
updatedAt DateTime @default(now()) @map("updated_at")
200-
tierId Int @map("tier_id")
201-
tier Tier @relation(fields: [tierId], references: [id], onDelete: Cascade)
192+
id Int @id @default(autoincrement())
193+
credential String? @unique()
194+
attendee String
195+
email String
196+
phone String
197+
paymentStat Boolean @default(false)
198+
paymetMethode String?
199+
isCheckin Boolean @default(false) @map("is_check_in")
200+
checkinDate DateTime? @map("check_in_date")
201+
createdAt DateTime @default(now()) @map("created_at")
202+
updatedAt DateTime @default(now()) @map("updated_at")
203+
tierId Int? @map("tier_id")
204+
tier Tier? @relation(fields: [tierId], references: [id], onDelete: Cascade)
202205
203206
@@map("tickets")
204207
}

0 commit comments

Comments
 (0)