diff --git a/prisma/migrations/20260109175200_updated_at/migration.sql b/prisma/migrations/20260109175200_updated_at/migration.sql new file mode 100644 index 0000000..d686525 --- /dev/null +++ b/prisma/migrations/20260109175200_updated_at/migration.sql @@ -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; \ No newline at end of file diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 688a0a0..e2c5275 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -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") } @@ -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") } @@ -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") @@ -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") } @@ -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") }