From 046abeb7de46d80d823081a9f908e2feddf26313 Mon Sep 17 00:00:00 2001 From: aeneasr <3372410+aeneasr@users.noreply.github.com> Date: Thu, 3 Sep 2020 11:42:30 +0200 Subject: [PATCH] Respect auto_index keys in crdb This patch reverts a behavior introduced earlier and adds a test to prevent future regressions. With this patch, it is possible to use `change_column` on columns with foreign key references but without explicitly defined indices. Without this patch, those changes fail because CRDB needs an index on the referencing column when creating foreign key checks. Closes #98 --- internal/e2e/fixtures/cockroach/down/10.sql | 1 + internal/e2e/fixtures/cockroach/down/11.sql | 1 + internal/e2e/fixtures/cockroach/down/12.sql | 1 + internal/e2e/fixtures/cockroach/down/13.sql | 1 + internal/e2e/fixtures/cockroach/down/14.sql | 31 +++ internal/e2e/fixtures/cockroach/down/15.sql | 62 ++++++ internal/e2e/fixtures/cockroach/down/2.sql | 1 + internal/e2e/fixtures/cockroach/down/3.sql | 1 + internal/e2e/fixtures/cockroach/down/4.sql | 1 + internal/e2e/fixtures/cockroach/down/5.sql | 1 + internal/e2e/fixtures/cockroach/down/6.sql | 1 + internal/e2e/fixtures/cockroach/down/7.sql | 1 + internal/e2e/fixtures/cockroach/down/8.sql | 1 + internal/e2e/fixtures/cockroach/down/9.sql | 1 + internal/e2e/fixtures/cockroach/up/13.sql | 1 + internal/e2e/fixtures/cockroach/up/14.sql | 60 ++++++ internal/e2e/fixtures/cockroach/up/15.sql | 62 ++++++ internal/e2e/fixtures/mysql/down/0.sql | 8 +- internal/e2e/fixtures/mysql/down/1.sql | 10 +- internal/e2e/fixtures/mysql/down/10.sql | 12 +- internal/e2e/fixtures/mysql/down/11.sql | 12 +- internal/e2e/fixtures/mysql/down/12.sql | 12 +- internal/e2e/fixtures/mysql/down/13.sql | 12 +- internal/e2e/fixtures/mysql/down/14.sql | 75 +++++++ internal/e2e/fixtures/mysql/down/15.sql | 125 +++++++++++ internal/e2e/fixtures/mysql/down/2.sql | 12 +- internal/e2e/fixtures/mysql/down/3.sql | 12 +- internal/e2e/fixtures/mysql/down/4.sql | 12 +- internal/e2e/fixtures/mysql/down/5.sql | 12 +- internal/e2e/fixtures/mysql/down/6.sql | 12 +- internal/e2e/fixtures/mysql/down/7.sql | 12 +- internal/e2e/fixtures/mysql/down/8.sql | 12 +- internal/e2e/fixtures/mysql/down/9.sql | 12 +- internal/e2e/fixtures/mysql/up/0.sql | 10 +- internal/e2e/fixtures/mysql/up/1.sql | 12 +- internal/e2e/fixtures/mysql/up/10.sql | 12 +- internal/e2e/fixtures/mysql/up/11.sql | 12 +- internal/e2e/fixtures/mysql/up/12.sql | 12 +- internal/e2e/fixtures/mysql/up/13.sql | 12 +- internal/e2e/fixtures/mysql/up/14.sql | 123 +++++++++++ internal/e2e/fixtures/mysql/up/15.sql | 125 +++++++++++ internal/e2e/fixtures/mysql/up/2.sql | 12 +- internal/e2e/fixtures/mysql/up/3.sql | 12 +- internal/e2e/fixtures/mysql/up/4.sql | 12 +- internal/e2e/fixtures/mysql/up/5.sql | 12 +- internal/e2e/fixtures/mysql/up/6.sql | 12 +- internal/e2e/fixtures/mysql/up/7.sql | 12 +- internal/e2e/fixtures/mysql/up/8.sql | 12 +- internal/e2e/fixtures/mysql/up/9.sql | 12 +- internal/e2e/fixtures/postgres/down/14.sql | 108 ++++++++++ internal/e2e/fixtures/postgres/down/15.sql | 200 ++++++++++++++++++ internal/e2e/fixtures/postgres/up/14.sql | 198 +++++++++++++++++ internal/e2e/fixtures/postgres/up/15.sql | 200 ++++++++++++++++++ internal/e2e/fixtures/sqlite3/down/14.sql | 19 ++ internal/e2e/fixtures/sqlite3/down/15.sql | 37 ++++ internal/e2e/fixtures/sqlite3/up/14.sql | 35 +++ internal/e2e/fixtures/sqlite3/up/15.sql | 37 ++++ .../20191100000015_auto_fk.down.fizz | 3 + .../migrations/20191100000015_auto_fk.up.fizz | 28 +++ .../20191100000016_rename_auto_fk.down.fizz | 1 + .../20191100000016_rename_auto_fk.up.fizz | 3 + internal/e2e/migrator_test.go | 4 + translators/cockroach_meta.go | 4 +- 63 files changed, 1714 insertions(+), 167 deletions(-) create mode 100644 internal/e2e/fixtures/cockroach/down/14.sql create mode 100644 internal/e2e/fixtures/cockroach/down/15.sql create mode 100644 internal/e2e/fixtures/cockroach/up/14.sql create mode 100644 internal/e2e/fixtures/cockroach/up/15.sql create mode 100644 internal/e2e/fixtures/mysql/down/14.sql create mode 100644 internal/e2e/fixtures/mysql/down/15.sql create mode 100644 internal/e2e/fixtures/mysql/up/14.sql create mode 100644 internal/e2e/fixtures/mysql/up/15.sql create mode 100644 internal/e2e/fixtures/postgres/down/14.sql create mode 100644 internal/e2e/fixtures/postgres/down/15.sql create mode 100644 internal/e2e/fixtures/postgres/up/14.sql create mode 100644 internal/e2e/fixtures/postgres/up/15.sql create mode 100644 internal/e2e/fixtures/sqlite3/down/14.sql create mode 100644 internal/e2e/fixtures/sqlite3/down/15.sql create mode 100644 internal/e2e/fixtures/sqlite3/up/14.sql create mode 100644 internal/e2e/fixtures/sqlite3/up/15.sql create mode 100644 internal/e2e/migrations/20191100000015_auto_fk.down.fizz create mode 100644 internal/e2e/migrations/20191100000015_auto_fk.up.fizz create mode 100644 internal/e2e/migrations/20191100000016_rename_auto_fk.down.fizz create mode 100644 internal/e2e/migrations/20191100000016_rename_auto_fk.up.fizz diff --git a/internal/e2e/fixtures/cockroach/down/10.sql b/internal/e2e/fixtures/cockroach/down/10.sql index 9ffee694..ab6d1891 100644 --- a/internal/e2e/fixtures/cockroach/down/10.sql +++ b/internal/e2e/fixtures/cockroach/down/10.sql @@ -12,6 +12,7 @@ CREATE TABLE e2e_user_posts ( user_id UUID NOT NULL, slug VARCHAR(64) NOT NULL, CONSTRAINT "primary" PRIMARY KEY (id ASC), + INDEX e2e_user_notes_auto_index_e2e_user_notes_e2e_users_id_fk (user_id ASC), INDEX e2e_user_notes_user_id_idx (user_id ASC), UNIQUE INDEX e2e_user_notes_slug_idx (slug ASC), FAMILY "primary" (id, content, user_id, slug) diff --git a/internal/e2e/fixtures/cockroach/down/11.sql b/internal/e2e/fixtures/cockroach/down/11.sql index c24be5b5..7028d77c 100644 --- a/internal/e2e/fixtures/cockroach/down/11.sql +++ b/internal/e2e/fixtures/cockroach/down/11.sql @@ -13,6 +13,7 @@ CREATE TABLE e2e_user_posts ( user_id UUID NOT NULL, CONSTRAINT "primary" PRIMARY KEY (id ASC), UNIQUE INDEX e2e_user_notes_slug_idx (slug ASC), + INDEX e2e_user_notes_auto_index_e2e_user_notes_e2e_users_id_fk (user_id ASC), INDEX e2e_user_notes_user_id_idx (user_id ASC), FAMILY "primary" (id, content, slug, user_id) ); diff --git a/internal/e2e/fixtures/cockroach/down/12.sql b/internal/e2e/fixtures/cockroach/down/12.sql index 9a380898..f0663c77 100644 --- a/internal/e2e/fixtures/cockroach/down/12.sql +++ b/internal/e2e/fixtures/cockroach/down/12.sql @@ -13,6 +13,7 @@ CREATE TABLE e2e_user_posts ( user_id UUID NOT NULL, CONSTRAINT "primary" PRIMARY KEY (id ASC), UNIQUE INDEX e2e_user_notes_slug_idx (slug ASC), + INDEX e2e_user_notes_auto_index_e2e_user_notes_e2e_users_id_fk (user_id ASC), INDEX e2e_user_notes_user_id_idx (user_id ASC), FAMILY "primary" (id, content, slug, user_id) ); diff --git a/internal/e2e/fixtures/cockroach/down/13.sql b/internal/e2e/fixtures/cockroach/down/13.sql index 4e2b0f16..fb9dbdd9 100644 --- a/internal/e2e/fixtures/cockroach/down/13.sql +++ b/internal/e2e/fixtures/cockroach/down/13.sql @@ -13,6 +13,7 @@ CREATE TABLE e2e_user_posts ( author_id UUID NOT NULL, CONSTRAINT "primary" PRIMARY KEY (id ASC), UNIQUE INDEX e2e_user_notes_slug_idx (slug ASC), + INDEX e2e_user_notes_auto_index_e2e_user_notes_e2e_users_id_fk (author_id ASC), INDEX e2e_user_notes_user_id_idx (author_id ASC), FAMILY "primary" (id, content, slug, author_id) ); diff --git a/internal/e2e/fixtures/cockroach/down/14.sql b/internal/e2e/fixtures/cockroach/down/14.sql new file mode 100644 index 00000000..3b25bca5 --- /dev/null +++ b/internal/e2e/fixtures/cockroach/down/14.sql @@ -0,0 +1,31 @@ +CREATE TABLE e2e_authors ( + id UUID NOT NULL, + created_at TIMESTAMP NOT NULL, + updated_at TIMESTAMP NOT NULL, + CONSTRAINT "primary" PRIMARY KEY (id ASC), + FAMILY "primary" (id, created_at, updated_at) +); + +CREATE TABLE e2e_user_posts ( + id UUID NOT NULL, + content VARCHAR(255) NOT NULL DEFAULT '':::STRING, + slug VARCHAR(32) NOT NULL, + published BOOL NOT NULL DEFAULT false, + author_id UUID NULL, + CONSTRAINT "primary" PRIMARY KEY (id ASC), + UNIQUE INDEX e2e_user_notes_slug_idx (slug ASC), + INDEX e2e_user_notes_auto_index_e2e_user_notes_e2e_users_id_fk (author_id ASC), + INDEX e2e_user_notes_user_id_idx (author_id ASC), + FAMILY "primary" (id, content, slug, published, author_id) +); + +CREATE TABLE schema_migration ( + version VARCHAR(14) NOT NULL, + UNIQUE INDEX schema_migration_version_idx (version ASC), + FAMILY "primary" (version, rowid) +); + +ALTER TABLE e2e_user_posts ADD CONSTRAINT e2e_user_notes_e2e_users_id_fk FOREIGN KEY (author_id) REFERENCES e2e_authors(id) ON DELETE CASCADE; + +-- Validate foreign key constraints. These can fail if there was unvalidated data during the dump. +ALTER TABLE e2e_user_posts VALIDATE CONSTRAINT e2e_user_notes_e2e_users_id_fk; diff --git a/internal/e2e/fixtures/cockroach/down/15.sql b/internal/e2e/fixtures/cockroach/down/15.sql new file mode 100644 index 00000000..b8c6d372 --- /dev/null +++ b/internal/e2e/fixtures/cockroach/down/15.sql @@ -0,0 +1,62 @@ +CREATE TABLE e2e_address ( + id UUID NOT NULL, + CONSTRAINT "primary" PRIMARY KEY (id ASC), + FAMILY "primary" (id) +); + +CREATE TABLE e2e_authors ( + id UUID NOT NULL, + created_at TIMESTAMP NOT NULL, + updated_at TIMESTAMP NOT NULL, + CONSTRAINT "primary" PRIMARY KEY (id ASC), + FAMILY "primary" (id, created_at, updated_at) +); + +CREATE TABLE e2e_flow ( + id UUID NOT NULL, + CONSTRAINT "primary" PRIMARY KEY (id ASC), + FAMILY "primary" (id) +); + +CREATE TABLE e2e_token ( + id UUID NOT NULL, + token VARCHAR(64) NOT NULL, + e2e_address_id UUID NOT NULL, + expires_at TIMESTAMP NOT NULL DEFAULT '2000-01-01 00:00:00+00:00':::TIMESTAMP, + issued_at TIMESTAMP NOT NULL DEFAULT '2000-01-01 00:00:00+00:00':::TIMESTAMP, + e2e_flow_id UUID NOT NULL, + CONSTRAINT "primary" PRIMARY KEY (id ASC), + INDEX e2e_token_auto_index_e2e_token_e2e_address_id_fk (e2e_address_id ASC), + UNIQUE INDEX e2e_token_uq_idx (token ASC), + INDEX e2e_token_idx (token ASC), + INDEX e2e_token_auto_index_e2e_token_e2e_flow_id_fk (e2e_flow_id ASC), + FAMILY "primary" (id, token, e2e_address_id, expires_at, issued_at, e2e_flow_id) +); + +CREATE TABLE e2e_user_posts ( + id UUID NOT NULL, + content VARCHAR(255) NOT NULL DEFAULT '':::STRING, + slug VARCHAR(32) NOT NULL, + published BOOL NOT NULL DEFAULT false, + author_id UUID NULL, + CONSTRAINT "primary" PRIMARY KEY (id ASC), + UNIQUE INDEX e2e_user_notes_slug_idx (slug ASC), + INDEX e2e_user_notes_auto_index_e2e_user_notes_e2e_users_id_fk (author_id ASC), + INDEX e2e_user_notes_user_id_idx (author_id ASC), + FAMILY "primary" (id, content, slug, published, author_id) +); + +CREATE TABLE schema_migration ( + version VARCHAR(14) NOT NULL, + UNIQUE INDEX schema_migration_version_idx (version ASC), + FAMILY "primary" (version, rowid) +); + +ALTER TABLE e2e_token ADD CONSTRAINT e2e_token_e2e_address_id_fk FOREIGN KEY (e2e_address_id) REFERENCES e2e_address(id) ON DELETE CASCADE; +ALTER TABLE e2e_token ADD CONSTRAINT e2e_token_e2e_flow_id_fk FOREIGN KEY (e2e_flow_id) REFERENCES e2e_flow(id) ON DELETE CASCADE; +ALTER TABLE e2e_user_posts ADD CONSTRAINT e2e_user_notes_e2e_users_id_fk FOREIGN KEY (author_id) REFERENCES e2e_authors(id) ON DELETE CASCADE; + +-- Validate foreign key constraints. These can fail if there was unvalidated data during the dump. +ALTER TABLE e2e_token VALIDATE CONSTRAINT e2e_token_e2e_address_id_fk; +ALTER TABLE e2e_token VALIDATE CONSTRAINT e2e_token_e2e_flow_id_fk; +ALTER TABLE e2e_user_posts VALIDATE CONSTRAINT e2e_user_notes_e2e_users_id_fk; diff --git a/internal/e2e/fixtures/cockroach/down/2.sql b/internal/e2e/fixtures/cockroach/down/2.sql index c95705b5..25f52369 100644 --- a/internal/e2e/fixtures/cockroach/down/2.sql +++ b/internal/e2e/fixtures/cockroach/down/2.sql @@ -13,6 +13,7 @@ CREATE TABLE e2e_user_notes ( notes VARCHAR(255) NULL, title VARCHAR(64) NOT NULL DEFAULT '':::STRING, CONSTRAINT "primary" PRIMARY KEY (id ASC), + INDEX e2e_user_notes_auto_index_e2e_user_notes_e2e_users_id_fk (user_id ASC), INDEX e2e_user_notes_user_id_idx (user_id ASC), INDEX e2e_user_notes_title_idx (title ASC), FAMILY "primary" (id, user_id, notes, title) diff --git a/internal/e2e/fixtures/cockroach/down/3.sql b/internal/e2e/fixtures/cockroach/down/3.sql index f78cfb02..07a69de4 100644 --- a/internal/e2e/fixtures/cockroach/down/3.sql +++ b/internal/e2e/fixtures/cockroach/down/3.sql @@ -12,6 +12,7 @@ CREATE TABLE e2e_user_notes ( user_id UUID NOT NULL, notes VARCHAR(255) NULL, CONSTRAINT "primary" PRIMARY KEY (id ASC), + INDEX e2e_user_notes_auto_index_e2e_user_notes_e2e_users_id_fk (user_id ASC), INDEX e2e_user_notes_user_id_idx (user_id ASC), FAMILY "primary" (id, user_id, notes) ); diff --git a/internal/e2e/fixtures/cockroach/down/4.sql b/internal/e2e/fixtures/cockroach/down/4.sql index 0f5e1199..3cd32657 100644 --- a/internal/e2e/fixtures/cockroach/down/4.sql +++ b/internal/e2e/fixtures/cockroach/down/4.sql @@ -13,6 +13,7 @@ CREATE TABLE e2e_user_notes ( slug VARCHAR(64) NOT NULL, notes VARCHAR(255) NULL, CONSTRAINT "primary" PRIMARY KEY (id ASC), + INDEX e2e_user_notes_auto_index_e2e_user_notes_e2e_users_id_fk (user_id ASC), INDEX e2e_user_notes_user_id_idx (user_id ASC), UNIQUE INDEX e2e_user_notes_slug_idx (slug ASC), FAMILY "primary" (id, user_id, slug, notes) diff --git a/internal/e2e/fixtures/cockroach/down/5.sql b/internal/e2e/fixtures/cockroach/down/5.sql index 0f5e1199..3cd32657 100644 --- a/internal/e2e/fixtures/cockroach/down/5.sql +++ b/internal/e2e/fixtures/cockroach/down/5.sql @@ -13,6 +13,7 @@ CREATE TABLE e2e_user_notes ( slug VARCHAR(64) NOT NULL, notes VARCHAR(255) NULL, CONSTRAINT "primary" PRIMARY KEY (id ASC), + INDEX e2e_user_notes_auto_index_e2e_user_notes_e2e_users_id_fk (user_id ASC), INDEX e2e_user_notes_user_id_idx (user_id ASC), UNIQUE INDEX e2e_user_notes_slug_idx (slug ASC), FAMILY "primary" (id, user_id, slug, notes) diff --git a/internal/e2e/fixtures/cockroach/down/6.sql b/internal/e2e/fixtures/cockroach/down/6.sql index 0f5e1199..3cd32657 100644 --- a/internal/e2e/fixtures/cockroach/down/6.sql +++ b/internal/e2e/fixtures/cockroach/down/6.sql @@ -13,6 +13,7 @@ CREATE TABLE e2e_user_notes ( slug VARCHAR(64) NOT NULL, notes VARCHAR(255) NULL, CONSTRAINT "primary" PRIMARY KEY (id ASC), + INDEX e2e_user_notes_auto_index_e2e_user_notes_e2e_users_id_fk (user_id ASC), INDEX e2e_user_notes_user_id_idx (user_id ASC), UNIQUE INDEX e2e_user_notes_slug_idx (slug ASC), FAMILY "primary" (id, user_id, slug, notes) diff --git a/internal/e2e/fixtures/cockroach/down/7.sql b/internal/e2e/fixtures/cockroach/down/7.sql index 1a949cee..a3f547f1 100644 --- a/internal/e2e/fixtures/cockroach/down/7.sql +++ b/internal/e2e/fixtures/cockroach/down/7.sql @@ -13,6 +13,7 @@ CREATE TABLE e2e_user_posts ( slug VARCHAR(64) NOT NULL, notes VARCHAR(255) NULL, CONSTRAINT "primary" PRIMARY KEY (id ASC), + INDEX e2e_user_notes_auto_index_e2e_user_notes_e2e_users_id_fk (user_id ASC), INDEX e2e_user_notes_user_id_idx (user_id ASC), UNIQUE INDEX e2e_user_notes_slug_idx (slug ASC), FAMILY "primary" (id, user_id, slug, notes) diff --git a/internal/e2e/fixtures/cockroach/down/8.sql b/internal/e2e/fixtures/cockroach/down/8.sql index 6f6545f4..cd092333 100644 --- a/internal/e2e/fixtures/cockroach/down/8.sql +++ b/internal/e2e/fixtures/cockroach/down/8.sql @@ -13,6 +13,7 @@ CREATE TABLE e2e_user_posts ( user_id UUID NOT NULL, slug VARCHAR(64) NOT NULL, CONSTRAINT "primary" PRIMARY KEY (id ASC), + INDEX e2e_user_notes_auto_index_e2e_user_notes_e2e_users_id_fk (user_id ASC), INDEX e2e_user_notes_user_id_idx (user_id ASC), UNIQUE INDEX e2e_user_notes_slug_idx (slug ASC), FAMILY "primary" (id, content, user_id, slug) diff --git a/internal/e2e/fixtures/cockroach/down/9.sql b/internal/e2e/fixtures/cockroach/down/9.sql index 33a56089..f0d7431c 100644 --- a/internal/e2e/fixtures/cockroach/down/9.sql +++ b/internal/e2e/fixtures/cockroach/down/9.sql @@ -13,6 +13,7 @@ CREATE TABLE e2e_user_posts ( user_id UUID NOT NULL, slug VARCHAR(64) NOT NULL, CONSTRAINT "primary" PRIMARY KEY (id ASC), + INDEX e2e_user_notes_auto_index_e2e_user_notes_e2e_users_id_fk (user_id ASC), INDEX e2e_user_notes_user_id_idx (user_id ASC), UNIQUE INDEX e2e_user_notes_slug_idx (slug ASC), FAMILY "primary" (id, content, user_id, slug) diff --git a/internal/e2e/fixtures/cockroach/up/13.sql b/internal/e2e/fixtures/cockroach/up/13.sql index 71d015bb..3b25bca5 100644 --- a/internal/e2e/fixtures/cockroach/up/13.sql +++ b/internal/e2e/fixtures/cockroach/up/13.sql @@ -14,6 +14,7 @@ CREATE TABLE e2e_user_posts ( author_id UUID NULL, CONSTRAINT "primary" PRIMARY KEY (id ASC), UNIQUE INDEX e2e_user_notes_slug_idx (slug ASC), + INDEX e2e_user_notes_auto_index_e2e_user_notes_e2e_users_id_fk (author_id ASC), INDEX e2e_user_notes_user_id_idx (author_id ASC), FAMILY "primary" (id, content, slug, published, author_id) ); diff --git a/internal/e2e/fixtures/cockroach/up/14.sql b/internal/e2e/fixtures/cockroach/up/14.sql new file mode 100644 index 00000000..611a3bf1 --- /dev/null +++ b/internal/e2e/fixtures/cockroach/up/14.sql @@ -0,0 +1,60 @@ +CREATE TABLE e2e_address ( + id UUID NOT NULL, + CONSTRAINT "primary" PRIMARY KEY (id ASC), + FAMILY "primary" (id) +); + +CREATE TABLE e2e_authors ( + id UUID NOT NULL, + created_at TIMESTAMP NOT NULL, + updated_at TIMESTAMP NOT NULL, + CONSTRAINT "primary" PRIMARY KEY (id ASC), + FAMILY "primary" (id, created_at, updated_at) +); + +CREATE TABLE e2e_flow ( + id UUID NOT NULL, + CONSTRAINT "primary" PRIMARY KEY (id ASC), + FAMILY "primary" (id) +); + +CREATE TABLE e2e_token ( + id UUID NOT NULL, + token VARCHAR(64) NOT NULL, + e2e_flow_id UUID NOT NULL, + e2e_address_id UUID NOT NULL, + CONSTRAINT "primary" PRIMARY KEY (id ASC), + INDEX e2e_token_auto_index_e2e_token_e2e_flow_id_fk (e2e_flow_id ASC), + INDEX e2e_token_auto_index_e2e_token_e2e_address_id_fk (e2e_address_id ASC), + UNIQUE INDEX e2e_token_uq_idx (token ASC), + INDEX e2e_token_idx (token ASC), + FAMILY "primary" (id, token, e2e_flow_id, e2e_address_id) +); + +CREATE TABLE e2e_user_posts ( + id UUID NOT NULL, + content VARCHAR(255) NOT NULL DEFAULT '':::STRING, + slug VARCHAR(32) NOT NULL, + published BOOL NOT NULL DEFAULT false, + author_id UUID NULL, + CONSTRAINT "primary" PRIMARY KEY (id ASC), + UNIQUE INDEX e2e_user_notes_slug_idx (slug ASC), + INDEX e2e_user_notes_auto_index_e2e_user_notes_e2e_users_id_fk (author_id ASC), + INDEX e2e_user_notes_user_id_idx (author_id ASC), + FAMILY "primary" (id, content, slug, published, author_id) +); + +CREATE TABLE schema_migration ( + version VARCHAR(14) NOT NULL, + UNIQUE INDEX schema_migration_version_idx (version ASC), + FAMILY "primary" (version, rowid) +); + +ALTER TABLE e2e_token ADD CONSTRAINT e2e_token_e2e_flow_id_fk FOREIGN KEY (e2e_flow_id) REFERENCES e2e_flow(id) ON DELETE CASCADE; +ALTER TABLE e2e_token ADD CONSTRAINT e2e_token_e2e_address_id_fk FOREIGN KEY (e2e_address_id) REFERENCES e2e_address(id) ON DELETE CASCADE; +ALTER TABLE e2e_user_posts ADD CONSTRAINT e2e_user_notes_e2e_users_id_fk FOREIGN KEY (author_id) REFERENCES e2e_authors(id) ON DELETE CASCADE; + +-- Validate foreign key constraints. These can fail if there was unvalidated data during the dump. +ALTER TABLE e2e_token VALIDATE CONSTRAINT e2e_token_e2e_flow_id_fk; +ALTER TABLE e2e_token VALIDATE CONSTRAINT e2e_token_e2e_address_id_fk; +ALTER TABLE e2e_user_posts VALIDATE CONSTRAINT e2e_user_notes_e2e_users_id_fk; diff --git a/internal/e2e/fixtures/cockroach/up/15.sql b/internal/e2e/fixtures/cockroach/up/15.sql new file mode 100644 index 00000000..833b8b4f --- /dev/null +++ b/internal/e2e/fixtures/cockroach/up/15.sql @@ -0,0 +1,62 @@ +CREATE TABLE e2e_address ( + id UUID NOT NULL, + CONSTRAINT "primary" PRIMARY KEY (id ASC), + FAMILY "primary" (id) +); + +CREATE TABLE e2e_authors ( + id UUID NOT NULL, + created_at TIMESTAMP NOT NULL, + updated_at TIMESTAMP NOT NULL, + CONSTRAINT "primary" PRIMARY KEY (id ASC), + FAMILY "primary" (id, created_at, updated_at) +); + +CREATE TABLE e2e_flow ( + id UUID NOT NULL, + CONSTRAINT "primary" PRIMARY KEY (id ASC), + FAMILY "primary" (id) +); + +CREATE TABLE e2e_token ( + id UUID NOT NULL, + token VARCHAR(64) NOT NULL, + e2e_address_id UUID NOT NULL, + expires_at TIMESTAMP NOT NULL DEFAULT '2000-01-01 00:00:00+00:00':::TIMESTAMP, + issued_at TIMESTAMP NOT NULL DEFAULT '2000-01-01 00:00:00+00:00':::TIMESTAMP, + e2e_flow_id UUID NULL, + CONSTRAINT "primary" PRIMARY KEY (id ASC), + INDEX e2e_token_auto_index_e2e_token_e2e_address_id_fk (e2e_address_id ASC), + UNIQUE INDEX e2e_token_uq_idx (token ASC), + INDEX e2e_token_idx (token ASC), + INDEX e2e_token_auto_index_e2e_token_e2e_flow_id_fk (e2e_flow_id ASC), + FAMILY "primary" (id, token, e2e_address_id, expires_at, issued_at, e2e_flow_id) +); + +CREATE TABLE e2e_user_posts ( + id UUID NOT NULL, + content VARCHAR(255) NOT NULL DEFAULT '':::STRING, + slug VARCHAR(32) NOT NULL, + published BOOL NOT NULL DEFAULT false, + author_id UUID NULL, + CONSTRAINT "primary" PRIMARY KEY (id ASC), + UNIQUE INDEX e2e_user_notes_slug_idx (slug ASC), + INDEX e2e_user_notes_auto_index_e2e_user_notes_e2e_users_id_fk (author_id ASC), + INDEX e2e_user_notes_user_id_idx (author_id ASC), + FAMILY "primary" (id, content, slug, published, author_id) +); + +CREATE TABLE schema_migration ( + version VARCHAR(14) NOT NULL, + UNIQUE INDEX schema_migration_version_idx (version ASC), + FAMILY "primary" (version, rowid) +); + +ALTER TABLE e2e_token ADD CONSTRAINT e2e_token_e2e_address_id_fk FOREIGN KEY (e2e_address_id) REFERENCES e2e_address(id) ON DELETE CASCADE; +ALTER TABLE e2e_token ADD CONSTRAINT e2e_token_e2e_flow_id_fk FOREIGN KEY (e2e_flow_id) REFERENCES e2e_flow(id) ON DELETE CASCADE; +ALTER TABLE e2e_user_posts ADD CONSTRAINT e2e_user_notes_e2e_users_id_fk FOREIGN KEY (author_id) REFERENCES e2e_authors(id) ON DELETE CASCADE; + +-- Validate foreign key constraints. These can fail if there was unvalidated data during the dump. +ALTER TABLE e2e_token VALIDATE CONSTRAINT e2e_token_e2e_address_id_fk; +ALTER TABLE e2e_token VALIDATE CONSTRAINT e2e_token_e2e_flow_id_fk; +ALTER TABLE e2e_user_posts VALIDATE CONSTRAINT e2e_user_notes_e2e_users_id_fk; diff --git a/internal/e2e/fixtures/mysql/down/0.sql b/internal/e2e/fixtures/mysql/down/0.sql index 8ed27b00..3678352a 100644 --- a/internal/e2e/fixtures/mysql/down/0.sql +++ b/internal/e2e/fixtures/mysql/down/0.sql @@ -1,4 +1,4 @@ --- MySQL dump 10.13 Distrib 5.7.29, for macos10.14 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ @@ -7,7 +7,7 @@ /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +/*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; @@ -21,7 +21,7 @@ DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) @@ -37,4 +37,4 @@ CREATE TABLE `schema_migration` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-08-30 23:11:40 +-- Dump completed on 2020-09-03 11:40:22 diff --git a/internal/e2e/fixtures/mysql/down/1.sql b/internal/e2e/fixtures/mysql/down/1.sql index 875fac2b..f6e329b4 100644 --- a/internal/e2e/fixtures/mysql/down/1.sql +++ b/internal/e2e/fixtures/mysql/down/1.sql @@ -1,4 +1,4 @@ --- MySQL dump 10.13 Distrib 5.7.29, for macos10.14 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ @@ -7,7 +7,7 @@ /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +/*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; @@ -21,7 +21,7 @@ DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `created_at` datetime NOT NULL, @@ -37,7 +37,7 @@ CREATE TABLE `e2e_users` ( DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) @@ -53,4 +53,4 @@ CREATE TABLE `schema_migration` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-08-30 23:11:40 +-- Dump completed on 2020-09-03 11:40:22 diff --git a/internal/e2e/fixtures/mysql/down/10.sql b/internal/e2e/fixtures/mysql/down/10.sql index 44fc79c8..0bba3ca3 100644 --- a/internal/e2e/fixtures/mysql/down/10.sql +++ b/internal/e2e/fixtures/mysql/down/10.sql @@ -1,4 +1,4 @@ --- MySQL dump 10.13 Distrib 5.7.29, for macos10.14 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ @@ -7,7 +7,7 @@ /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +/*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; @@ -21,7 +21,7 @@ DROP TABLE IF EXISTS `e2e_user_posts`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_posts` ( `id` char(36) NOT NULL, `user_id` char(36) NOT NULL, @@ -40,7 +40,7 @@ CREATE TABLE `e2e_user_posts` ( DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `created_at` datetime NOT NULL, @@ -55,7 +55,7 @@ CREATE TABLE `e2e_users` ( DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) @@ -71,4 +71,4 @@ CREATE TABLE `schema_migration` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-08-30 23:11:36 +-- Dump completed on 2020-09-03 11:40:18 diff --git a/internal/e2e/fixtures/mysql/down/11.sql b/internal/e2e/fixtures/mysql/down/11.sql index dc1b9290..5a2597e0 100644 --- a/internal/e2e/fixtures/mysql/down/11.sql +++ b/internal/e2e/fixtures/mysql/down/11.sql @@ -1,4 +1,4 @@ --- MySQL dump 10.13 Distrib 5.7.29, for macos10.14 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ @@ -7,7 +7,7 @@ /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +/*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; @@ -21,7 +21,7 @@ DROP TABLE IF EXISTS `e2e_user_posts`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_posts` ( `id` char(36) NOT NULL, `user_id` char(36) NOT NULL, @@ -40,7 +40,7 @@ CREATE TABLE `e2e_user_posts` ( DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `created_at` datetime NOT NULL, @@ -55,7 +55,7 @@ CREATE TABLE `e2e_users` ( DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) @@ -71,4 +71,4 @@ CREATE TABLE `schema_migration` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-08-30 23:11:36 +-- Dump completed on 2020-09-03 11:40:18 diff --git a/internal/e2e/fixtures/mysql/down/12.sql b/internal/e2e/fixtures/mysql/down/12.sql index b011cb3c..704f6428 100644 --- a/internal/e2e/fixtures/mysql/down/12.sql +++ b/internal/e2e/fixtures/mysql/down/12.sql @@ -1,4 +1,4 @@ --- MySQL dump 10.13 Distrib 5.7.29, for macos10.14 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ @@ -7,7 +7,7 @@ /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +/*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; @@ -21,7 +21,7 @@ DROP TABLE IF EXISTS `e2e_authors`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_authors` ( `id` char(36) NOT NULL, `created_at` datetime NOT NULL, @@ -36,7 +36,7 @@ CREATE TABLE `e2e_authors` ( DROP TABLE IF EXISTS `e2e_user_posts`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_posts` ( `id` char(36) NOT NULL, `user_id` char(36) NOT NULL, @@ -55,7 +55,7 @@ CREATE TABLE `e2e_user_posts` ( DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) @@ -71,4 +71,4 @@ CREATE TABLE `schema_migration` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-08-30 23:11:36 +-- Dump completed on 2020-09-03 11:40:18 diff --git a/internal/e2e/fixtures/mysql/down/13.sql b/internal/e2e/fixtures/mysql/down/13.sql index 39dc23e9..93e3a1d4 100644 --- a/internal/e2e/fixtures/mysql/down/13.sql +++ b/internal/e2e/fixtures/mysql/down/13.sql @@ -1,4 +1,4 @@ --- MySQL dump 10.13 Distrib 5.7.29, for macos10.14 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ @@ -7,7 +7,7 @@ /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +/*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; @@ -21,7 +21,7 @@ DROP TABLE IF EXISTS `e2e_authors`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_authors` ( `id` char(36) NOT NULL, `created_at` datetime NOT NULL, @@ -36,7 +36,7 @@ CREATE TABLE `e2e_authors` ( DROP TABLE IF EXISTS `e2e_user_posts`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_posts` ( `id` char(36) NOT NULL, `author_id` char(36) NOT NULL, @@ -55,7 +55,7 @@ CREATE TABLE `e2e_user_posts` ( DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) @@ -71,4 +71,4 @@ CREATE TABLE `schema_migration` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-08-30 23:11:35 +-- Dump completed on 2020-09-03 11:40:17 diff --git a/internal/e2e/fixtures/mysql/down/14.sql b/internal/e2e/fixtures/mysql/down/14.sql new file mode 100644 index 00000000..345aaec4 --- /dev/null +++ b/internal/e2e/fixtures/mysql/down/14.sql @@ -0,0 +1,75 @@ +-- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) +-- +-- Host: 127.0.0.1 Database: pop_test +-- ------------------------------------------------------ +-- Server version 5.7.31 + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!50503 SET NAMES utf8mb4 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `e2e_authors` +-- + +DROP TABLE IF EXISTS `e2e_authors`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `e2e_authors` ( + `id` char(36) NOT NULL, + `created_at` datetime NOT NULL, + `updated_at` datetime NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `e2e_user_posts` +-- + +DROP TABLE IF EXISTS `e2e_user_posts`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `e2e_user_posts` ( + `id` char(36) NOT NULL, + `author_id` char(36) DEFAULT NULL, + `slug` varchar(32) NOT NULL, + `content` varchar(255) NOT NULL DEFAULT '', + `published` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `e2e_user_notes_slug_idx` (`slug`), + KEY `e2e_user_notes_user_id_idx` (`author_id`), + CONSTRAINT `e2e_user_posts_ibfk_1` FOREIGN KEY (`author_id`) REFERENCES `e2e_authors` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `schema_migration` +-- + +DROP TABLE IF EXISTS `schema_migration`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `schema_migration` ( + `version` varchar(14) NOT NULL, + UNIQUE KEY `schema_migration_version_idx` (`version`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2020-09-03 11:40:17 diff --git a/internal/e2e/fixtures/mysql/down/15.sql b/internal/e2e/fixtures/mysql/down/15.sql new file mode 100644 index 00000000..a096f11a --- /dev/null +++ b/internal/e2e/fixtures/mysql/down/15.sql @@ -0,0 +1,125 @@ +-- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) +-- +-- Host: 127.0.0.1 Database: pop_test +-- ------------------------------------------------------ +-- Server version 5.7.31 + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!50503 SET NAMES utf8mb4 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `e2e_address` +-- + +DROP TABLE IF EXISTS `e2e_address`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `e2e_address` ( + `id` char(36) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `e2e_authors` +-- + +DROP TABLE IF EXISTS `e2e_authors`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `e2e_authors` ( + `id` char(36) NOT NULL, + `created_at` datetime NOT NULL, + `updated_at` datetime NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `e2e_flow` +-- + +DROP TABLE IF EXISTS `e2e_flow`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `e2e_flow` ( + `id` char(36) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `e2e_token` +-- + +DROP TABLE IF EXISTS `e2e_token`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `e2e_token` ( + `id` char(36) NOT NULL, + `token` varchar(64) NOT NULL, + `e2e_flow_id` char(36) NOT NULL, + `e2e_address_id` char(36) NOT NULL, + `expires_at` datetime NOT NULL DEFAULT '2000-01-01 00:00:00', + `issued_at` datetime NOT NULL DEFAULT '2000-01-01 00:00:00', + PRIMARY KEY (`id`), + UNIQUE KEY `e2e_token_uq_idx` (`token`), + KEY `e2e_flow_id` (`e2e_flow_id`), + KEY `e2e_address_id` (`e2e_address_id`), + KEY `e2e_token_idx` (`token`), + CONSTRAINT `e2e_token_ibfk_1` FOREIGN KEY (`e2e_flow_id`) REFERENCES `e2e_flow` (`id`) ON DELETE CASCADE, + CONSTRAINT `e2e_token_ibfk_2` FOREIGN KEY (`e2e_address_id`) REFERENCES `e2e_address` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `e2e_user_posts` +-- + +DROP TABLE IF EXISTS `e2e_user_posts`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `e2e_user_posts` ( + `id` char(36) NOT NULL, + `author_id` char(36) DEFAULT NULL, + `slug` varchar(32) NOT NULL, + `content` varchar(255) NOT NULL DEFAULT '', + `published` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `e2e_user_notes_slug_idx` (`slug`), + KEY `e2e_user_notes_user_id_idx` (`author_id`), + CONSTRAINT `e2e_user_posts_ibfk_1` FOREIGN KEY (`author_id`) REFERENCES `e2e_authors` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `schema_migration` +-- + +DROP TABLE IF EXISTS `schema_migration`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `schema_migration` ( + `version` varchar(14) NOT NULL, + UNIQUE KEY `schema_migration_version_idx` (`version`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2020-09-03 11:40:17 diff --git a/internal/e2e/fixtures/mysql/down/2.sql b/internal/e2e/fixtures/mysql/down/2.sql index 06e316c5..2f627f4e 100644 --- a/internal/e2e/fixtures/mysql/down/2.sql +++ b/internal/e2e/fixtures/mysql/down/2.sql @@ -1,4 +1,4 @@ --- MySQL dump 10.13 Distrib 5.7.29, for macos10.14 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ @@ -7,7 +7,7 @@ /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +/*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; @@ -21,7 +21,7 @@ DROP TABLE IF EXISTS `e2e_user_notes`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_notes` ( `id` char(36) NOT NULL, `user_id` char(36) NOT NULL, @@ -40,7 +40,7 @@ CREATE TABLE `e2e_user_notes` ( DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `created_at` datetime NOT NULL, @@ -56,7 +56,7 @@ CREATE TABLE `e2e_users` ( DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) @@ -72,4 +72,4 @@ CREATE TABLE `schema_migration` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-08-30 23:11:40 +-- Dump completed on 2020-09-03 11:40:21 diff --git a/internal/e2e/fixtures/mysql/down/3.sql b/internal/e2e/fixtures/mysql/down/3.sql index 9d4c48a6..65f4e20c 100644 --- a/internal/e2e/fixtures/mysql/down/3.sql +++ b/internal/e2e/fixtures/mysql/down/3.sql @@ -1,4 +1,4 @@ --- MySQL dump 10.13 Distrib 5.7.29, for macos10.14 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ @@ -7,7 +7,7 @@ /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +/*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; @@ -21,7 +21,7 @@ DROP TABLE IF EXISTS `e2e_user_notes`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_notes` ( `id` char(36) NOT NULL, `user_id` char(36) NOT NULL, @@ -38,7 +38,7 @@ CREATE TABLE `e2e_user_notes` ( DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `created_at` datetime NOT NULL, @@ -54,7 +54,7 @@ CREATE TABLE `e2e_users` ( DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) @@ -70,4 +70,4 @@ CREATE TABLE `schema_migration` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-08-30 23:11:39 +-- Dump completed on 2020-09-03 11:40:21 diff --git a/internal/e2e/fixtures/mysql/down/4.sql b/internal/e2e/fixtures/mysql/down/4.sql index 2c41ae81..13a3cb14 100644 --- a/internal/e2e/fixtures/mysql/down/4.sql +++ b/internal/e2e/fixtures/mysql/down/4.sql @@ -1,4 +1,4 @@ --- MySQL dump 10.13 Distrib 5.7.29, for macos10.14 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ @@ -7,7 +7,7 @@ /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +/*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; @@ -21,7 +21,7 @@ DROP TABLE IF EXISTS `e2e_user_notes`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_notes` ( `id` char(36) NOT NULL, `user_id` char(36) NOT NULL, @@ -40,7 +40,7 @@ CREATE TABLE `e2e_user_notes` ( DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `created_at` datetime NOT NULL, @@ -56,7 +56,7 @@ CREATE TABLE `e2e_users` ( DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) @@ -72,4 +72,4 @@ CREATE TABLE `schema_migration` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-08-30 23:11:39 +-- Dump completed on 2020-09-03 11:40:20 diff --git a/internal/e2e/fixtures/mysql/down/5.sql b/internal/e2e/fixtures/mysql/down/5.sql index f03d6cda..13a3cb14 100644 --- a/internal/e2e/fixtures/mysql/down/5.sql +++ b/internal/e2e/fixtures/mysql/down/5.sql @@ -1,4 +1,4 @@ --- MySQL dump 10.13 Distrib 5.7.29, for macos10.14 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ @@ -7,7 +7,7 @@ /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +/*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; @@ -21,7 +21,7 @@ DROP TABLE IF EXISTS `e2e_user_notes`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_notes` ( `id` char(36) NOT NULL, `user_id` char(36) NOT NULL, @@ -40,7 +40,7 @@ CREATE TABLE `e2e_user_notes` ( DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `created_at` datetime NOT NULL, @@ -56,7 +56,7 @@ CREATE TABLE `e2e_users` ( DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) @@ -72,4 +72,4 @@ CREATE TABLE `schema_migration` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-08-30 23:11:38 +-- Dump completed on 2020-09-03 11:40:20 diff --git a/internal/e2e/fixtures/mysql/down/6.sql b/internal/e2e/fixtures/mysql/down/6.sql index f03d6cda..13a3cb14 100644 --- a/internal/e2e/fixtures/mysql/down/6.sql +++ b/internal/e2e/fixtures/mysql/down/6.sql @@ -1,4 +1,4 @@ --- MySQL dump 10.13 Distrib 5.7.29, for macos10.14 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ @@ -7,7 +7,7 @@ /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +/*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; @@ -21,7 +21,7 @@ DROP TABLE IF EXISTS `e2e_user_notes`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_notes` ( `id` char(36) NOT NULL, `user_id` char(36) NOT NULL, @@ -40,7 +40,7 @@ CREATE TABLE `e2e_user_notes` ( DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `created_at` datetime NOT NULL, @@ -56,7 +56,7 @@ CREATE TABLE `e2e_users` ( DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) @@ -72,4 +72,4 @@ CREATE TABLE `schema_migration` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-08-30 23:11:38 +-- Dump completed on 2020-09-03 11:40:20 diff --git a/internal/e2e/fixtures/mysql/down/7.sql b/internal/e2e/fixtures/mysql/down/7.sql index 22429643..3e9364df 100644 --- a/internal/e2e/fixtures/mysql/down/7.sql +++ b/internal/e2e/fixtures/mysql/down/7.sql @@ -1,4 +1,4 @@ --- MySQL dump 10.13 Distrib 5.7.29, for macos10.14 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ @@ -7,7 +7,7 @@ /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +/*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; @@ -21,7 +21,7 @@ DROP TABLE IF EXISTS `e2e_user_posts`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_posts` ( `id` char(36) NOT NULL, `user_id` char(36) NOT NULL, @@ -40,7 +40,7 @@ CREATE TABLE `e2e_user_posts` ( DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `created_at` datetime NOT NULL, @@ -56,7 +56,7 @@ CREATE TABLE `e2e_users` ( DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) @@ -72,4 +72,4 @@ CREATE TABLE `schema_migration` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-08-30 23:11:38 +-- Dump completed on 2020-09-03 11:40:19 diff --git a/internal/e2e/fixtures/mysql/down/8.sql b/internal/e2e/fixtures/mysql/down/8.sql index 3dc563ed..e5fde8cf 100644 --- a/internal/e2e/fixtures/mysql/down/8.sql +++ b/internal/e2e/fixtures/mysql/down/8.sql @@ -1,4 +1,4 @@ --- MySQL dump 10.13 Distrib 5.7.29, for macos10.14 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ @@ -7,7 +7,7 @@ /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +/*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; @@ -21,7 +21,7 @@ DROP TABLE IF EXISTS `e2e_user_posts`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_posts` ( `id` char(36) NOT NULL, `user_id` char(36) NOT NULL, @@ -40,7 +40,7 @@ CREATE TABLE `e2e_user_posts` ( DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `created_at` datetime NOT NULL, @@ -56,7 +56,7 @@ CREATE TABLE `e2e_users` ( DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) @@ -72,4 +72,4 @@ CREATE TABLE `schema_migration` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-08-30 23:11:37 +-- Dump completed on 2020-09-03 11:40:19 diff --git a/internal/e2e/fixtures/mysql/down/9.sql b/internal/e2e/fixtures/mysql/down/9.sql index 59024f1c..01662983 100644 --- a/internal/e2e/fixtures/mysql/down/9.sql +++ b/internal/e2e/fixtures/mysql/down/9.sql @@ -1,4 +1,4 @@ --- MySQL dump 10.13 Distrib 5.7.29, for macos10.14 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ @@ -7,7 +7,7 @@ /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +/*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; @@ -21,7 +21,7 @@ DROP TABLE IF EXISTS `e2e_user_posts`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_posts` ( `id` char(36) NOT NULL, `user_id` char(36) NOT NULL, @@ -40,7 +40,7 @@ CREATE TABLE `e2e_user_posts` ( DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `created_at` datetime NOT NULL, @@ -56,7 +56,7 @@ CREATE TABLE `e2e_users` ( DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) @@ -72,4 +72,4 @@ CREATE TABLE `schema_migration` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-08-30 23:11:37 +-- Dump completed on 2020-09-03 11:40:19 diff --git a/internal/e2e/fixtures/mysql/up/0.sql b/internal/e2e/fixtures/mysql/up/0.sql index f5dc979d..41b83d43 100644 --- a/internal/e2e/fixtures/mysql/up/0.sql +++ b/internal/e2e/fixtures/mysql/up/0.sql @@ -1,4 +1,4 @@ --- MySQL dump 10.13 Distrib 5.7.29, for macos10.14 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ @@ -7,7 +7,7 @@ /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +/*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; @@ -21,7 +21,7 @@ DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `username` varchar(255) DEFAULT NULL, @@ -37,7 +37,7 @@ CREATE TABLE `e2e_users` ( DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) @@ -53,4 +53,4 @@ CREATE TABLE `schema_migration` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-08-30 23:11:29 +-- Dump completed on 2020-09-03 11:40:11 diff --git a/internal/e2e/fixtures/mysql/up/1.sql b/internal/e2e/fixtures/mysql/up/1.sql index 737d9380..f57f5f90 100644 --- a/internal/e2e/fixtures/mysql/up/1.sql +++ b/internal/e2e/fixtures/mysql/up/1.sql @@ -1,4 +1,4 @@ --- MySQL dump 10.13 Distrib 5.7.29, for macos10.14 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ @@ -7,7 +7,7 @@ /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +/*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; @@ -21,7 +21,7 @@ DROP TABLE IF EXISTS `e2e_user_notes`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_notes` ( `id` char(36) NOT NULL, `notes` varchar(255) DEFAULT NULL, @@ -40,7 +40,7 @@ CREATE TABLE `e2e_user_notes` ( DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `username` varchar(255) DEFAULT NULL, @@ -56,7 +56,7 @@ CREATE TABLE `e2e_users` ( DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) @@ -72,4 +72,4 @@ CREATE TABLE `schema_migration` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-08-30 23:11:30 +-- Dump completed on 2020-09-03 11:40:11 diff --git a/internal/e2e/fixtures/mysql/up/10.sql b/internal/e2e/fixtures/mysql/up/10.sql index 718bf695..93603ddc 100644 --- a/internal/e2e/fixtures/mysql/up/10.sql +++ b/internal/e2e/fixtures/mysql/up/10.sql @@ -1,4 +1,4 @@ --- MySQL dump 10.13 Distrib 5.7.29, for macos10.14 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ @@ -7,7 +7,7 @@ /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +/*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; @@ -21,7 +21,7 @@ DROP TABLE IF EXISTS `e2e_user_posts`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_posts` ( `id` char(36) NOT NULL, `user_id` char(36) NOT NULL, @@ -40,7 +40,7 @@ CREATE TABLE `e2e_user_posts` ( DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `created_at` datetime NOT NULL, @@ -55,7 +55,7 @@ CREATE TABLE `e2e_users` ( DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) @@ -71,4 +71,4 @@ CREATE TABLE `schema_migration` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-08-30 23:11:34 +-- Dump completed on 2020-09-03 11:40:14 diff --git a/internal/e2e/fixtures/mysql/up/11.sql b/internal/e2e/fixtures/mysql/up/11.sql index d48c741a..ababca56 100644 --- a/internal/e2e/fixtures/mysql/up/11.sql +++ b/internal/e2e/fixtures/mysql/up/11.sql @@ -1,4 +1,4 @@ --- MySQL dump 10.13 Distrib 5.7.29, for macos10.14 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ @@ -7,7 +7,7 @@ /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +/*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; @@ -21,7 +21,7 @@ DROP TABLE IF EXISTS `e2e_authors`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_authors` ( `id` char(36) NOT NULL, `created_at` datetime NOT NULL, @@ -36,7 +36,7 @@ CREATE TABLE `e2e_authors` ( DROP TABLE IF EXISTS `e2e_user_posts`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_posts` ( `id` char(36) NOT NULL, `user_id` char(36) NOT NULL, @@ -55,7 +55,7 @@ CREATE TABLE `e2e_user_posts` ( DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) @@ -71,4 +71,4 @@ CREATE TABLE `schema_migration` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-08-30 23:11:34 +-- Dump completed on 2020-09-03 11:40:14 diff --git a/internal/e2e/fixtures/mysql/up/12.sql b/internal/e2e/fixtures/mysql/up/12.sql index 39dc23e9..38006379 100644 --- a/internal/e2e/fixtures/mysql/up/12.sql +++ b/internal/e2e/fixtures/mysql/up/12.sql @@ -1,4 +1,4 @@ --- MySQL dump 10.13 Distrib 5.7.29, for macos10.14 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ @@ -7,7 +7,7 @@ /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +/*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; @@ -21,7 +21,7 @@ DROP TABLE IF EXISTS `e2e_authors`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_authors` ( `id` char(36) NOT NULL, `created_at` datetime NOT NULL, @@ -36,7 +36,7 @@ CREATE TABLE `e2e_authors` ( DROP TABLE IF EXISTS `e2e_user_posts`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_posts` ( `id` char(36) NOT NULL, `author_id` char(36) NOT NULL, @@ -55,7 +55,7 @@ CREATE TABLE `e2e_user_posts` ( DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) @@ -71,4 +71,4 @@ CREATE TABLE `schema_migration` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-08-30 23:11:35 +-- Dump completed on 2020-09-03 11:40:15 diff --git a/internal/e2e/fixtures/mysql/up/13.sql b/internal/e2e/fixtures/mysql/up/13.sql index 2842e22f..1b2b8ccd 100644 --- a/internal/e2e/fixtures/mysql/up/13.sql +++ b/internal/e2e/fixtures/mysql/up/13.sql @@ -1,4 +1,4 @@ --- MySQL dump 10.13 Distrib 5.7.29, for macos10.14 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ @@ -7,7 +7,7 @@ /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +/*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; @@ -21,7 +21,7 @@ DROP TABLE IF EXISTS `e2e_authors`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_authors` ( `id` char(36) NOT NULL, `created_at` datetime NOT NULL, @@ -36,7 +36,7 @@ CREATE TABLE `e2e_authors` ( DROP TABLE IF EXISTS `e2e_user_posts`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_posts` ( `id` char(36) NOT NULL, `author_id` char(36) DEFAULT NULL, @@ -56,7 +56,7 @@ CREATE TABLE `e2e_user_posts` ( DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) @@ -72,4 +72,4 @@ CREATE TABLE `schema_migration` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-08-30 23:11:35 +-- Dump completed on 2020-09-03 11:40:15 diff --git a/internal/e2e/fixtures/mysql/up/14.sql b/internal/e2e/fixtures/mysql/up/14.sql new file mode 100644 index 00000000..76e0039b --- /dev/null +++ b/internal/e2e/fixtures/mysql/up/14.sql @@ -0,0 +1,123 @@ +-- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) +-- +-- Host: 127.0.0.1 Database: pop_test +-- ------------------------------------------------------ +-- Server version 5.7.31 + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!50503 SET NAMES utf8mb4 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `e2e_address` +-- + +DROP TABLE IF EXISTS `e2e_address`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `e2e_address` ( + `id` char(36) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `e2e_authors` +-- + +DROP TABLE IF EXISTS `e2e_authors`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `e2e_authors` ( + `id` char(36) NOT NULL, + `created_at` datetime NOT NULL, + `updated_at` datetime NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `e2e_flow` +-- + +DROP TABLE IF EXISTS `e2e_flow`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `e2e_flow` ( + `id` char(36) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `e2e_token` +-- + +DROP TABLE IF EXISTS `e2e_token`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `e2e_token` ( + `id` char(36) NOT NULL, + `token` varchar(64) NOT NULL, + `e2e_flow_id` char(36) NOT NULL, + `e2e_address_id` char(36) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `e2e_token_uq_idx` (`token`), + KEY `e2e_flow_id` (`e2e_flow_id`), + KEY `e2e_address_id` (`e2e_address_id`), + KEY `e2e_token_idx` (`token`), + CONSTRAINT `e2e_token_ibfk_1` FOREIGN KEY (`e2e_flow_id`) REFERENCES `e2e_flow` (`id`) ON DELETE CASCADE, + CONSTRAINT `e2e_token_ibfk_2` FOREIGN KEY (`e2e_address_id`) REFERENCES `e2e_address` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `e2e_user_posts` +-- + +DROP TABLE IF EXISTS `e2e_user_posts`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `e2e_user_posts` ( + `id` char(36) NOT NULL, + `author_id` char(36) DEFAULT NULL, + `slug` varchar(32) NOT NULL, + `content` varchar(255) NOT NULL DEFAULT '', + `published` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `e2e_user_notes_slug_idx` (`slug`), + KEY `e2e_user_notes_user_id_idx` (`author_id`), + CONSTRAINT `e2e_user_posts_ibfk_1` FOREIGN KEY (`author_id`) REFERENCES `e2e_authors` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `schema_migration` +-- + +DROP TABLE IF EXISTS `schema_migration`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `schema_migration` ( + `version` varchar(14) NOT NULL, + UNIQUE KEY `schema_migration_version_idx` (`version`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2020-09-03 11:40:16 diff --git a/internal/e2e/fixtures/mysql/up/15.sql b/internal/e2e/fixtures/mysql/up/15.sql new file mode 100644 index 00000000..7b441e25 --- /dev/null +++ b/internal/e2e/fixtures/mysql/up/15.sql @@ -0,0 +1,125 @@ +-- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) +-- +-- Host: 127.0.0.1 Database: pop_test +-- ------------------------------------------------------ +-- Server version 5.7.31 + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!50503 SET NAMES utf8mb4 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `e2e_address` +-- + +DROP TABLE IF EXISTS `e2e_address`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `e2e_address` ( + `id` char(36) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `e2e_authors` +-- + +DROP TABLE IF EXISTS `e2e_authors`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `e2e_authors` ( + `id` char(36) NOT NULL, + `created_at` datetime NOT NULL, + `updated_at` datetime NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `e2e_flow` +-- + +DROP TABLE IF EXISTS `e2e_flow`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `e2e_flow` ( + `id` char(36) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `e2e_token` +-- + +DROP TABLE IF EXISTS `e2e_token`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `e2e_token` ( + `id` char(36) NOT NULL, + `token` varchar(64) NOT NULL, + `e2e_flow_id` char(36) DEFAULT NULL, + `e2e_address_id` char(36) NOT NULL, + `expires_at` datetime NOT NULL DEFAULT '2000-01-01 00:00:00', + `issued_at` datetime NOT NULL DEFAULT '2000-01-01 00:00:00', + PRIMARY KEY (`id`), + UNIQUE KEY `e2e_token_uq_idx` (`token`), + KEY `e2e_flow_id` (`e2e_flow_id`), + KEY `e2e_address_id` (`e2e_address_id`), + KEY `e2e_token_idx` (`token`), + CONSTRAINT `e2e_token_ibfk_1` FOREIGN KEY (`e2e_flow_id`) REFERENCES `e2e_flow` (`id`) ON DELETE CASCADE, + CONSTRAINT `e2e_token_ibfk_2` FOREIGN KEY (`e2e_address_id`) REFERENCES `e2e_address` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `e2e_user_posts` +-- + +DROP TABLE IF EXISTS `e2e_user_posts`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `e2e_user_posts` ( + `id` char(36) NOT NULL, + `author_id` char(36) DEFAULT NULL, + `slug` varchar(32) NOT NULL, + `content` varchar(255) NOT NULL DEFAULT '', + `published` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `e2e_user_notes_slug_idx` (`slug`), + KEY `e2e_user_notes_user_id_idx` (`author_id`), + CONSTRAINT `e2e_user_posts_ibfk_1` FOREIGN KEY (`author_id`) REFERENCES `e2e_authors` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `schema_migration` +-- + +DROP TABLE IF EXISTS `schema_migration`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `schema_migration` ( + `version` varchar(14) NOT NULL, + UNIQUE KEY `schema_migration_version_idx` (`version`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2020-09-03 11:40:16 diff --git a/internal/e2e/fixtures/mysql/up/2.sql b/internal/e2e/fixtures/mysql/up/2.sql index c8060fec..0d92cf59 100644 --- a/internal/e2e/fixtures/mysql/up/2.sql +++ b/internal/e2e/fixtures/mysql/up/2.sql @@ -1,4 +1,4 @@ --- MySQL dump 10.13 Distrib 5.7.29, for macos10.14 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ @@ -7,7 +7,7 @@ /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +/*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; @@ -21,7 +21,7 @@ DROP TABLE IF EXISTS `e2e_user_notes`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_notes` ( `id` char(36) NOT NULL, `notes` varchar(255) DEFAULT NULL, @@ -38,7 +38,7 @@ CREATE TABLE `e2e_user_notes` ( DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `username` varchar(255) DEFAULT NULL, @@ -54,7 +54,7 @@ CREATE TABLE `e2e_users` ( DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) @@ -70,4 +70,4 @@ CREATE TABLE `schema_migration` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-08-30 23:11:31 +-- Dump completed on 2020-09-03 11:40:11 diff --git a/internal/e2e/fixtures/mysql/up/3.sql b/internal/e2e/fixtures/mysql/up/3.sql index 9f92052a..e82698f0 100644 --- a/internal/e2e/fixtures/mysql/up/3.sql +++ b/internal/e2e/fixtures/mysql/up/3.sql @@ -1,4 +1,4 @@ --- MySQL dump 10.13 Distrib 5.7.29, for macos10.14 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ @@ -7,7 +7,7 @@ /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +/*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; @@ -21,7 +21,7 @@ DROP TABLE IF EXISTS `e2e_user_notes`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_notes` ( `id` char(36) NOT NULL, `notes` varchar(255) DEFAULT NULL, @@ -39,7 +39,7 @@ CREATE TABLE `e2e_user_notes` ( DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `username` varchar(255) DEFAULT NULL, @@ -55,7 +55,7 @@ CREATE TABLE `e2e_users` ( DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) @@ -71,4 +71,4 @@ CREATE TABLE `schema_migration` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-08-30 23:11:31 +-- Dump completed on 2020-09-03 11:40:12 diff --git a/internal/e2e/fixtures/mysql/up/4.sql b/internal/e2e/fixtures/mysql/up/4.sql index 4322a6a0..e82698f0 100644 --- a/internal/e2e/fixtures/mysql/up/4.sql +++ b/internal/e2e/fixtures/mysql/up/4.sql @@ -1,4 +1,4 @@ --- MySQL dump 10.13 Distrib 5.7.29, for macos10.14 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ @@ -7,7 +7,7 @@ /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +/*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; @@ -21,7 +21,7 @@ DROP TABLE IF EXISTS `e2e_user_notes`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_notes` ( `id` char(36) NOT NULL, `notes` varchar(255) DEFAULT NULL, @@ -39,7 +39,7 @@ CREATE TABLE `e2e_user_notes` ( DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `username` varchar(255) DEFAULT NULL, @@ -55,7 +55,7 @@ CREATE TABLE `e2e_users` ( DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) @@ -71,4 +71,4 @@ CREATE TABLE `schema_migration` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-08-30 23:11:32 +-- Dump completed on 2020-09-03 11:40:12 diff --git a/internal/e2e/fixtures/mysql/up/5.sql b/internal/e2e/fixtures/mysql/up/5.sql index 0fdcf7f9..d6c80c39 100644 --- a/internal/e2e/fixtures/mysql/up/5.sql +++ b/internal/e2e/fixtures/mysql/up/5.sql @@ -1,4 +1,4 @@ --- MySQL dump 10.13 Distrib 5.7.29, for macos10.14 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ @@ -7,7 +7,7 @@ /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +/*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; @@ -21,7 +21,7 @@ DROP TABLE IF EXISTS `e2e_user_notes`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_notes` ( `id` char(36) NOT NULL, `notes` varchar(255) DEFAULT NULL, @@ -40,7 +40,7 @@ CREATE TABLE `e2e_user_notes` ( DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `username` varchar(255) DEFAULT NULL, @@ -56,7 +56,7 @@ CREATE TABLE `e2e_users` ( DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) @@ -72,4 +72,4 @@ CREATE TABLE `schema_migration` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-08-30 23:11:32 +-- Dump completed on 2020-09-03 11:40:12 diff --git a/internal/e2e/fixtures/mysql/up/6.sql b/internal/e2e/fixtures/mysql/up/6.sql index 716302cb..b541bc2a 100644 --- a/internal/e2e/fixtures/mysql/up/6.sql +++ b/internal/e2e/fixtures/mysql/up/6.sql @@ -1,4 +1,4 @@ --- MySQL dump 10.13 Distrib 5.7.29, for macos10.14 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ @@ -7,7 +7,7 @@ /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +/*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; @@ -21,7 +21,7 @@ DROP TABLE IF EXISTS `e2e_user_posts`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_posts` ( `id` char(36) NOT NULL, `notes` varchar(255) DEFAULT NULL, @@ -40,7 +40,7 @@ CREATE TABLE `e2e_user_posts` ( DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `username` varchar(255) DEFAULT NULL, @@ -56,7 +56,7 @@ CREATE TABLE `e2e_users` ( DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) @@ -72,4 +72,4 @@ CREATE TABLE `schema_migration` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-08-30 23:11:33 +-- Dump completed on 2020-09-03 11:40:12 diff --git a/internal/e2e/fixtures/mysql/up/7.sql b/internal/e2e/fixtures/mysql/up/7.sql index 21244d0b..578e2541 100644 --- a/internal/e2e/fixtures/mysql/up/7.sql +++ b/internal/e2e/fixtures/mysql/up/7.sql @@ -1,4 +1,4 @@ --- MySQL dump 10.13 Distrib 5.7.29, for macos10.14 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ @@ -7,7 +7,7 @@ /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +/*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; @@ -21,7 +21,7 @@ DROP TABLE IF EXISTS `e2e_user_posts`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_posts` ( `id` char(36) NOT NULL, `user_id` char(36) NOT NULL, @@ -40,7 +40,7 @@ CREATE TABLE `e2e_user_posts` ( DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `username` varchar(255) DEFAULT NULL, @@ -56,7 +56,7 @@ CREATE TABLE `e2e_users` ( DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) @@ -72,4 +72,4 @@ CREATE TABLE `schema_migration` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-08-30 23:11:33 +-- Dump completed on 2020-09-03 11:40:13 diff --git a/internal/e2e/fixtures/mysql/up/8.sql b/internal/e2e/fixtures/mysql/up/8.sql index cd1806c8..47b40e4f 100644 --- a/internal/e2e/fixtures/mysql/up/8.sql +++ b/internal/e2e/fixtures/mysql/up/8.sql @@ -1,4 +1,4 @@ --- MySQL dump 10.13 Distrib 5.7.29, for macos10.14 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ @@ -7,7 +7,7 @@ /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +/*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; @@ -21,7 +21,7 @@ DROP TABLE IF EXISTS `e2e_user_posts`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_posts` ( `id` char(36) NOT NULL, `user_id` char(36) NOT NULL, @@ -40,7 +40,7 @@ CREATE TABLE `e2e_user_posts` ( DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `name` varchar(255) DEFAULT NULL, @@ -56,7 +56,7 @@ CREATE TABLE `e2e_users` ( DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) @@ -72,4 +72,4 @@ CREATE TABLE `schema_migration` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-08-30 23:11:33 +-- Dump completed on 2020-09-03 11:40:13 diff --git a/internal/e2e/fixtures/mysql/up/9.sql b/internal/e2e/fixtures/mysql/up/9.sql index 6fc6121e..dc17ceb0 100644 --- a/internal/e2e/fixtures/mysql/up/9.sql +++ b/internal/e2e/fixtures/mysql/up/9.sql @@ -1,4 +1,4 @@ --- MySQL dump 10.13 Distrib 5.7.29, for macos10.14 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ @@ -7,7 +7,7 @@ /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; +/*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; @@ -21,7 +21,7 @@ DROP TABLE IF EXISTS `e2e_user_posts`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_posts` ( `id` char(36) NOT NULL, `user_id` char(36) NOT NULL, @@ -40,7 +40,7 @@ CREATE TABLE `e2e_user_posts` ( DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `created_at` datetime NOT NULL, @@ -55,7 +55,7 @@ CREATE TABLE `e2e_users` ( DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; +/*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) @@ -71,4 +71,4 @@ CREATE TABLE `schema_migration` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-08-30 23:11:34 +-- Dump completed on 2020-09-03 11:40:13 diff --git a/internal/e2e/fixtures/postgres/down/14.sql b/internal/e2e/fixtures/postgres/down/14.sql new file mode 100644 index 00000000..186c9ddf --- /dev/null +++ b/internal/e2e/fixtures/postgres/down/14.sql @@ -0,0 +1,108 @@ +-- +-- PostgreSQL database dump +-- + +-- Dumped from database version 9.6.19 +-- Dumped by pg_dump version 12.4 + +SET statement_timeout = 0; +SET lock_timeout = 0; +SET idle_in_transaction_session_timeout = 0; +SET client_encoding = 'UTF8'; +SET standard_conforming_strings = on; +SELECT pg_catalog.set_config('search_path', '', false); +SET check_function_bodies = false; +SET xmloption = content; +SET client_min_messages = warning; +SET row_security = off; + +SET default_tablespace = ''; + +-- +-- Name: e2e_authors; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.e2e_authors ( + id uuid NOT NULL, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL +); + + +ALTER TABLE public.e2e_authors OWNER TO postgres; + +-- +-- Name: e2e_user_posts; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.e2e_user_posts ( + id uuid NOT NULL, + author_id uuid, + slug character varying(32) NOT NULL, + content character varying(255) DEFAULT ''::character varying NOT NULL, + published boolean DEFAULT false NOT NULL +); + + +ALTER TABLE public.e2e_user_posts OWNER TO postgres; + +-- +-- Name: schema_migration; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.schema_migration ( + version character varying(14) NOT NULL +); + + +ALTER TABLE public.schema_migration OWNER TO postgres; + +-- +-- Name: e2e_user_posts e2e_user_notes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.e2e_user_posts + ADD CONSTRAINT e2e_user_notes_pkey PRIMARY KEY (id); + + +-- +-- Name: e2e_authors e2e_users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.e2e_authors + ADD CONSTRAINT e2e_users_pkey PRIMARY KEY (id); + + +-- +-- Name: e2e_user_notes_slug_idx; Type: INDEX; Schema: public; Owner: postgres +-- + +CREATE UNIQUE INDEX e2e_user_notes_slug_idx ON public.e2e_user_posts USING btree (slug); + + +-- +-- Name: e2e_user_notes_user_id_idx; Type: INDEX; Schema: public; Owner: postgres +-- + +CREATE INDEX e2e_user_notes_user_id_idx ON public.e2e_user_posts USING btree (author_id); + + +-- +-- Name: schema_migration_version_idx; Type: INDEX; Schema: public; Owner: postgres +-- + +CREATE UNIQUE INDEX schema_migration_version_idx ON public.schema_migration USING btree (version); + + +-- +-- Name: e2e_user_posts e2e_user_notes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.e2e_user_posts + ADD CONSTRAINT e2e_user_notes_user_id_fkey FOREIGN KEY (author_id) REFERENCES public.e2e_authors(id) ON DELETE CASCADE; + + +-- +-- PostgreSQL database dump complete +-- + diff --git a/internal/e2e/fixtures/postgres/down/15.sql b/internal/e2e/fixtures/postgres/down/15.sql new file mode 100644 index 00000000..3184199f --- /dev/null +++ b/internal/e2e/fixtures/postgres/down/15.sql @@ -0,0 +1,200 @@ +-- +-- PostgreSQL database dump +-- + +-- Dumped from database version 9.6.19 +-- Dumped by pg_dump version 12.4 + +SET statement_timeout = 0; +SET lock_timeout = 0; +SET idle_in_transaction_session_timeout = 0; +SET client_encoding = 'UTF8'; +SET standard_conforming_strings = on; +SELECT pg_catalog.set_config('search_path', '', false); +SET check_function_bodies = false; +SET xmloption = content; +SET client_min_messages = warning; +SET row_security = off; + +SET default_tablespace = ''; + +-- +-- Name: e2e_address; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.e2e_address ( + id uuid NOT NULL +); + + +ALTER TABLE public.e2e_address OWNER TO postgres; + +-- +-- Name: e2e_authors; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.e2e_authors ( + id uuid NOT NULL, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL +); + + +ALTER TABLE public.e2e_authors OWNER TO postgres; + +-- +-- Name: e2e_flow; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.e2e_flow ( + id uuid NOT NULL +); + + +ALTER TABLE public.e2e_flow OWNER TO postgres; + +-- +-- Name: e2e_token; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.e2e_token ( + id uuid NOT NULL, + token character varying(64) NOT NULL, + e2e_flow_id uuid NOT NULL, + e2e_address_id uuid NOT NULL, + expires_at timestamp without time zone DEFAULT '2000-01-01 00:00:00'::timestamp without time zone NOT NULL, + issued_at timestamp without time zone DEFAULT '2000-01-01 00:00:00'::timestamp without time zone NOT NULL +); + + +ALTER TABLE public.e2e_token OWNER TO postgres; + +-- +-- Name: e2e_user_posts; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.e2e_user_posts ( + id uuid NOT NULL, + author_id uuid, + slug character varying(32) NOT NULL, + content character varying(255) DEFAULT ''::character varying NOT NULL, + published boolean DEFAULT false NOT NULL +); + + +ALTER TABLE public.e2e_user_posts OWNER TO postgres; + +-- +-- Name: schema_migration; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.schema_migration ( + version character varying(14) NOT NULL +); + + +ALTER TABLE public.schema_migration OWNER TO postgres; + +-- +-- Name: e2e_address e2e_address_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.e2e_address + ADD CONSTRAINT e2e_address_pkey PRIMARY KEY (id); + + +-- +-- Name: e2e_flow e2e_flow_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.e2e_flow + ADD CONSTRAINT e2e_flow_pkey PRIMARY KEY (id); + + +-- +-- Name: e2e_token e2e_token_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.e2e_token + ADD CONSTRAINT e2e_token_pkey PRIMARY KEY (id); + + +-- +-- Name: e2e_user_posts e2e_user_notes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.e2e_user_posts + ADD CONSTRAINT e2e_user_notes_pkey PRIMARY KEY (id); + + +-- +-- Name: e2e_authors e2e_users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.e2e_authors + ADD CONSTRAINT e2e_users_pkey PRIMARY KEY (id); + + +-- +-- Name: e2e_token_idx; Type: INDEX; Schema: public; Owner: postgres +-- + +CREATE INDEX e2e_token_idx ON public.e2e_token USING btree (token); + + +-- +-- Name: e2e_token_uq_idx; Type: INDEX; Schema: public; Owner: postgres +-- + +CREATE UNIQUE INDEX e2e_token_uq_idx ON public.e2e_token USING btree (token); + + +-- +-- Name: e2e_user_notes_slug_idx; Type: INDEX; Schema: public; Owner: postgres +-- + +CREATE UNIQUE INDEX e2e_user_notes_slug_idx ON public.e2e_user_posts USING btree (slug); + + +-- +-- Name: e2e_user_notes_user_id_idx; Type: INDEX; Schema: public; Owner: postgres +-- + +CREATE INDEX e2e_user_notes_user_id_idx ON public.e2e_user_posts USING btree (author_id); + + +-- +-- Name: schema_migration_version_idx; Type: INDEX; Schema: public; Owner: postgres +-- + +CREATE UNIQUE INDEX schema_migration_version_idx ON public.schema_migration USING btree (version); + + +-- +-- Name: e2e_token e2e_token_e2e_address_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.e2e_token + ADD CONSTRAINT e2e_token_e2e_address_id_fkey FOREIGN KEY (e2e_address_id) REFERENCES public.e2e_address(id) ON DELETE CASCADE; + + +-- +-- Name: e2e_token e2e_token_e2e_flow_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.e2e_token + ADD CONSTRAINT e2e_token_e2e_flow_id_fkey FOREIGN KEY (e2e_flow_id) REFERENCES public.e2e_flow(id) ON DELETE CASCADE; + + +-- +-- Name: e2e_user_posts e2e_user_notes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.e2e_user_posts + ADD CONSTRAINT e2e_user_notes_user_id_fkey FOREIGN KEY (author_id) REFERENCES public.e2e_authors(id) ON DELETE CASCADE; + + +-- +-- PostgreSQL database dump complete +-- + diff --git a/internal/e2e/fixtures/postgres/up/14.sql b/internal/e2e/fixtures/postgres/up/14.sql new file mode 100644 index 00000000..5dcc6ea3 --- /dev/null +++ b/internal/e2e/fixtures/postgres/up/14.sql @@ -0,0 +1,198 @@ +-- +-- PostgreSQL database dump +-- + +-- Dumped from database version 9.6.19 +-- Dumped by pg_dump version 12.4 + +SET statement_timeout = 0; +SET lock_timeout = 0; +SET idle_in_transaction_session_timeout = 0; +SET client_encoding = 'UTF8'; +SET standard_conforming_strings = on; +SELECT pg_catalog.set_config('search_path', '', false); +SET check_function_bodies = false; +SET xmloption = content; +SET client_min_messages = warning; +SET row_security = off; + +SET default_tablespace = ''; + +-- +-- Name: e2e_address; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.e2e_address ( + id uuid NOT NULL +); + + +ALTER TABLE public.e2e_address OWNER TO postgres; + +-- +-- Name: e2e_authors; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.e2e_authors ( + id uuid NOT NULL, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL +); + + +ALTER TABLE public.e2e_authors OWNER TO postgres; + +-- +-- Name: e2e_flow; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.e2e_flow ( + id uuid NOT NULL +); + + +ALTER TABLE public.e2e_flow OWNER TO postgres; + +-- +-- Name: e2e_token; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.e2e_token ( + id uuid NOT NULL, + token character varying(64) NOT NULL, + e2e_flow_id uuid NOT NULL, + e2e_address_id uuid NOT NULL +); + + +ALTER TABLE public.e2e_token OWNER TO postgres; + +-- +-- Name: e2e_user_posts; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.e2e_user_posts ( + id uuid NOT NULL, + author_id uuid, + slug character varying(32) NOT NULL, + content character varying(255) DEFAULT ''::character varying NOT NULL, + published boolean DEFAULT false NOT NULL +); + + +ALTER TABLE public.e2e_user_posts OWNER TO postgres; + +-- +-- Name: schema_migration; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.schema_migration ( + version character varying(14) NOT NULL +); + + +ALTER TABLE public.schema_migration OWNER TO postgres; + +-- +-- Name: e2e_address e2e_address_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.e2e_address + ADD CONSTRAINT e2e_address_pkey PRIMARY KEY (id); + + +-- +-- Name: e2e_flow e2e_flow_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.e2e_flow + ADD CONSTRAINT e2e_flow_pkey PRIMARY KEY (id); + + +-- +-- Name: e2e_token e2e_token_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.e2e_token + ADD CONSTRAINT e2e_token_pkey PRIMARY KEY (id); + + +-- +-- Name: e2e_user_posts e2e_user_notes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.e2e_user_posts + ADD CONSTRAINT e2e_user_notes_pkey PRIMARY KEY (id); + + +-- +-- Name: e2e_authors e2e_users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.e2e_authors + ADD CONSTRAINT e2e_users_pkey PRIMARY KEY (id); + + +-- +-- Name: e2e_token_idx; Type: INDEX; Schema: public; Owner: postgres +-- + +CREATE INDEX e2e_token_idx ON public.e2e_token USING btree (token); + + +-- +-- Name: e2e_token_uq_idx; Type: INDEX; Schema: public; Owner: postgres +-- + +CREATE UNIQUE INDEX e2e_token_uq_idx ON public.e2e_token USING btree (token); + + +-- +-- Name: e2e_user_notes_slug_idx; Type: INDEX; Schema: public; Owner: postgres +-- + +CREATE UNIQUE INDEX e2e_user_notes_slug_idx ON public.e2e_user_posts USING btree (slug); + + +-- +-- Name: e2e_user_notes_user_id_idx; Type: INDEX; Schema: public; Owner: postgres +-- + +CREATE INDEX e2e_user_notes_user_id_idx ON public.e2e_user_posts USING btree (author_id); + + +-- +-- Name: schema_migration_version_idx; Type: INDEX; Schema: public; Owner: postgres +-- + +CREATE UNIQUE INDEX schema_migration_version_idx ON public.schema_migration USING btree (version); + + +-- +-- Name: e2e_token e2e_token_e2e_address_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.e2e_token + ADD CONSTRAINT e2e_token_e2e_address_id_fkey FOREIGN KEY (e2e_address_id) REFERENCES public.e2e_address(id) ON DELETE CASCADE; + + +-- +-- Name: e2e_token e2e_token_e2e_flow_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.e2e_token + ADD CONSTRAINT e2e_token_e2e_flow_id_fkey FOREIGN KEY (e2e_flow_id) REFERENCES public.e2e_flow(id) ON DELETE CASCADE; + + +-- +-- Name: e2e_user_posts e2e_user_notes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.e2e_user_posts + ADD CONSTRAINT e2e_user_notes_user_id_fkey FOREIGN KEY (author_id) REFERENCES public.e2e_authors(id) ON DELETE CASCADE; + + +-- +-- PostgreSQL database dump complete +-- + diff --git a/internal/e2e/fixtures/postgres/up/15.sql b/internal/e2e/fixtures/postgres/up/15.sql new file mode 100644 index 00000000..42000937 --- /dev/null +++ b/internal/e2e/fixtures/postgres/up/15.sql @@ -0,0 +1,200 @@ +-- +-- PostgreSQL database dump +-- + +-- Dumped from database version 9.6.19 +-- Dumped by pg_dump version 12.4 + +SET statement_timeout = 0; +SET lock_timeout = 0; +SET idle_in_transaction_session_timeout = 0; +SET client_encoding = 'UTF8'; +SET standard_conforming_strings = on; +SELECT pg_catalog.set_config('search_path', '', false); +SET check_function_bodies = false; +SET xmloption = content; +SET client_min_messages = warning; +SET row_security = off; + +SET default_tablespace = ''; + +-- +-- Name: e2e_address; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.e2e_address ( + id uuid NOT NULL +); + + +ALTER TABLE public.e2e_address OWNER TO postgres; + +-- +-- Name: e2e_authors; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.e2e_authors ( + id uuid NOT NULL, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL +); + + +ALTER TABLE public.e2e_authors OWNER TO postgres; + +-- +-- Name: e2e_flow; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.e2e_flow ( + id uuid NOT NULL +); + + +ALTER TABLE public.e2e_flow OWNER TO postgres; + +-- +-- Name: e2e_token; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.e2e_token ( + id uuid NOT NULL, + token character varying(64) NOT NULL, + e2e_flow_id uuid, + e2e_address_id uuid NOT NULL, + expires_at timestamp without time zone DEFAULT '2000-01-01 00:00:00'::timestamp without time zone NOT NULL, + issued_at timestamp without time zone DEFAULT '2000-01-01 00:00:00'::timestamp without time zone NOT NULL +); + + +ALTER TABLE public.e2e_token OWNER TO postgres; + +-- +-- Name: e2e_user_posts; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.e2e_user_posts ( + id uuid NOT NULL, + author_id uuid, + slug character varying(32) NOT NULL, + content character varying(255) DEFAULT ''::character varying NOT NULL, + published boolean DEFAULT false NOT NULL +); + + +ALTER TABLE public.e2e_user_posts OWNER TO postgres; + +-- +-- Name: schema_migration; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.schema_migration ( + version character varying(14) NOT NULL +); + + +ALTER TABLE public.schema_migration OWNER TO postgres; + +-- +-- Name: e2e_address e2e_address_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.e2e_address + ADD CONSTRAINT e2e_address_pkey PRIMARY KEY (id); + + +-- +-- Name: e2e_flow e2e_flow_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.e2e_flow + ADD CONSTRAINT e2e_flow_pkey PRIMARY KEY (id); + + +-- +-- Name: e2e_token e2e_token_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.e2e_token + ADD CONSTRAINT e2e_token_pkey PRIMARY KEY (id); + + +-- +-- Name: e2e_user_posts e2e_user_notes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.e2e_user_posts + ADD CONSTRAINT e2e_user_notes_pkey PRIMARY KEY (id); + + +-- +-- Name: e2e_authors e2e_users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.e2e_authors + ADD CONSTRAINT e2e_users_pkey PRIMARY KEY (id); + + +-- +-- Name: e2e_token_idx; Type: INDEX; Schema: public; Owner: postgres +-- + +CREATE INDEX e2e_token_idx ON public.e2e_token USING btree (token); + + +-- +-- Name: e2e_token_uq_idx; Type: INDEX; Schema: public; Owner: postgres +-- + +CREATE UNIQUE INDEX e2e_token_uq_idx ON public.e2e_token USING btree (token); + + +-- +-- Name: e2e_user_notes_slug_idx; Type: INDEX; Schema: public; Owner: postgres +-- + +CREATE UNIQUE INDEX e2e_user_notes_slug_idx ON public.e2e_user_posts USING btree (slug); + + +-- +-- Name: e2e_user_notes_user_id_idx; Type: INDEX; Schema: public; Owner: postgres +-- + +CREATE INDEX e2e_user_notes_user_id_idx ON public.e2e_user_posts USING btree (author_id); + + +-- +-- Name: schema_migration_version_idx; Type: INDEX; Schema: public; Owner: postgres +-- + +CREATE UNIQUE INDEX schema_migration_version_idx ON public.schema_migration USING btree (version); + + +-- +-- Name: e2e_token e2e_token_e2e_address_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.e2e_token + ADD CONSTRAINT e2e_token_e2e_address_id_fkey FOREIGN KEY (e2e_address_id) REFERENCES public.e2e_address(id) ON DELETE CASCADE; + + +-- +-- Name: e2e_token e2e_token_e2e_flow_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.e2e_token + ADD CONSTRAINT e2e_token_e2e_flow_id_fkey FOREIGN KEY (e2e_flow_id) REFERENCES public.e2e_flow(id) ON DELETE CASCADE; + + +-- +-- Name: e2e_user_posts e2e_user_notes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.e2e_user_posts + ADD CONSTRAINT e2e_user_notes_user_id_fkey FOREIGN KEY (author_id) REFERENCES public.e2e_authors(id) ON DELETE CASCADE; + + +-- +-- PostgreSQL database dump complete +-- + diff --git a/internal/e2e/fixtures/sqlite3/down/14.sql b/internal/e2e/fixtures/sqlite3/down/14.sql new file mode 100644 index 00000000..c94c5c25 --- /dev/null +++ b/internal/e2e/fixtures/sqlite3/down/14.sql @@ -0,0 +1,19 @@ +CREATE TABLE IF NOT EXISTS "schema_migration" ( +"version" TEXT NOT NULL +); +CREATE UNIQUE INDEX "schema_migration_version_idx" ON "schema_migration" (version); +CREATE TABLE IF NOT EXISTS "e2e_authors" ( +"id" TEXT PRIMARY KEY, +"created_at" DATETIME NOT NULL, +"updated_at" DATETIME NOT NULL +); +CREATE TABLE IF NOT EXISTS "e2e_user_posts" ( +"id" TEXT PRIMARY KEY, +"author_id" char(36), +"slug" TEXT NOT NULL, +"content" TEXT NOT NULL DEFAULT '', +"published" bool NOT NULL DEFAULT FALSE, +FOREIGN KEY (author_id) REFERENCES e2e_authors (id) ON UPDATE NO ACTION ON DELETE CASCADE +); +CREATE UNIQUE INDEX "e2e_user_notes_slug_idx" ON "e2e_user_posts" (slug); +CREATE INDEX "e2e_user_notes_user_id_idx" ON "e2e_user_posts" (author_id); diff --git a/internal/e2e/fixtures/sqlite3/down/15.sql b/internal/e2e/fixtures/sqlite3/down/15.sql new file mode 100644 index 00000000..1712ae99 --- /dev/null +++ b/internal/e2e/fixtures/sqlite3/down/15.sql @@ -0,0 +1,37 @@ +CREATE TABLE IF NOT EXISTS "schema_migration" ( +"version" TEXT NOT NULL +); +CREATE UNIQUE INDEX "schema_migration_version_idx" ON "schema_migration" (version); +CREATE TABLE IF NOT EXISTS "e2e_authors" ( +"id" TEXT PRIMARY KEY, +"created_at" DATETIME NOT NULL, +"updated_at" DATETIME NOT NULL +); +CREATE TABLE IF NOT EXISTS "e2e_user_posts" ( +"id" TEXT PRIMARY KEY, +"author_id" char(36), +"slug" TEXT NOT NULL, +"content" TEXT NOT NULL DEFAULT '', +"published" bool NOT NULL DEFAULT FALSE, +FOREIGN KEY (author_id) REFERENCES e2e_authors (id) ON UPDATE NO ACTION ON DELETE CASCADE +); +CREATE UNIQUE INDEX "e2e_user_notes_slug_idx" ON "e2e_user_posts" (slug); +CREATE INDEX "e2e_user_notes_user_id_idx" ON "e2e_user_posts" (author_id); +CREATE TABLE IF NOT EXISTS "e2e_flow" ( +"id" TEXT PRIMARY KEY +); +CREATE TABLE IF NOT EXISTS "e2e_address" ( +"id" TEXT PRIMARY KEY +); +CREATE TABLE IF NOT EXISTS "e2e_token" ( +"id" TEXT PRIMARY KEY, +"token" TEXT NOT NULL, +"e2e_flow_id" char(36) NOT NULL, +"e2e_address_id" char(36) NOT NULL, +"expires_at" DATETIME NOT NULL DEFAULT '2000-01-01 00:00:00', +"issued_at" DATETIME NOT NULL DEFAULT '2000-01-01 00:00:00', +FOREIGN KEY (e2e_flow_id) REFERENCES e2e_flow (id) ON UPDATE NO ACTION ON DELETE CASCADE, +FOREIGN KEY (e2e_address_id) REFERENCES e2e_address (id) ON UPDATE NO ACTION ON DELETE CASCADE +); +CREATE UNIQUE INDEX "e2e_token_uq_idx" ON "e2e_token" (token); +CREATE INDEX "e2e_token_idx" ON "e2e_token" (token); diff --git a/internal/e2e/fixtures/sqlite3/up/14.sql b/internal/e2e/fixtures/sqlite3/up/14.sql new file mode 100644 index 00000000..951facfd --- /dev/null +++ b/internal/e2e/fixtures/sqlite3/up/14.sql @@ -0,0 +1,35 @@ +CREATE TABLE IF NOT EXISTS "schema_migration" ( +"version" TEXT NOT NULL +); +CREATE UNIQUE INDEX "schema_migration_version_idx" ON "schema_migration" (version); +CREATE TABLE IF NOT EXISTS "e2e_authors" ( +"id" TEXT PRIMARY KEY, +"created_at" DATETIME NOT NULL, +"updated_at" DATETIME NOT NULL +); +CREATE TABLE IF NOT EXISTS "e2e_user_posts" ( +"id" TEXT PRIMARY KEY, +"author_id" char(36), +"slug" TEXT NOT NULL, +"content" TEXT NOT NULL DEFAULT '', +"published" bool NOT NULL DEFAULT FALSE, +FOREIGN KEY (author_id) REFERENCES e2e_authors (id) ON UPDATE NO ACTION ON DELETE CASCADE +); +CREATE UNIQUE INDEX "e2e_user_notes_slug_idx" ON "e2e_user_posts" (slug); +CREATE INDEX "e2e_user_notes_user_id_idx" ON "e2e_user_posts" (author_id); +CREATE TABLE IF NOT EXISTS "e2e_flow" ( +"id" TEXT PRIMARY KEY +); +CREATE TABLE IF NOT EXISTS "e2e_address" ( +"id" TEXT PRIMARY KEY +); +CREATE TABLE IF NOT EXISTS "e2e_token" ( +"id" TEXT PRIMARY KEY, +"token" TEXT NOT NULL, +"e2e_flow_id" char(36) NOT NULL, +"e2e_address_id" char(36) NOT NULL, +FOREIGN KEY (e2e_flow_id) REFERENCES e2e_flow (id) ON DELETE cascade, +FOREIGN KEY (e2e_address_id) REFERENCES e2e_address (id) ON DELETE cascade +); +CREATE UNIQUE INDEX "e2e_token_uq_idx" ON "e2e_token" (token); +CREATE INDEX "e2e_token_idx" ON "e2e_token" (token); diff --git a/internal/e2e/fixtures/sqlite3/up/15.sql b/internal/e2e/fixtures/sqlite3/up/15.sql new file mode 100644 index 00000000..583429a0 --- /dev/null +++ b/internal/e2e/fixtures/sqlite3/up/15.sql @@ -0,0 +1,37 @@ +CREATE TABLE IF NOT EXISTS "schema_migration" ( +"version" TEXT NOT NULL +); +CREATE UNIQUE INDEX "schema_migration_version_idx" ON "schema_migration" (version); +CREATE TABLE IF NOT EXISTS "e2e_authors" ( +"id" TEXT PRIMARY KEY, +"created_at" DATETIME NOT NULL, +"updated_at" DATETIME NOT NULL +); +CREATE TABLE IF NOT EXISTS "e2e_user_posts" ( +"id" TEXT PRIMARY KEY, +"author_id" char(36), +"slug" TEXT NOT NULL, +"content" TEXT NOT NULL DEFAULT '', +"published" bool NOT NULL DEFAULT FALSE, +FOREIGN KEY (author_id) REFERENCES e2e_authors (id) ON UPDATE NO ACTION ON DELETE CASCADE +); +CREATE UNIQUE INDEX "e2e_user_notes_slug_idx" ON "e2e_user_posts" (slug); +CREATE INDEX "e2e_user_notes_user_id_idx" ON "e2e_user_posts" (author_id); +CREATE TABLE IF NOT EXISTS "e2e_flow" ( +"id" TEXT PRIMARY KEY +); +CREATE TABLE IF NOT EXISTS "e2e_address" ( +"id" TEXT PRIMARY KEY +); +CREATE TABLE IF NOT EXISTS "e2e_token" ( +"id" TEXT PRIMARY KEY, +"token" TEXT NOT NULL, +"e2e_flow_id" char(36), +"e2e_address_id" char(36) NOT NULL, +"expires_at" DATETIME NOT NULL DEFAULT '2000-01-01 00:00:00', +"issued_at" DATETIME NOT NULL DEFAULT '2000-01-01 00:00:00', +FOREIGN KEY (e2e_address_id) REFERENCES e2e_address (id) ON UPDATE NO ACTION ON DELETE CASCADE, +FOREIGN KEY (e2e_flow_id) REFERENCES e2e_flow (id) ON UPDATE NO ACTION ON DELETE CASCADE +); +CREATE INDEX "e2e_token_idx" ON "e2e_token" (token); +CREATE UNIQUE INDEX "e2e_token_uq_idx" ON "e2e_token" (token); diff --git a/internal/e2e/migrations/20191100000015_auto_fk.down.fizz b/internal/e2e/migrations/20191100000015_auto_fk.down.fizz new file mode 100644 index 00000000..61f17c7a --- /dev/null +++ b/internal/e2e/migrations/20191100000015_auto_fk.down.fizz @@ -0,0 +1,3 @@ +drop_table("e2e_token") +drop_table("e2e_flow") +drop_table("e2e_address") diff --git a/internal/e2e/migrations/20191100000015_auto_fk.up.fizz b/internal/e2e/migrations/20191100000015_auto_fk.up.fizz new file mode 100644 index 00000000..a30767a0 --- /dev/null +++ b/internal/e2e/migrations/20191100000015_auto_fk.up.fizz @@ -0,0 +1,28 @@ +create_table("e2e_flow") { + t.DisableTimestamps() + + t.Column("id", "uuid", {"primary": true}) +} + +create_table("e2e_address") { + t.DisableTimestamps() + + t.Column("id", "uuid", {"primary": true}) +} + +create_table("e2e_token") { + t.DisableTimestamps() + + t.Column("id", "uuid", {"primary": true}) + + t.Column("token", "string", {"size": 64}) + + t.Column("e2e_flow_id", "uuid") + t.ForeignKey("e2e_flow_id", {"e2e_flow": ["id"]}, {"on_delete": "cascade"}) + + t.Column("e2e_address_id", "uuid") + t.ForeignKey("e2e_address_id", {"e2e_address": ["id"]}, {"on_delete": "cascade"}) +} + +add_index("e2e_token", ["token"], { "unique": true, "name": "e2e_token_uq_idx" }) +add_index("e2e_token", ["token"], { "name": "e2e_token_idx" }) diff --git a/internal/e2e/migrations/20191100000016_rename_auto_fk.down.fizz b/internal/e2e/migrations/20191100000016_rename_auto_fk.down.fizz new file mode 100644 index 00000000..4cede7c0 --- /dev/null +++ b/internal/e2e/migrations/20191100000016_rename_auto_fk.down.fizz @@ -0,0 +1 @@ +change_column("e2e_token", "e2e_flow_id", "uuid") diff --git a/internal/e2e/migrations/20191100000016_rename_auto_fk.up.fizz b/internal/e2e/migrations/20191100000016_rename_auto_fk.up.fizz new file mode 100644 index 00000000..5d14d37f --- /dev/null +++ b/internal/e2e/migrations/20191100000016_rename_auto_fk.up.fizz @@ -0,0 +1,3 @@ +add_column("e2e_token", "expires_at", "timestamp", { "default": "2000-01-01 00:00:00" }) +add_column("e2e_token", "issued_at", "timestamp", { "default": "2000-01-01 00:00:00" }) +change_column("e2e_token", "e2e_flow_id", "uuid", {"null": true}) diff --git a/internal/e2e/migrator_test.go b/internal/e2e/migrator_test.go index dade8927..bba480c3 100644 --- a/internal/e2e/migrator_test.go +++ b/internal/e2e/migrator_test.go @@ -146,6 +146,10 @@ func runForeignKeyChecks(c *pop.Connection, r *require.Assertions) { r.Contains(strings.ToLower(err.Error()), "foreign") r.NoError(c.RawQuery("INSERT INTO e2e_user_posts (id, author_id, slug, published) VALUES (?,?,?, false)", "03c6c800-54c6-40cd-89f1-7dff731f9b54", "78dba9f7-81af-415e-aa2b-dd20a39f64cb", "slug-1").Exec()) + + r.NoError(c.RawQuery("INSERT INTO e2e_address (id) VALUES (?)", "d8b79b1d-e510-4763-92b3-828244b54893").Exec()) + r.NoError(c.RawQuery("INSERT INTO e2e_flow (id) VALUES (?)", "96a8b5f8-6b1b-4936-9b88-397cf0886235").Exec()) + r.NoError(c.RawQuery("INSERT INTO e2e_token (id, token, e2e_flow_id, e2e_address_id) VALUES (?, ?, ?, ?)", "5ba7f9c5-c469-439a-a07c-859f7b7b3448", "1539b471f990", "96a8b5f8-6b1b-4936-9b88-397cf0886235", "d8b79b1d-e510-4763-92b3-828244b54893").Exec()) } func runUniqueKeyChecks(c *pop.Connection, r *require.Assertions) { diff --git a/translators/cockroach_meta.go b/translators/cockroach_meta.go index faf30820..ac26cbe8 100644 --- a/translators/cockroach_meta.go +++ b/translators/cockroach_meta.go @@ -139,9 +139,7 @@ SELECT FROM information_schema.statistics WHERE - table_name = '%s' -AND - index_name NOT LIKE '%%_auto_index_%%'; + table_name = '%s'; `, t.Name) res, err := db.Query(prag) if err != nil {