migra/migra-cli/tests/data/postgres_invalid/migrations/210218233414_create_persons/up.sql
Dmitriy Pleshevskiy 7ae5eec2c3 chore: add support transactional ddl for client
I didn't know that mysql doesn't support transactional ddl.
It means that we cannot create table, alter table and etc. in
transaction. At the moment migra supports only postgres client,
that can be use transaction for ddl.
2021-04-24 22:39:44 +03:00

15 lines
477 B
SQL

-- Your SQL goes here
CREATE TABLE persons (
id SERIAL PRIMARY KEY,
email text NOT NULL UNIQUE,
display_name text NOT NULL,
created_at timestamp NOT NULL DEFAULT current_timestamp
);
/* This table doesn't exist
↓↓↓↓↓↓↓ */
ALTER TABLE recipes
ADD COLUMN author_person_id int NULL
REFERENCES persons (id) ON UPDATE CASCADE ON DELETE CASCADE;