chore: add created_at to users table

This commit is contained in:
Tianzhou Chen
2023-05-19 00:55:29 +08:00
parent 9aaaef80ba
commit 8c5ddc37e1
2 changed files with 7 additions and 0 deletions

View File

@ -0,0 +1,5 @@
-- AlterTable
ALTER TABLE "users" ADD COLUMN "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP;
-- CreateIndex
CREATE INDEX "users_created_at_idx" ON "users"("created_at");

View File

@ -132,7 +132,9 @@ model User {
subscriptions Subscription[]
// The stripe customer id corresponds to this user
stripeId String? @unique @map("stripe_id")
createdAt DateTime @default(now()) @map("created_at")
@@index([createdAt], map: "users_created_at_idx")
@@map("users")
}