1
Some checks failed
Deploy API / deploy (push) Failing after 26s

This commit is contained in:
2026-05-25 23:43:55 +08:00
parent b2879720de
commit 12b4ee536e
6 changed files with 114 additions and 33 deletions

View File

@@ -56,6 +56,9 @@ func EnsurePostsSchema(ctx context.Context, pool *pgxpool.Pool) error {
post_id UUID NOT NULL REFERENCES posts(id) ON DELETE CASCADE,
tag_id INT NOT NULL REFERENCES tags(id) ON DELETE CASCADE,
PRIMARY KEY (post_id, tag_id)
)`)
);
ALTER TABLE posts ADD COLUMN IF NOT EXISTS post_type TEXT NOT NULL DEFAULT 'text';
ALTER TABLE posts ALTER COLUMN category_id DROP NOT NULL;
CREATE INDEX IF NOT EXISTS idx_posts_post_type ON posts(post_type)`)
return err
}