diff --git a/migrations/20250929000000_init_comments.sql b/migrations/20250929000000_init_comments.sql index 4623149..0b293b5 100644 --- a/migrations/20250929000000_init_comments.sql +++ b/migrations/20250929000000_init_comments.sql @@ -12,7 +12,8 @@ CREATE TABLE IF NOT EXISTS comments ( edited_at TIMESTAMPTZ ); -CREATE INDEX IF NOT EXISTS idx_comments_mod_id ON comments (mod_id); +CREATE INDEX idx_comments_mod_id ON comments(mod_id); +CREATE INDEX idx_comments_author_id ON comments(author_id); -- +goose StatementEnd -- +goose Down diff --git a/migrations/20251114232657_migrations_create_comments_table.sql b/migrations/20251114232657_migrations_create_comments_table.sql deleted file mode 100644 index 34f14fc..0000000 --- a/migrations/20251114232657_migrations_create_comments_table.sql +++ /dev/null @@ -1,21 +0,0 @@ --- +goose Up --- +goose StatementBegin -CREATE TABLE IF NOT EXISTS comments ( - id BIGSERIAL PRIMARY KEY, - mod_id BIGINT NOT NULL, - author_id BIGINT NOT NULL, - text TEXT NOT NULL, - status VARCHAR(50) DEFAULT 'pending_moderation', - created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(), - edited_at TIMESTAMP WITH TIME ZONE -); - -CREATE INDEX idx_comments_mod_id ON comments(mod_id); -CREATE INDEX idx_comments_author_id ON comments(author_id); -CREATE INDEX idx_comments_status ON comments(status); --- +goose StatementEnd - --- +goose Down --- +goose StatementBegin -DROP TABLE IF EXISTS comments CASCADE; --- +goose StatementEnd \ No newline at end of file