Archived
1
0
Fork 0
This repository has been archived on 2024-07-25. You can view files and clone it, but cannot push or open issues or pull requests.
migra/migra-cli/tests/data/sqlite/migrations/210218233414_create_persons/down.sql

17 lines
499 B
MySQL
Raw Normal View History

2021-05-17 10:06:33 +03:00
-- 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;
2021-05-17 10:06:33 +03:00
DROP TABLE persons;