migra/migra_cli/tests/data/sqlite/migrations/210218233414_create_persons/down.sql
Dmitriy Pleshevskiy ec02367680
Migra core (#11)
* feat(core): init migra lib
* refac(core): add utils for migration list
* feat(core): add managers
* refac(core): add batch exec trait
* refac(core): smarter managers
* refac(cli): removed adapter, builder
* refac(cli): use migra core for cli
* chore(cli): add dev deps for tests
* chore(cli): improve error handling
* refac(core): make migrations simpler
* refac(cli): change transaction utils
* chore(core): add documentation
2021-06-13 01:39:56 +03:00

17 lines
499 B
SQL

-- This file should undo anything in `up.sql`
CREATE TABLE tmp_articles (
id int AUTO_INCREMENT PRIMARY KEY,
title text NOT NULL CHECK (length(title) > 0),
content text NOT NULL,
created_at timestamp NOT NULL DEFAULT current_timestamp
);
INSERT INTO tmp_articles (id, title, content, created_at)
SELECT id, title, content, created_at FROM articles;
DROP TABLE articles;
ALTER TABLE tmp_articles RENAME TO articles;
DROP TABLE persons;