transmet/db/migrations/20150511204500_rename.sql

16 lines
450 B
SQL

-- +goose Up
-- SQL in section 'Up' is executed when this migration is applied
ALTER TABLE tags RENAME TO categories;
ALTER TABLE categories RENAME COLUMN tag_id TO id;
ALTER TABLE news RENAME COLUMN news_id TO id;
ALTER TABLE news RENAME COLUMN tag_id TO category_id;
ALTER TABLE news RENAME COLUMN description TO notes;
-- +goose Down
-- SQL section 'Down' is executed when this migration is rolled back
ALTER TABLE categories RENAMTE TO tags