Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions prisma/migrations/20260109175200_updated_at/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-- AlterTable
ALTER TABLE "public"."organisations" ADD COLUMN "updated_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE "public"."users" ADD COLUMN "updated_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE "public"."user_on_org" ADD COLUMN "updated_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE "public"."bookings" ADD COLUMN "updated_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE "public"."events" ADD COLUMN "updated_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP;
5 changes: 5 additions & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ model User {
userOrgs UserOnOrg[]
deleted Boolean @default(false) // supports soft delete
deletedAt DateTime? @map("deleted_at")
updatedAt DateTime @updatedAt @map("updated_at")

@@map("users")
}
Expand All @@ -42,6 +43,7 @@ model Organisation {
isInactive Boolean @default(false) @map("is_inactive")
isInvisible Boolean @default(false) @map("is_invisible") // is not displayed on the website
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")

@@map("organisations")
}
Expand All @@ -56,6 +58,7 @@ model UserOnOrg {
events Event[]
deleted Boolean @default(false) // supports soft delete
deletedAt DateTime? @map("deleted_at")
updatedAt DateTime @updatedAt @map("updated_at")

@@id([userId, orgId])
@@map("user_on_org")
Expand Down Expand Up @@ -85,6 +88,7 @@ model Booking {
event Event?
deleted Boolean @default(false) // supports soft delete
deletedAt DateTime? @map("deleted_at")
updatedAt DateTime @updatedAt @map("updated_at")

@@map("bookings")
}
Expand All @@ -104,6 +108,7 @@ model Event {
bookingId Int? @unique @map("booking_id")
deleted Boolean @default(false) // supports soft delete
deletedAt DateTime? @map("deleted_at")
updatedAt DateTime @updatedAt @map("updated_at")

@@map("events")
}