Import the existing local project snapshot. This commit organizes existing files; it does not represent newly developed functionality.
11 lines
542 B
SQL
11 lines
542 B
SQL
-- 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);
|