transmet/db/migrations/20150511204500_rename.sql

16 lines
450 B
MySQL
Raw Permalink Normal View History

2015-05-12 05:50:09 +00:00
-- +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