Import source: app/backend/prisma/migrations/00000000000003_soft_deletes/migration.sql
Import the existing local project snapshot. This commit organizes existing files; it does not represent newly developed functionality.
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
-- Add soft-delete columns for Article and Comment.
|
||||
ALTER TABLE "Article" ADD COLUMN IF NOT EXISTS "deletedAt" TIMESTAMP(3);
|
||||
ALTER TABLE "Comment" ADD COLUMN IF NOT EXISTS "deletedAt" TIMESTAMP(3);
|
||||
|
||||
-- Index for filtering soft-deleted rows.
|
||||
CREATE INDEX IF NOT EXISTS "Article_deletedAt_idx" ON "Article" ("deletedAt");
|
||||
CREATE INDEX IF NOT EXISTS "Comment_deletedAt_idx" ON "Comment" ("deletedAt");
|
||||
|
||||
-- Standalone publishedAt index for homepage queries.
|
||||
CREATE INDEX IF NOT EXISTS "Article_publishedAt_idx" ON "Article" ("publishedAt" DESC);
|
||||
Reference in New Issue
Block a user