From f90d9b2b3e0653d94f4975e73b7ef17f59e7a6d4 Mon Sep 17 00:00:00 2001 From: aeneasr <3372410+aeneasr@users.noreply.github.com> Date: Fri, 3 Dec 2021 11:47:32 +0100 Subject: [PATCH] Support adding foreign key constraints in `add_column` This patch reverts some of the logic previously introduced for SQLite. It adds new functionality to `add_column`, allowing to define a foreign key when creating a column. This works for all databases and adds support for introducing foreign keys to SQLite schemas after a table has been created (not possible previously). This patch also upgrade PostgreSQL and CockroachDB and MySQL to supported versions as the versions used previously were no longer maintained. --- .github/workflows/tests.yml | 8 +- README.md | 17 +- docker-compose.yml | 6 +- go.mod | 7 +- go.sum | 86 +------ internal/e2e/fixtures/cockroach/down/0.sql | 8 +- internal/e2e/fixtures/cockroach/down/1.sql | 17 +- internal/e2e/fixtures/cockroach/down/10.sql | 41 ++-- internal/e2e/fixtures/cockroach/down/11.sql | 41 ++-- internal/e2e/fixtures/cockroach/down/12.sql | 41 ++-- internal/e2e/fixtures/cockroach/down/13.sql | 41 ++-- internal/e2e/fixtures/cockroach/down/14.sql | 41 ++-- internal/e2e/fixtures/cockroach/down/15.sql | 106 +++++---- internal/e2e/fixtures/cockroach/down/16.sql | 82 +++++++ internal/e2e/fixtures/cockroach/down/2.sql | 34 +-- internal/e2e/fixtures/cockroach/down/3.sql | 32 +-- internal/e2e/fixtures/cockroach/down/4.sql | 34 +-- internal/e2e/fixtures/cockroach/down/5.sql | 34 +-- internal/e2e/fixtures/cockroach/down/6.sql | 34 +-- internal/e2e/fixtures/cockroach/down/7.sql | 34 +-- internal/e2e/fixtures/cockroach/down/8.sql | 34 +-- internal/e2e/fixtures/cockroach/down/9.sql | 34 +-- internal/e2e/fixtures/cockroach/up/0.sql | 21 +- internal/e2e/fixtures/cockroach/up/1.sql | 41 ++-- internal/e2e/fixtures/cockroach/up/10.sql | 41 ++-- internal/e2e/fixtures/cockroach/up/11.sql | 41 ++-- internal/e2e/fixtures/cockroach/up/12.sql | 41 ++-- internal/e2e/fixtures/cockroach/up/13.sql | 41 ++-- internal/e2e/fixtures/cockroach/up/14.sql | 100 +++++---- internal/e2e/fixtures/cockroach/up/15.sql | 104 +++++---- internal/e2e/fixtures/cockroach/up/16.sql | 89 ++++++++ internal/e2e/fixtures/cockroach/up/2.sql | 41 ++-- internal/e2e/fixtures/cockroach/up/3.sql | 41 ++-- internal/e2e/fixtures/cockroach/up/4.sql | 41 ++-- internal/e2e/fixtures/cockroach/up/5.sql | 41 ++-- internal/e2e/fixtures/cockroach/up/6.sql | 41 ++-- internal/e2e/fixtures/cockroach/up/7.sql | 41 ++-- internal/e2e/fixtures/cockroach/up/8.sql | 41 ++-- internal/e2e/fixtures/cockroach/up/9.sql | 41 ++-- 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 | 12 +- internal/e2e/fixtures/mysql/down/15.sql | 18 +- internal/e2e/fixtures/mysql/down/16.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 | 18 +- internal/e2e/fixtures/mysql/up/15.sql | 18 +- internal/e2e/fixtures/mysql/up/16.sql | 128 +++++++++++ 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/0.sql | 4 +- internal/e2e/fixtures/postgres/down/1.sql | 4 +- internal/e2e/fixtures/postgres/down/10.sql | 4 +- internal/e2e/fixtures/postgres/down/11.sql | 4 +- internal/e2e/fixtures/postgres/down/12.sql | 4 +- internal/e2e/fixtures/postgres/down/13.sql | 4 +- internal/e2e/fixtures/postgres/down/14.sql | 4 +- internal/e2e/fixtures/postgres/down/15.sql | 4 +- internal/e2e/fixtures/postgres/down/16.sql | 200 +++++++++++++++++ internal/e2e/fixtures/postgres/down/2.sql | 4 +- internal/e2e/fixtures/postgres/down/3.sql | 4 +- internal/e2e/fixtures/postgres/down/4.sql | 4 +- internal/e2e/fixtures/postgres/down/5.sql | 4 +- internal/e2e/fixtures/postgres/down/6.sql | 4 +- internal/e2e/fixtures/postgres/down/7.sql | 4 +- internal/e2e/fixtures/postgres/down/8.sql | 4 +- internal/e2e/fixtures/postgres/down/9.sql | 4 +- internal/e2e/fixtures/postgres/up/0.sql | 4 +- internal/e2e/fixtures/postgres/up/1.sql | 4 +- internal/e2e/fixtures/postgres/up/10.sql | 4 +- internal/e2e/fixtures/postgres/up/11.sql | 4 +- internal/e2e/fixtures/postgres/up/12.sql | 4 +- internal/e2e/fixtures/postgres/up/13.sql | 4 +- internal/e2e/fixtures/postgres/up/14.sql | 4 +- internal/e2e/fixtures/postgres/up/15.sql | 4 +- internal/e2e/fixtures/postgres/up/16.sql | 209 ++++++++++++++++++ internal/e2e/fixtures/postgres/up/2.sql | 4 +- internal/e2e/fixtures/postgres/up/3.sql | 4 +- internal/e2e/fixtures/postgres/up/4.sql | 4 +- internal/e2e/fixtures/postgres/up/5.sql | 4 +- internal/e2e/fixtures/postgres/up/6.sql | 4 +- internal/e2e/fixtures/postgres/up/7.sql | 4 +- internal/e2e/fixtures/postgres/up/8.sql | 4 +- internal/e2e/fixtures/postgres/up/9.sql | 4 +- internal/e2e/fixtures/sqlite3/down/10.sql | 2 +- internal/e2e/fixtures/sqlite3/down/11.sql | 2 +- internal/e2e/fixtures/sqlite3/down/12.sql | 2 +- internal/e2e/fixtures/sqlite3/down/13.sql | 2 +- internal/e2e/fixtures/sqlite3/down/14.sql | 2 +- internal/e2e/fixtures/sqlite3/down/15.sql | 2 +- internal/e2e/fixtures/sqlite3/down/16.sql | 37 ++++ internal/e2e/fixtures/sqlite3/down/8.sql | 2 +- internal/e2e/fixtures/sqlite3/down/9.sql | 2 +- internal/e2e/fixtures/sqlite3/up/10.sql | 2 +- internal/e2e/fixtures/sqlite3/up/11.sql | 2 +- internal/e2e/fixtures/sqlite3/up/12.sql | 2 +- internal/e2e/fixtures/sqlite3/up/13.sql | 2 +- internal/e2e/fixtures/sqlite3/up/14.sql | 2 +- internal/e2e/fixtures/sqlite3/up/15.sql | 2 +- internal/e2e/fixtures/sqlite3/up/16.sql | 39 ++++ internal/e2e/fixtures/sqlite3/up/2.sql | 2 +- internal/e2e/fixtures/sqlite3/up/3.sql | 2 +- internal/e2e/fixtures/sqlite3/up/4.sql | 2 +- internal/e2e/fixtures/sqlite3/up/7.sql | 5 +- internal/e2e/fixtures/sqlite3/up/8.sql | 5 +- internal/e2e/fixtures/sqlite3/up/9.sql | 15 +- .../20191100000017_add_fk_column.down.fizz | 5 + .../20191100000017_add_fk_column.up.fizz | 8 + internal/e2e/sqlite3_test.go | 9 +- schema.go | 14 ++ test.sh | 6 +- translators/cockroach.go | 56 ++++- translators/cockroach_test.go | 17 ++ translators/mssqlserver.go | 1 + translators/mssqlserver_test.go | 8 +- translators/mysql.go | 47 +++- translators/mysql_test.go | 37 +++- translators/postgres.go | 43 +++- translators/postgres_test.go | 17 ++ translators/schema.go | 18 +- translators/sqlite.go | 94 ++++++-- translators/sqlite_test.go | 45 +++- 145 files changed, 2325 insertions(+), 1078 deletions(-) create mode 100644 internal/e2e/fixtures/cockroach/down/16.sql create mode 100644 internal/e2e/fixtures/cockroach/up/16.sql create mode 100644 internal/e2e/fixtures/mysql/down/16.sql create mode 100644 internal/e2e/fixtures/mysql/up/16.sql create mode 100644 internal/e2e/fixtures/postgres/down/16.sql create mode 100644 internal/e2e/fixtures/postgres/up/16.sql create mode 100644 internal/e2e/fixtures/sqlite3/down/16.sql create mode 100644 internal/e2e/fixtures/sqlite3/up/16.sql create mode 100644 internal/e2e/migrations/20191100000017_add_fk_column.down.fizz create mode 100644 internal/e2e/migrations/20191100000017_add_fk_column.up.fizz create mode 100644 schema.go diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a237a7ba..061b2131 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -70,7 +70,7 @@ jobs: services: postgres: - image: postgres:14 + image: postgres:10.19 env: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres @@ -132,9 +132,9 @@ jobs: run: | mkdir -p crdb pushd crdb - wget -qO- https://binaries.cockroachdb.com/cockroach-v2.1.0.linux-amd64.tgz | tar -xz - sudo cp -i cockroach-v2.1.0.linux-amd64/cockroach /usr/local/bin/ - cockroach start --insecure --background + wget -qO- https://binaries.cockroachdb.com/cockroach-v21.2.2.linux-amd64.tgz | tar -xz + sudo cp -i cockroach-v21.2.2.linux-amd64/cockroach /usr/local/bin/ + cockroach start-single-node --insecure --background popd - name: Install and run soda diff --git a/README.md b/README.md index 8898f66a..95ccb223 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ For example for PostgreSQL you could pass `jsonb`and it will be supported, howev #### Supported Options: * `size` - The size of the column. For example if you wanted a `varchar(50)` in Postgres you would do: `t.Column("column_name", "string", {"size": 50})` -* `null` - By default columns are not allowed to be `null`. +* `null` - If set to `true` will mark the field as `NULL`able. Otherwise, the column is `NOT NULL` (e.g. if not set or `false`). * `default` - The default value you want for this column. By default this is `null`. * `default_raw` - The default value defined as a database function. * `after` - (MySQL Only) Add a column after another column in the table. `example: {"after":"created_at"}` @@ -95,6 +95,20 @@ add_column("table_name", "column_name", "string", {}) See [above](#column-info) for more details on column types and options. +You can also add a column with a foreign key constraint. This is particularly +useful for SQLite which does not support foreign keys constraint updates without +recreating the table: + +``` +add_column("table_name", "column_name", "string", {"null": true, "size": 50, "foreign_key": { + "table": "target_table_name", + "columns": ["target_column", "target_column_2", "target_column_3"], + "name": "the_index_name", + "on_delete": "RESTRICT", + "on_update": "NO ACTION" +}}) +``` + ## Alter a column ``` javascript @@ -165,7 +179,6 @@ add_foreign_key("table_name", "field", {"ref_table_name": ["ref_column"]}, { "on_delete": "action", "on_update": "action", }) - ``` #### Supported Options diff --git a/docker-compose.yml b/docker-compose.yml index a1f362df..30df80c0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,7 +13,7 @@ services: ports: - "3306:3306" postgres: - image: postgres:9.6 + image: postgres:10.19 environment: - POSTGRES_DB=pop_test - POSTGRES_PASSWORD=postgres @@ -22,10 +22,10 @@ services: volumes: - ./sqldumps:/docker-entrypoint-initdb.d cockroach: - image: cockroachdb/cockroach:v19.2.10 + image: cockroachdb/cockroach:v21.1.2 ports: - "26257:26257" - "8080:8080" volumes: - "./cockroach-data/roach1:/cockroach/cockroach-data" - command: start --insecure + command: start-single-node --insecure diff --git a/go.mod b/go.mod index 99f5fd6d..a0ec4790 100644 --- a/go.mod +++ b/go.mod @@ -4,16 +4,13 @@ go 1.16 replace github.com/mattn/go-sqlite3 => github.com/mattn/go-sqlite3 v1.14.9 +replace github.com/gobuffalo/pop/v6 => github.com/gobuffalo/pop/v6 v6.0.0-20211203104334-793d5869e4b6 + require ( github.com/Masterminds/semver/v3 v3.1.1 - github.com/cockroachdb/cockroach-go v2.0.1+incompatible // indirect github.com/go-sql-driver/mysql v1.6.0 - github.com/gobuffalo/genny v0.6.0 // indirect - github.com/gobuffalo/packr/v2 v2.8.3 // indirect github.com/gobuffalo/plush/v4 v4.1.9 - github.com/gobuffalo/pop v4.13.1+incompatible // indirect github.com/gobuffalo/pop/v6 v6.0.0 - github.com/gobuffalo/validate v2.0.4+incompatible // indirect github.com/jackc/pgx/v4 v4.14.0 github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 github.com/stretchr/testify v1.7.0 diff --git a/go.sum b/go.sum index b270a49e..c61a6ffe 100644 --- a/go.sum +++ b/go.sum @@ -44,7 +44,6 @@ github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030I github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk= @@ -61,16 +60,10 @@ github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnht github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= -github.com/cockroachdb/cockroach-go v2.0.1+incompatible h1:rkk9T7FViadPOz28xQ68o18jBSpyShru0mayVumxqYA= -github.com/cockroachdb/cockroach-go v2.0.1+incompatible/go.mod h1:XGLbWH/ujMcbPbhZq52Nv6UrCghb1yGn//133kEsvDk= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -88,7 +81,6 @@ github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= @@ -100,59 +92,32 @@ github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LB github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/gobuffalo/attrs v1.0.1 h1:Z84c0uuGKg58mhcLQODAqE/Sbxg8GgwjvV9nekZPs5c= github.com/gobuffalo/attrs v1.0.1/go.mod h1:qGdnq2RukKtBl4ASJit0OFckc5XGSyTFk98SvRpMFrQ= -github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= -github.com/gobuffalo/envy v1.7.1/go.mod h1:FurDp9+EDPE4aIUS3ZLyD+7/9fpx7YRt/ukY6jIHf0w= -github.com/gobuffalo/envy v1.8.1/go.mod h1:FurDp9+EDPE4aIUS3ZLyD+7/9fpx7YRt/ukY6jIHf0w= github.com/gobuffalo/envy v1.10.1 h1:ppDLoXv2feQ5nus4IcgtyMdHQkKng2lhJCIm33cblM0= github.com/gobuffalo/envy v1.10.1/go.mod h1:AWx4++KnNOW3JOeEvhSaq+mvgAvnMYOY1XSIin4Mago= github.com/gobuffalo/fizz v1.10.0/go.mod h1:J2XGPO0AfJ1zKw7+2BA+6FEGAkyEsdCOLvN93WCT2WI= github.com/gobuffalo/flect v0.2.0/go.mod h1:W3K3X9ksuZfir8f/LrfVtWmCDQFfayuylOJ7sz/Fj80= github.com/gobuffalo/flect v0.2.4 h1:BSYA8+T60cdyq+vynaSUjqSVI9mDEg9ZfQUXKmfjo4I= github.com/gobuffalo/flect v0.2.4/go.mod h1:1ZyCLIbg0YD7sDkzvFdPoOydPtD8y9JQnrOROolUcM8= -github.com/gobuffalo/genny v0.6.0 h1:d7c6d66ZrTHHty01hDX1/TcTWvAJQxRZl885KWX5kHY= -github.com/gobuffalo/genny v0.6.0/go.mod h1:Vigx9VDiNscYpa/LwrURqGXLSIbzTfapt9+K6gF1kTA= github.com/gobuffalo/genny/v2 v2.0.8/go.mod h1:R45scCyQfff2HysNJHNanjrpvPw4Qu+rM1MOMDBB5oU= github.com/gobuffalo/github_flavored_markdown v1.1.0/go.mod h1:TSpTKWcRTI0+v7W3x8dkSKMLJSUpuVitlptCkpeY8ic= github.com/gobuffalo/github_flavored_markdown v1.1.1 h1:kUf8ginyBOTRXcKSTPsPAqlA25vQ80+xAspLIYaxmTU= github.com/gobuffalo/github_flavored_markdown v1.1.1/go.mod h1:yU32Pen+eorS58oxh/bNZx76zUOCJwmvyV5FBrvzOKQ= -github.com/gobuffalo/helpers v0.5.0/go.mod h1:stpgxJ2C7T99NLyAxGUnYMM2zAtBk5NKQR0SIbd05j4= github.com/gobuffalo/helpers v0.6.0/go.mod h1:pncVrer7x/KRvnL5aJABLAuT/RhKRR9klL6dkUOhyv8= github.com/gobuffalo/helpers v0.6.4 h1:N9is8xgaotJzGIge1GoLYiWRpKZPqnS9RSty72OhIn8= github.com/gobuffalo/helpers v0.6.4/go.mod h1:m2aOKsTl3KB0RUwwpxf3tykaaitujQ3irivqrlNAcJ0= -github.com/gobuffalo/here v0.6.0 h1:hYrd0a6gDmWxBM4TnrGw8mQg24iSVoIkHEk7FodQcBI= -github.com/gobuffalo/here v0.6.0/go.mod h1:wAG085dHOYqUpf+Ap+WOdrPTp5IYcDAs/x7PLa8Y5fM= -github.com/gobuffalo/logger v1.0.1/go.mod h1:2zbswyIUa45I+c+FLXuWl9zSWEiVuthsk8ze5s8JvPs= -github.com/gobuffalo/logger v1.0.3/go.mod h1:SoeejUwldiS7ZsyCBphOGURmWdwUFXs0J7TCjEhjKxM= -github.com/gobuffalo/logger v1.0.6 h1:nnZNpxYo0zx+Aj9RfMPBm+x9zAU2OayFh/xrAWi34HU= github.com/gobuffalo/logger v1.0.6/go.mod h1:J31TBEHR1QLV2683OXTAItYIg8pv2JMHnF/quuAbMjs= github.com/gobuffalo/nulls v0.4.1 h1:k7QVCJfMplv9VRQQLb4N1d8tXUdGvcdMNfp4BfMnG2M= github.com/gobuffalo/nulls v0.4.1/go.mod h1:pp8e1hWTRJZFpMl4fj/CVbSMlaxjeGKkFq4RuBZi3w8= -github.com/gobuffalo/packd v0.3.0/go.mod h1:zC7QkmNkYVGKPw4tHpBQ+ml7W/3tIebgeo1b36chA3Q= -github.com/gobuffalo/packd v1.0.1 h1:U2wXfRr4E9DH8IdsDLlRFwTZTK7hLfq9qT/QHXGVe/0= github.com/gobuffalo/packd v1.0.1/go.mod h1:PP2POP3p3RXGz7Jh6eYEf93S7vA2za6xM7QT85L4+VY= -github.com/gobuffalo/packr/v2 v2.7.1/go.mod h1:qYEvAazPaVxy7Y7KR0W8qYEE+RymX74kETFqjFoFlOc= -github.com/gobuffalo/packr/v2 v2.8.3 h1:xE1yzvnO56cUC0sTpKR3DIbxZgB54AftTFMhB2XEWlY= -github.com/gobuffalo/packr/v2 v2.8.3/go.mod h1:0SahksCVcx4IMnigTjiFuyldmTrdTctXsOdiU5KwbKc= -github.com/gobuffalo/plush v3.8.3+incompatible h1:kzvUTnFPhwyfPEsx7U7LI05/IIslZVGnAlMA1heWub8= -github.com/gobuffalo/plush v3.8.3+incompatible/go.mod h1:rQ4zdtUUyZNqULlc6bqd5scsPfLKfT0+TGMChgduDvI= github.com/gobuffalo/plush/v4 v4.0.0/go.mod h1:ErFS3UxKqEb8fpFJT7lYErfN/Nw6vHGiDMTjxpk5bQ0= github.com/gobuffalo/plush/v4 v4.1.9 h1:u9rQBuYCeHC0ppKxsZljk5vb1oT8PQa5EMNTAN2337s= github.com/gobuffalo/plush/v4 v4.1.9/go.mod h1:9OOII9uAM5pZnhWu1OkQnboXJjaWMQ7kcTl3zNcxvTM= -github.com/gobuffalo/pop v4.13.1+incompatible h1:AhbqPxNOBN/DBb2DBaiBqzOXIBQXxEYzngHHJ+ytP4g= -github.com/gobuffalo/pop v4.13.1+incompatible/go.mod h1:DwBz3SD5SsHpTZiTubcsFWcVDpJWGsxjVjMPnkiThWg= -github.com/gobuffalo/pop/v6 v6.0.0 h1:LvHl9wrMoY0zF+SWjUJoDG1oRpYKfMxLzuBT7SCctZU= -github.com/gobuffalo/pop/v6 v6.0.0/go.mod h1:5rd3OnViLhjteR8+0i/mT9Q4CzkTzCoR7tm/9mmAic4= -github.com/gobuffalo/tags v2.1.7+incompatible h1:GUxxh34f9SI4U0Pj3ZqvopO9SlzuqSf+g4ZGSPSszt4= -github.com/gobuffalo/tags v2.1.7+incompatible/go.mod h1:9XmhOkyaB7UzvuY4UoZO4s67q8/xRMVJEaakauVQYeY= +github.com/gobuffalo/pop/v6 v6.0.0-20211203104334-793d5869e4b6 h1:JxoNaqV4sON19RHPH72ouzgu0zYbz/XivnRCeDG6xeU= +github.com/gobuffalo/pop/v6 v6.0.0-20211203104334-793d5869e4b6/go.mod h1:5rd3OnViLhjteR8+0i/mT9Q4CzkTzCoR7tm/9mmAic4= github.com/gobuffalo/tags/v3 v3.0.2/go.mod h1:ZQeN6TCTiwAFnS0dNcbDtSgZDwNKSpqajvVtt6mlYpA= github.com/gobuffalo/tags/v3 v3.1.2 h1:68sHcwFFDstXyfbk5ovbGcQFDsupgVLs+lw1XZinHJw= github.com/gobuffalo/tags/v3 v3.1.2/go.mod h1:o3ldUfKv50jxWAC8eZHXMm8dnKW3YvyZUMr0xqUcZTI= -github.com/gobuffalo/uuid v2.0.5+incompatible/go.mod h1:ErhIzkRhm0FtRuiE/PeORqcw4cVi1RtSpnwYrxuvkfE= -github.com/gobuffalo/validate v2.0.3+incompatible/go.mod h1:N+EtDe0J8252BgfzQUChBgfd6L93m9weay53EWFVsMM= -github.com/gobuffalo/validate v2.0.4+incompatible h1:ZTxozrIw8qQ5nfhShmc4izjYPTsPhfdXTdhXOd5OS9o= -github.com/gobuffalo/validate v2.0.4+incompatible/go.mod h1:N+EtDe0J8252BgfzQUChBgfd6L93m9weay53EWFVsMM= github.com/gobuffalo/validate/v3 v3.0.0/go.mod h1:HFpjq+AIiA2RHoQnQVTFKF/ZpUPXwyw82LgyDPxQ9r0= github.com/gobuffalo/validate/v3 v3.3.1 h1:5YLQL22YARUsYS5ZGsPU6TrD0Utiu53N1JJ5qi+foYk= github.com/gobuffalo/validate/v3 v3.3.1/go.mod h1:Ehu8ieNJQuUM4peDDr/0VapzdGA7RgTc3wbe51vHfS0= @@ -247,10 +212,8 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jackc/chunkreader v1.0.0 h1:4s39bBR8ByfqH+DKm8rQA3E1LHZWB9XWcrz8fqaZbe0= github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= @@ -306,15 +269,12 @@ github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dv github.com/jackc/puddle v1.2.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jmoiron/sqlx v1.3.4 h1:wv+0IJZfL5z0uZoUjlpKgHkgaFSYD+r9CfrXjEXsO7w= github.com/jmoiron/sqlx v1.3.4/go.mod h1:2BljVx/86SuTyjE+aPYlHCTNvZrnJXghYGpNiXLBMCQ= -github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/joho/godotenv v1.4.0 h1:3l4+N6zfMWnkbPEXKng2o2/MR5mSwTrBih4ZEkkz1lg= github.com/joho/godotenv v1.4.0/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/karrick/godirwalk v1.16.1 h1:DynhcF+bztK8gooS0+NDJFrdNZjJ3gzVzC545UNA9iw= -github.com/karrick/godirwalk v1.16.1/go.mod h1:j4mkqPuvaLI8mp1DroR3P6ad7cyYd4c1qeJ3RV7ULlk= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= @@ -337,13 +297,8 @@ github.com/lib/pq v1.10.4 h1:SO9z7FRPzA03QhHKJrH5BXA6HU1rS4V2nIVrrNC1iYk= github.com/lib/pq v1.10.4/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/luna-duclos/instrumentedsql v1.1.3 h1:t7mvC0z1jUt5A0UQ6I/0H31ryymuQRnJcWCiqV3lSAA= github.com/luna-duclos/instrumentedsql v1.1.3/go.mod h1:9J1njvFds+zN7y85EDhN9XNQLANWwZt2ULeIC8yMNYs= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= -github.com/markbates/errx v1.1.0 h1:QDFeR+UP95dO12JgW+tgi2UVfo0V8YBHiUIOaeBPiEI= -github.com/markbates/errx v1.1.0/go.mod h1:PLa46Oex9KNbVDZhKel8v1OT7hD5JZ2eI7AHhA0wswc= -github.com/markbates/oncer v1.0.0 h1:E83IaVAHygyndzPimgUYJjbshhDTALZyXxvk9FOlQRY= github.com/markbates/oncer v1.0.0/go.mod h1:Z59JA581E9GP6w96jai+TGqafHPW+cPfRxz2aSZ0mcI= -github.com/markbates/safe v1.0.1 h1:yjZkbvRM6IzKj9tlu/zMJLS0n/V351OZWRnF3QfaUxI= github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= @@ -364,7 +319,6 @@ github.com/microcosm-cc/bluemonday v1.0.16/go.mod h1:Z0r70sCuXHig8YpBzCc5eGHAap2 github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= @@ -374,11 +328,7 @@ github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RR github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -390,21 +340,16 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.3.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.4.0/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/serenize/snaker v0.0.0-20171204205717-a683aaf2d516/go.mod h1:Yow6lPLSAXx2ifx470yD/nUe22Dv5vBvxK/UK9UUTVs= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= @@ -414,7 +359,6 @@ github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFR github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= @@ -422,19 +366,11 @@ github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d h1:yKm7XZV6j9 github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE= github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e h1:qpG93cPwA5f7s/ZPBJnGOYQNK/vKsaDaseuKT5Asee8= github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.2.1 h1:+KmjbUw1hriSNMF55oPrkZcb27aECyrj8V2ytv7kWDw= github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -447,8 +383,6 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -481,15 +415,12 @@ go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191122220453-ac88ee75c92c/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= @@ -529,11 +460,9 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -602,9 +531,7 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -613,7 +540,6 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190515120540-06a5c4944438/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -657,7 +583,6 @@ golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e h1:WUoyKPm6nCo1BnNUvPGnFG3T5 golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -688,7 +613,6 @@ golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191004055002-72853e10c5a3/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -699,7 +623,6 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191224055732-dd894d0a8a40/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -729,14 +652,12 @@ golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.7 h1:6j8CgantCy3yc8JGBqkDLMKWqZ0RDU2g1HVgacojGWQ= golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= @@ -845,14 +766,11 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= diff --git a/internal/e2e/fixtures/cockroach/down/0.sql b/internal/e2e/fixtures/cockroach/down/0.sql index 4e370dec..cc9c77a9 100644 --- a/internal/e2e/fixtures/cockroach/down/0.sql +++ b/internal/e2e/fixtures/cockroach/down/0.sql @@ -1,5 +1,11 @@ -CREATE TABLE schema_migration ( +-- # 1 column +-- # row 1 +-- ## 269 +CREATE TABLE public.schema_migration ( version VARCHAR(14) NOT NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), UNIQUE INDEX schema_migration_version_idx (version ASC), FAMILY "primary" (version, rowid) ); +-- # 1 row diff --git a/internal/e2e/fixtures/cockroach/down/1.sql b/internal/e2e/fixtures/cockroach/down/1.sql index 6d7a4713..cc9c77a9 100644 --- a/internal/e2e/fixtures/cockroach/down/1.sql +++ b/internal/e2e/fixtures/cockroach/down/1.sql @@ -1,14 +1,11 @@ -CREATE TABLE e2e_users ( - id UUID NOT NULL, - created_at TIMESTAMP NOT NULL, - updated_at TIMESTAMP NOT NULL, - username VARCHAR(255) NULL, - CONSTRAINT "primary" PRIMARY KEY (id ASC), - FAMILY "primary" (id, created_at, updated_at, username) -); - -CREATE TABLE schema_migration ( +-- # 1 column +-- # row 1 +-- ## 269 +CREATE TABLE public.schema_migration ( version VARCHAR(14) NOT NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), UNIQUE INDEX schema_migration_version_idx (version ASC), FAMILY "primary" (version, rowid) ); +-- # 1 row diff --git a/internal/e2e/fixtures/cockroach/down/10.sql b/internal/e2e/fixtures/cockroach/down/10.sql index ab6d1891..e7c4546e 100644 --- a/internal/e2e/fixtures/cockroach/down/10.sql +++ b/internal/e2e/fixtures/cockroach/down/10.sql @@ -1,30 +1,41 @@ -CREATE TABLE e2e_users ( +-- # 1 column +-- # row 1 +-- ## 269 +CREATE TABLE public.schema_migration ( + version VARCHAR(14) NOT NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + UNIQUE INDEX schema_migration_version_idx (version ASC), + FAMILY "primary" (version, rowid) +); +-- # row 2 +-- ## 208 +CREATE TABLE public.e2e_users ( 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 ( +-- # row 3 +-- ## 352 +CREATE TABLE public.e2e_user_posts ( id UUID NOT NULL, content VARCHAR(255) NOT NULL DEFAULT '':::STRING, 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) ); - -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 (user_id) REFERENCES e2e_users(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; +-- # row 4 +-- ## 152 +ALTER TABLE public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_e2e_users_id_fk FOREIGN KEY (user_id) REFERENCES public.e2e_users(id) ON DELETE CASCADE; +-- # row 5 +-- ## 115 +-- Validate foreign key constraints. These can fail if there was unvalidated data during the SHOW CREATE ALL TABLES +-- # row 6 +-- ## 85 +ALTER TABLE public.e2e_user_posts VALIDATE CONSTRAINT e2e_user_notes_e2e_users_id_fk; +-- # 6 rows diff --git a/internal/e2e/fixtures/cockroach/down/11.sql b/internal/e2e/fixtures/cockroach/down/11.sql index 7028d77c..434281ad 100644 --- a/internal/e2e/fixtures/cockroach/down/11.sql +++ b/internal/e2e/fixtures/cockroach/down/11.sql @@ -1,30 +1,41 @@ -CREATE TABLE e2e_users ( +-- # 1 column +-- # row 1 +-- ## 269 +CREATE TABLE public.schema_migration ( + version VARCHAR(14) NOT NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + UNIQUE INDEX schema_migration_version_idx (version ASC), + FAMILY "primary" (version, rowid) +); +-- # row 2 +-- ## 208 +CREATE TABLE public.e2e_users ( 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 ( +-- # row 3 +-- ## 352 +CREATE TABLE public.e2e_user_posts ( id UUID NOT NULL, content VARCHAR(255) NOT NULL DEFAULT '':::STRING, slug VARCHAR(32) NOT NULL, 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) ); - -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 (user_id) REFERENCES e2e_users(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; +-- # row 4 +-- ## 152 +ALTER TABLE public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_e2e_users_id_fk FOREIGN KEY (user_id) REFERENCES public.e2e_users(id) ON DELETE CASCADE; +-- # row 5 +-- ## 115 +-- Validate foreign key constraints. These can fail if there was unvalidated data during the SHOW CREATE ALL TABLES +-- # row 6 +-- ## 85 +ALTER TABLE public.e2e_user_posts VALIDATE CONSTRAINT e2e_user_notes_e2e_users_id_fk; +-- # 6 rows diff --git a/internal/e2e/fixtures/cockroach/down/12.sql b/internal/e2e/fixtures/cockroach/down/12.sql index f0663c77..16d66ece 100644 --- a/internal/e2e/fixtures/cockroach/down/12.sql +++ b/internal/e2e/fixtures/cockroach/down/12.sql @@ -1,30 +1,41 @@ -CREATE TABLE e2e_authors ( +-- # 1 column +-- # row 1 +-- ## 269 +CREATE TABLE public.schema_migration ( + version VARCHAR(14) NOT NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + UNIQUE INDEX schema_migration_version_idx (version ASC), + FAMILY "primary" (version, rowid) +); +-- # row 2 +-- ## 210 +CREATE TABLE public.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 ( +-- # row 3 +-- ## 352 +CREATE TABLE public.e2e_user_posts ( id UUID NOT NULL, content VARCHAR(255) NOT NULL DEFAULT '':::STRING, slug VARCHAR(32) NOT NULL, 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) ); - -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 (user_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; +-- # row 4 +-- ## 154 +ALTER TABLE public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_e2e_users_id_fk FOREIGN KEY (user_id) REFERENCES public.e2e_authors(id) ON DELETE CASCADE; +-- # row 5 +-- ## 115 +-- Validate foreign key constraints. These can fail if there was unvalidated data during the SHOW CREATE ALL TABLES +-- # row 6 +-- ## 85 +ALTER TABLE public.e2e_user_posts VALIDATE CONSTRAINT e2e_user_notes_e2e_users_id_fk; +-- # 6 rows diff --git a/internal/e2e/fixtures/cockroach/down/13.sql b/internal/e2e/fixtures/cockroach/down/13.sql index fb9dbdd9..2c5bdc0b 100644 --- a/internal/e2e/fixtures/cockroach/down/13.sql +++ b/internal/e2e/fixtures/cockroach/down/13.sql @@ -1,30 +1,41 @@ -CREATE TABLE e2e_authors ( +-- # 1 column +-- # row 1 +-- ## 269 +CREATE TABLE public.schema_migration ( + version VARCHAR(14) NOT NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + UNIQUE INDEX schema_migration_version_idx (version ASC), + FAMILY "primary" (version, rowid) +); +-- # row 2 +-- ## 210 +CREATE TABLE public.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 ( +-- # row 3 +-- ## 358 +CREATE TABLE public.e2e_user_posts ( id UUID NOT NULL, content VARCHAR(255) NOT NULL DEFAULT '':::STRING, slug VARCHAR(32) NOT NULL, 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) ); - -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; +-- # row 4 +-- ## 156 +ALTER TABLE public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_e2e_users_id_fk FOREIGN KEY (author_id) REFERENCES public.e2e_authors(id) ON DELETE CASCADE; +-- # row 5 +-- ## 115 +-- Validate foreign key constraints. These can fail if there was unvalidated data during the SHOW CREATE ALL TABLES +-- # row 6 +-- ## 85 +ALTER TABLE public.e2e_user_posts VALIDATE CONSTRAINT e2e_user_notes_e2e_users_id_fk; +-- # 6 rows diff --git a/internal/e2e/fixtures/cockroach/down/14.sql b/internal/e2e/fixtures/cockroach/down/14.sql index 3b25bca5..e55f8a38 100644 --- a/internal/e2e/fixtures/cockroach/down/14.sql +++ b/internal/e2e/fixtures/cockroach/down/14.sql @@ -1,12 +1,25 @@ -CREATE TABLE e2e_authors ( +-- # 1 column +-- # row 1 +-- ## 269 +CREATE TABLE public.schema_migration ( + version VARCHAR(14) NOT NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + UNIQUE INDEX schema_migration_version_idx (version ASC), + FAMILY "primary" (version, rowid) +); +-- # row 2 +-- ## 210 +CREATE TABLE public.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 ( +-- # row 3 +-- ## 405 +CREATE TABLE public.e2e_user_posts ( id UUID NOT NULL, content VARCHAR(255) NOT NULL DEFAULT '':::STRING, slug VARCHAR(32) NOT NULL, @@ -14,18 +27,16 @@ 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) ); - -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; +-- # row 4 +-- ## 156 +ALTER TABLE public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_e2e_users_id_fk FOREIGN KEY (author_id) REFERENCES public.e2e_authors(id) ON DELETE CASCADE; +-- # row 5 +-- ## 115 +-- Validate foreign key constraints. These can fail if there was unvalidated data during the SHOW CREATE ALL TABLES +-- # row 6 +-- ## 85 +ALTER TABLE public.e2e_user_posts VALIDATE CONSTRAINT e2e_user_notes_e2e_users_id_fk; +-- # 6 rows diff --git a/internal/e2e/fixtures/cockroach/down/15.sql b/internal/e2e/fixtures/cockroach/down/15.sql index b8c6d372..ad2d9073 100644 --- a/internal/e2e/fixtures/cockroach/down/15.sql +++ b/internal/e2e/fixtures/cockroach/down/15.sql @@ -1,62 +1,82 @@ -CREATE TABLE e2e_address ( - id UUID NOT NULL, - CONSTRAINT "primary" PRIMARY KEY (id ASC), - FAMILY "primary" (id) +-- # 1 column +-- # row 1 +-- ## 269 +CREATE TABLE public.schema_migration ( + version VARCHAR(14) NOT NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + UNIQUE INDEX schema_migration_version_idx (version ASC), + FAMILY "primary" (version, rowid) ); - -CREATE TABLE e2e_authors ( +-- # row 2 +-- ## 210 +CREATE TABLE public.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 ( +-- # row 3 +-- ## 405 +CREATE TABLE public.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_user_id_idx (author_id ASC), + FAMILY "primary" (id, content, slug, published, author_id) +); +-- # row 4 +-- ## 119 +CREATE TABLE public.e2e_flow ( + id UUID NOT NULL, + CONSTRAINT "primary" PRIMARY KEY (id ASC), + FAMILY "primary" (id) +); +-- # row 5 +-- ## 122 +CREATE TABLE public.e2e_address ( id UUID NOT NULL, CONSTRAINT "primary" PRIMARY KEY (id ASC), FAMILY "primary" (id) ); - -CREATE TABLE e2e_token ( +-- # row 6 +-- ## 492 +CREATE TABLE public.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, + issued_at TIMESTAMP NOT NULL DEFAULT '2000-01-01 00:00:00':::TIMESTAMP, + expires_at TIMESTAMP NOT NULL DEFAULT '2000-01-01 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) + FAMILY "primary" (id, token, e2e_address_id, issued_at, expires_at, e2e_flow_id) ); - -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; +-- # row 7 +-- ## 156 +ALTER TABLE public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_e2e_users_id_fk FOREIGN KEY (author_id) REFERENCES public.e2e_authors(id) ON DELETE CASCADE; +-- # row 8 +-- ## 153 +ALTER TABLE public.e2e_token ADD CONSTRAINT e2e_token_e2e_address_id_fk FOREIGN KEY (e2e_address_id) REFERENCES public.e2e_address(id) ON DELETE CASCADE; +-- # row 9 +-- ## 144 +ALTER TABLE public.e2e_token ADD CONSTRAINT e2e_token_e2e_flow_id_fk FOREIGN KEY (e2e_flow_id) REFERENCES public.e2e_flow(id) ON DELETE CASCADE; +-- # row 10 +-- ## 115 +-- Validate foreign key constraints. These can fail if there was unvalidated data during the SHOW CREATE ALL TABLES +-- # row 11 +-- ## 85 +ALTER TABLE public.e2e_user_posts VALIDATE CONSTRAINT e2e_user_notes_e2e_users_id_fk; +-- # row 12 +-- ## 77 +ALTER TABLE public.e2e_token VALIDATE CONSTRAINT e2e_token_e2e_address_id_fk; +-- # row 13 +-- ## 74 +ALTER TABLE public.e2e_token VALIDATE CONSTRAINT e2e_token_e2e_flow_id_fk; +-- # 13 rows diff --git a/internal/e2e/fixtures/cockroach/down/16.sql b/internal/e2e/fixtures/cockroach/down/16.sql new file mode 100644 index 00000000..3e9120aa --- /dev/null +++ b/internal/e2e/fixtures/cockroach/down/16.sql @@ -0,0 +1,82 @@ +-- # 1 column +-- # row 1 +-- ## 269 +CREATE TABLE public.schema_migration ( + version VARCHAR(14) NOT NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + UNIQUE INDEX schema_migration_version_idx (version ASC), + FAMILY "primary" (version, rowid) +); +-- # row 2 +-- ## 210 +CREATE TABLE public.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) +); +-- # row 3 +-- ## 405 +CREATE TABLE public.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_user_id_idx (author_id ASC), + FAMILY "primary" (id, content, slug, published, author_id) +); +-- # row 4 +-- ## 119 +CREATE TABLE public.e2e_flow ( + id UUID NOT NULL, + CONSTRAINT "primary" PRIMARY KEY (id ASC), + FAMILY "primary" (id) +); +-- # row 5 +-- ## 122 +CREATE TABLE public.e2e_address ( + id UUID NOT NULL, + CONSTRAINT "primary" PRIMARY KEY (id ASC), + FAMILY "primary" (id) +); +-- # row 6 +-- ## 488 +CREATE TABLE public.e2e_token ( + id UUID NOT NULL, + token VARCHAR(64) NOT NULL, + e2e_address_id UUID NOT NULL, + issued_at TIMESTAMP NOT NULL DEFAULT '2000-01-01 00:00:00':::TIMESTAMP, + e2e_flow_id UUID NULL, + expires_at TIMESTAMP NOT NULL DEFAULT '2000-01-01 00:00:00':::TIMESTAMP, + CONSTRAINT "primary" PRIMARY KEY (id ASC), + UNIQUE INDEX e2e_token_uq_idx (token ASC), + INDEX e2e_token_idx (token ASC), + FAMILY "primary" (id, token, e2e_address_id, issued_at, e2e_flow_id, expires_at) +); +-- # row 7 +-- ## 156 +ALTER TABLE public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_e2e_users_id_fk FOREIGN KEY (author_id) REFERENCES public.e2e_authors(id) ON DELETE CASCADE; +-- # row 8 +-- ## 153 +ALTER TABLE public.e2e_token ADD CONSTRAINT e2e_token_e2e_address_id_fk FOREIGN KEY (e2e_address_id) REFERENCES public.e2e_address(id) ON DELETE CASCADE; +-- # row 9 +-- ## 144 +ALTER TABLE public.e2e_token ADD CONSTRAINT e2e_token_e2e_flow_id_fk FOREIGN KEY (e2e_flow_id) REFERENCES public.e2e_flow(id) ON DELETE CASCADE; +-- # row 10 +-- ## 115 +-- Validate foreign key constraints. These can fail if there was unvalidated data during the SHOW CREATE ALL TABLES +-- # row 11 +-- ## 85 +ALTER TABLE public.e2e_user_posts VALIDATE CONSTRAINT e2e_user_notes_e2e_users_id_fk; +-- # row 12 +-- ## 77 +ALTER TABLE public.e2e_token VALIDATE CONSTRAINT e2e_token_e2e_address_id_fk; +-- # row 13 +-- ## 74 +ALTER TABLE public.e2e_token VALIDATE CONSTRAINT e2e_token_e2e_flow_id_fk; +-- # 13 rows diff --git a/internal/e2e/fixtures/cockroach/down/2.sql b/internal/e2e/fixtures/cockroach/down/2.sql index 25f52369..cc9c77a9 100644 --- a/internal/e2e/fixtures/cockroach/down/2.sql +++ b/internal/e2e/fixtures/cockroach/down/2.sql @@ -1,31 +1,11 @@ -CREATE TABLE e2e_users ( - id UUID NOT NULL, - created_at TIMESTAMP NOT NULL, - updated_at TIMESTAMP NOT NULL, - username VARCHAR(255) NULL, - CONSTRAINT "primary" PRIMARY KEY (id ASC), - FAMILY "primary" (id, created_at, updated_at, username) -); - -CREATE TABLE e2e_user_notes ( - id UUID NOT NULL, - user_id UUID NOT NULL, - 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) -); - -CREATE TABLE schema_migration ( +-- # 1 column +-- # row 1 +-- ## 269 +CREATE TABLE public.schema_migration ( version VARCHAR(14) NOT NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), UNIQUE INDEX schema_migration_version_idx (version ASC), FAMILY "primary" (version, rowid) ); - -ALTER TABLE e2e_user_notes ADD CONSTRAINT e2e_user_notes_e2e_users_id_fk FOREIGN KEY (user_id) REFERENCES e2e_users(id) ON DELETE CASCADE; - --- Validate foreign key constraints. These can fail if there was unvalidated data during the dump. -ALTER TABLE e2e_user_notes VALIDATE CONSTRAINT e2e_user_notes_e2e_users_id_fk; +-- # 1 row diff --git a/internal/e2e/fixtures/cockroach/down/3.sql b/internal/e2e/fixtures/cockroach/down/3.sql index 07a69de4..cc9c77a9 100644 --- a/internal/e2e/fixtures/cockroach/down/3.sql +++ b/internal/e2e/fixtures/cockroach/down/3.sql @@ -1,29 +1,11 @@ -CREATE TABLE e2e_users ( - id UUID NOT NULL, - created_at TIMESTAMP NOT NULL, - updated_at TIMESTAMP NOT NULL, - username VARCHAR(255) NULL, - CONSTRAINT "primary" PRIMARY KEY (id ASC), - FAMILY "primary" (id, created_at, updated_at, username) -); - -CREATE TABLE e2e_user_notes ( - id UUID NOT NULL, - 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) -); - -CREATE TABLE schema_migration ( +-- # 1 column +-- # row 1 +-- ## 269 +CREATE TABLE public.schema_migration ( version VARCHAR(14) NOT NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), UNIQUE INDEX schema_migration_version_idx (version ASC), FAMILY "primary" (version, rowid) ); - -ALTER TABLE e2e_user_notes ADD CONSTRAINT e2e_user_notes_e2e_users_id_fk FOREIGN KEY (user_id) REFERENCES e2e_users(id) ON DELETE CASCADE; - --- Validate foreign key constraints. These can fail if there was unvalidated data during the dump. -ALTER TABLE e2e_user_notes VALIDATE CONSTRAINT e2e_user_notes_e2e_users_id_fk; +-- # 1 row diff --git a/internal/e2e/fixtures/cockroach/down/4.sql b/internal/e2e/fixtures/cockroach/down/4.sql index 3cd32657..cc9c77a9 100644 --- a/internal/e2e/fixtures/cockroach/down/4.sql +++ b/internal/e2e/fixtures/cockroach/down/4.sql @@ -1,31 +1,11 @@ -CREATE TABLE e2e_users ( - id UUID NOT NULL, - created_at TIMESTAMP NOT NULL, - updated_at TIMESTAMP NOT NULL, - username VARCHAR(255) NULL, - CONSTRAINT "primary" PRIMARY KEY (id ASC), - FAMILY "primary" (id, created_at, updated_at, username) -); - -CREATE TABLE e2e_user_notes ( - id UUID NOT NULL, - user_id UUID NOT NULL, - 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) -); - -CREATE TABLE schema_migration ( +-- # 1 column +-- # row 1 +-- ## 269 +CREATE TABLE public.schema_migration ( version VARCHAR(14) NOT NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), UNIQUE INDEX schema_migration_version_idx (version ASC), FAMILY "primary" (version, rowid) ); - -ALTER TABLE e2e_user_notes ADD CONSTRAINT e2e_user_notes_e2e_users_id_fk FOREIGN KEY (user_id) REFERENCES e2e_users(id) ON DELETE CASCADE; - --- Validate foreign key constraints. These can fail if there was unvalidated data during the dump. -ALTER TABLE e2e_user_notes VALIDATE CONSTRAINT e2e_user_notes_e2e_users_id_fk; +-- # 1 row diff --git a/internal/e2e/fixtures/cockroach/down/5.sql b/internal/e2e/fixtures/cockroach/down/5.sql index 3cd32657..cc9c77a9 100644 --- a/internal/e2e/fixtures/cockroach/down/5.sql +++ b/internal/e2e/fixtures/cockroach/down/5.sql @@ -1,31 +1,11 @@ -CREATE TABLE e2e_users ( - id UUID NOT NULL, - created_at TIMESTAMP NOT NULL, - updated_at TIMESTAMP NOT NULL, - username VARCHAR(255) NULL, - CONSTRAINT "primary" PRIMARY KEY (id ASC), - FAMILY "primary" (id, created_at, updated_at, username) -); - -CREATE TABLE e2e_user_notes ( - id UUID NOT NULL, - user_id UUID NOT NULL, - 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) -); - -CREATE TABLE schema_migration ( +-- # 1 column +-- # row 1 +-- ## 269 +CREATE TABLE public.schema_migration ( version VARCHAR(14) NOT NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), UNIQUE INDEX schema_migration_version_idx (version ASC), FAMILY "primary" (version, rowid) ); - -ALTER TABLE e2e_user_notes ADD CONSTRAINT e2e_user_notes_e2e_users_id_fk FOREIGN KEY (user_id) REFERENCES e2e_users(id) ON DELETE CASCADE; - --- Validate foreign key constraints. These can fail if there was unvalidated data during the dump. -ALTER TABLE e2e_user_notes VALIDATE CONSTRAINT e2e_user_notes_e2e_users_id_fk; +-- # 1 row diff --git a/internal/e2e/fixtures/cockroach/down/6.sql b/internal/e2e/fixtures/cockroach/down/6.sql index 3cd32657..cc9c77a9 100644 --- a/internal/e2e/fixtures/cockroach/down/6.sql +++ b/internal/e2e/fixtures/cockroach/down/6.sql @@ -1,31 +1,11 @@ -CREATE TABLE e2e_users ( - id UUID NOT NULL, - created_at TIMESTAMP NOT NULL, - updated_at TIMESTAMP NOT NULL, - username VARCHAR(255) NULL, - CONSTRAINT "primary" PRIMARY KEY (id ASC), - FAMILY "primary" (id, created_at, updated_at, username) -); - -CREATE TABLE e2e_user_notes ( - id UUID NOT NULL, - user_id UUID NOT NULL, - 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) -); - -CREATE TABLE schema_migration ( +-- # 1 column +-- # row 1 +-- ## 269 +CREATE TABLE public.schema_migration ( version VARCHAR(14) NOT NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), UNIQUE INDEX schema_migration_version_idx (version ASC), FAMILY "primary" (version, rowid) ); - -ALTER TABLE e2e_user_notes ADD CONSTRAINT e2e_user_notes_e2e_users_id_fk FOREIGN KEY (user_id) REFERENCES e2e_users(id) ON DELETE CASCADE; - --- Validate foreign key constraints. These can fail if there was unvalidated data during the dump. -ALTER TABLE e2e_user_notes VALIDATE CONSTRAINT e2e_user_notes_e2e_users_id_fk; +-- # 1 row diff --git a/internal/e2e/fixtures/cockroach/down/7.sql b/internal/e2e/fixtures/cockroach/down/7.sql index a3f547f1..cc9c77a9 100644 --- a/internal/e2e/fixtures/cockroach/down/7.sql +++ b/internal/e2e/fixtures/cockroach/down/7.sql @@ -1,31 +1,11 @@ -CREATE TABLE e2e_users ( - id UUID NOT NULL, - created_at TIMESTAMP NOT NULL, - updated_at TIMESTAMP NOT NULL, - username VARCHAR(255) NULL, - CONSTRAINT "primary" PRIMARY KEY (id ASC), - FAMILY "primary" (id, created_at, updated_at, username) -); - -CREATE TABLE e2e_user_posts ( - id UUID NOT NULL, - user_id UUID NOT NULL, - 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) -); - -CREATE TABLE schema_migration ( +-- # 1 column +-- # row 1 +-- ## 269 +CREATE TABLE public.schema_migration ( version VARCHAR(14) NOT NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), 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 (user_id) REFERENCES e2e_users(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; +-- # 1 row diff --git a/internal/e2e/fixtures/cockroach/down/8.sql b/internal/e2e/fixtures/cockroach/down/8.sql index cd092333..cc9c77a9 100644 --- a/internal/e2e/fixtures/cockroach/down/8.sql +++ b/internal/e2e/fixtures/cockroach/down/8.sql @@ -1,31 +1,11 @@ -CREATE TABLE e2e_users ( - id UUID NOT NULL, - created_at TIMESTAMP NOT NULL, - updated_at TIMESTAMP NOT NULL, - username VARCHAR(255) NULL, - CONSTRAINT "primary" PRIMARY KEY (id ASC), - FAMILY "primary" (id, created_at, updated_at, username) -); - -CREATE TABLE e2e_user_posts ( - id UUID NOT NULL, - content VARCHAR(255) NOT NULL DEFAULT '':::STRING, - 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) -); - -CREATE TABLE schema_migration ( +-- # 1 column +-- # row 1 +-- ## 269 +CREATE TABLE public.schema_migration ( version VARCHAR(14) NOT NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), 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 (user_id) REFERENCES e2e_users(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; +-- # 1 row diff --git a/internal/e2e/fixtures/cockroach/down/9.sql b/internal/e2e/fixtures/cockroach/down/9.sql index f0d7431c..cc9c77a9 100644 --- a/internal/e2e/fixtures/cockroach/down/9.sql +++ b/internal/e2e/fixtures/cockroach/down/9.sql @@ -1,31 +1,11 @@ -CREATE TABLE e2e_users ( - id UUID NOT NULL, - created_at TIMESTAMP NOT NULL, - updated_at TIMESTAMP NOT NULL, - name VARCHAR(255) NULL, - CONSTRAINT "primary" PRIMARY KEY (id ASC), - FAMILY "primary" (id, created_at, updated_at, name) -); - -CREATE TABLE e2e_user_posts ( - id UUID NOT NULL, - content VARCHAR(255) NOT NULL DEFAULT '':::STRING, - 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) -); - -CREATE TABLE schema_migration ( +-- # 1 column +-- # row 1 +-- ## 269 +CREATE TABLE public.schema_migration ( version VARCHAR(14) NOT NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), 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 (user_id) REFERENCES e2e_users(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; +-- # 1 row diff --git a/internal/e2e/fixtures/cockroach/up/0.sql b/internal/e2e/fixtures/cockroach/up/0.sql index 094f36b7..2c9763ba 100644 --- a/internal/e2e/fixtures/cockroach/up/0.sql +++ b/internal/e2e/fixtures/cockroach/up/0.sql @@ -1,4 +1,16 @@ -CREATE TABLE e2e_users ( +-- # 1 column +-- # row 1 +-- ## 269 +CREATE TABLE public.schema_migration ( + version VARCHAR(14) NOT NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + UNIQUE INDEX schema_migration_version_idx (version ASC), + FAMILY "primary" (version, rowid) +); +-- # row 2 +-- ## 247 +CREATE TABLE public.e2e_users ( id UUID NOT NULL, username VARCHAR(255) NULL, created_at TIMESTAMP NOT NULL, @@ -6,9 +18,4 @@ CREATE TABLE e2e_users ( CONSTRAINT "primary" PRIMARY KEY (id ASC), FAMILY "primary" (id, username, created_at, updated_at) ); - -CREATE TABLE schema_migration ( - version VARCHAR(14) NOT NULL, - UNIQUE INDEX schema_migration_version_idx (version ASC), - FAMILY "primary" (version, rowid) -); +-- # 2 rows diff --git a/internal/e2e/fixtures/cockroach/up/1.sql b/internal/e2e/fixtures/cockroach/up/1.sql index 99e6f184..4d1d0c4f 100644 --- a/internal/e2e/fixtures/cockroach/up/1.sql +++ b/internal/e2e/fixtures/cockroach/up/1.sql @@ -1,4 +1,16 @@ -CREATE TABLE e2e_users ( +-- # 1 column +-- # row 1 +-- ## 269 +CREATE TABLE public.schema_migration ( + version VARCHAR(14) NOT NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + UNIQUE INDEX schema_migration_version_idx (version ASC), + FAMILY "primary" (version, rowid) +); +-- # row 2 +-- ## 247 +CREATE TABLE public.e2e_users ( id UUID NOT NULL, username VARCHAR(255) NULL, created_at TIMESTAMP NOT NULL, @@ -6,26 +18,25 @@ CREATE TABLE e2e_users ( CONSTRAINT "primary" PRIMARY KEY (id ASC), FAMILY "primary" (id, username, created_at, updated_at) ); - -CREATE TABLE e2e_user_notes ( +-- # row 3 +-- ## 341 +CREATE TABLE public.e2e_user_notes ( id UUID NOT NULL, notes VARCHAR(255) NULL, title VARCHAR(64) NOT NULL DEFAULT '':::STRING, user_id UUID 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), INDEX e2e_user_notes_title_idx (title ASC), FAMILY "primary" (id, notes, title, user_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_notes ADD CONSTRAINT e2e_user_notes_e2e_users_id_fk FOREIGN KEY (user_id) REFERENCES e2e_users(id) ON DELETE CASCADE; - --- Validate foreign key constraints. These can fail if there was unvalidated data during the dump. -ALTER TABLE e2e_user_notes VALIDATE CONSTRAINT e2e_user_notes_e2e_users_id_fk; +-- # row 4 +-- ## 152 +ALTER TABLE public.e2e_user_notes ADD CONSTRAINT e2e_user_notes_e2e_users_id_fk FOREIGN KEY (user_id) REFERENCES public.e2e_users(id) ON DELETE CASCADE; +-- # row 5 +-- ## 115 +-- Validate foreign key constraints. These can fail if there was unvalidated data during the SHOW CREATE ALL TABLES +-- # row 6 +-- ## 85 +ALTER TABLE public.e2e_user_notes VALIDATE CONSTRAINT e2e_user_notes_e2e_users_id_fk; +-- # 6 rows diff --git a/internal/e2e/fixtures/cockroach/up/10.sql b/internal/e2e/fixtures/cockroach/up/10.sql index 5346f6ce..1ce93299 100644 --- a/internal/e2e/fixtures/cockroach/up/10.sql +++ b/internal/e2e/fixtures/cockroach/up/10.sql @@ -1,30 +1,41 @@ -CREATE TABLE e2e_users ( +-- # 1 column +-- # row 1 +-- ## 269 +CREATE TABLE public.schema_migration ( + version VARCHAR(14) NOT NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + UNIQUE INDEX schema_migration_version_idx (version ASC), + FAMILY "primary" (version, rowid) +); +-- # row 2 +-- ## 208 +CREATE TABLE public.e2e_users ( 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 ( +-- # row 3 +-- ## 352 +CREATE TABLE public.e2e_user_posts ( id UUID NOT NULL, user_id UUID NOT NULL, content VARCHAR(255) NOT NULL DEFAULT '':::STRING, slug VARCHAR(32) 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, user_id, content, slug) ); - -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 (user_id) REFERENCES e2e_users(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; +-- # row 4 +-- ## 152 +ALTER TABLE public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_e2e_users_id_fk FOREIGN KEY (user_id) REFERENCES public.e2e_users(id) ON DELETE CASCADE; +-- # row 5 +-- ## 115 +-- Validate foreign key constraints. These can fail if there was unvalidated data during the SHOW CREATE ALL TABLES +-- # row 6 +-- ## 85 +ALTER TABLE public.e2e_user_posts VALIDATE CONSTRAINT e2e_user_notes_e2e_users_id_fk; +-- # 6 rows diff --git a/internal/e2e/fixtures/cockroach/up/11.sql b/internal/e2e/fixtures/cockroach/up/11.sql index b61522b0..046eb328 100644 --- a/internal/e2e/fixtures/cockroach/up/11.sql +++ b/internal/e2e/fixtures/cockroach/up/11.sql @@ -1,30 +1,41 @@ -CREATE TABLE e2e_authors ( +-- # 1 column +-- # row 1 +-- ## 269 +CREATE TABLE public.schema_migration ( + version VARCHAR(14) NOT NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + UNIQUE INDEX schema_migration_version_idx (version ASC), + FAMILY "primary" (version, rowid) +); +-- # row 2 +-- ## 210 +CREATE TABLE public.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 ( +-- # row 3 +-- ## 352 +CREATE TABLE public.e2e_user_posts ( id UUID NOT NULL, user_id UUID NOT NULL, content VARCHAR(255) NOT NULL DEFAULT '':::STRING, slug VARCHAR(32) 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, user_id, content, slug) ); - -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 (user_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; +-- # row 4 +-- ## 154 +ALTER TABLE public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_e2e_users_id_fk FOREIGN KEY (user_id) REFERENCES public.e2e_authors(id) ON DELETE CASCADE; +-- # row 5 +-- ## 115 +-- Validate foreign key constraints. These can fail if there was unvalidated data during the SHOW CREATE ALL TABLES +-- # row 6 +-- ## 85 +ALTER TABLE public.e2e_user_posts VALIDATE CONSTRAINT e2e_user_notes_e2e_users_id_fk; +-- # 6 rows diff --git a/internal/e2e/fixtures/cockroach/up/12.sql b/internal/e2e/fixtures/cockroach/up/12.sql index bf9084fc..76061fa7 100644 --- a/internal/e2e/fixtures/cockroach/up/12.sql +++ b/internal/e2e/fixtures/cockroach/up/12.sql @@ -1,30 +1,41 @@ -CREATE TABLE e2e_authors ( +-- # 1 column +-- # row 1 +-- ## 269 +CREATE TABLE public.schema_migration ( + version VARCHAR(14) NOT NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + UNIQUE INDEX schema_migration_version_idx (version ASC), + FAMILY "primary" (version, rowid) +); +-- # row 2 +-- ## 210 +CREATE TABLE public.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 ( +-- # row 3 +-- ## 358 +CREATE TABLE public.e2e_user_posts ( id UUID NOT NULL, author_id UUID NOT NULL, content VARCHAR(255) NOT NULL DEFAULT '':::STRING, slug VARCHAR(32) NOT NULL, CONSTRAINT "primary" PRIMARY KEY (id 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), UNIQUE INDEX e2e_user_notes_slug_idx (slug ASC), FAMILY "primary" (id, author_id, content, slug) ); - -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; +-- # row 4 +-- ## 156 +ALTER TABLE public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_e2e_users_id_fk FOREIGN KEY (author_id) REFERENCES public.e2e_authors(id) ON DELETE CASCADE; +-- # row 5 +-- ## 115 +-- Validate foreign key constraints. These can fail if there was unvalidated data during the SHOW CREATE ALL TABLES +-- # row 6 +-- ## 85 +ALTER TABLE public.e2e_user_posts VALIDATE CONSTRAINT e2e_user_notes_e2e_users_id_fk; +-- # 6 rows diff --git a/internal/e2e/fixtures/cockroach/up/13.sql b/internal/e2e/fixtures/cockroach/up/13.sql index 3b25bca5..e55f8a38 100644 --- a/internal/e2e/fixtures/cockroach/up/13.sql +++ b/internal/e2e/fixtures/cockroach/up/13.sql @@ -1,12 +1,25 @@ -CREATE TABLE e2e_authors ( +-- # 1 column +-- # row 1 +-- ## 269 +CREATE TABLE public.schema_migration ( + version VARCHAR(14) NOT NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + UNIQUE INDEX schema_migration_version_idx (version ASC), + FAMILY "primary" (version, rowid) +); +-- # row 2 +-- ## 210 +CREATE TABLE public.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 ( +-- # row 3 +-- ## 405 +CREATE TABLE public.e2e_user_posts ( id UUID NOT NULL, content VARCHAR(255) NOT NULL DEFAULT '':::STRING, slug VARCHAR(32) NOT NULL, @@ -14,18 +27,16 @@ 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) ); - -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; +-- # row 4 +-- ## 156 +ALTER TABLE public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_e2e_users_id_fk FOREIGN KEY (author_id) REFERENCES public.e2e_authors(id) ON DELETE CASCADE; +-- # row 5 +-- ## 115 +-- Validate foreign key constraints. These can fail if there was unvalidated data during the SHOW CREATE ALL TABLES +-- # row 6 +-- ## 85 +ALTER TABLE public.e2e_user_posts VALIDATE CONSTRAINT e2e_user_notes_e2e_users_id_fk; +-- # 6 rows diff --git a/internal/e2e/fixtures/cockroach/up/14.sql b/internal/e2e/fixtures/cockroach/up/14.sql index 611a3bf1..cc61db16 100644 --- a/internal/e2e/fixtures/cockroach/up/14.sql +++ b/internal/e2e/fixtures/cockroach/up/14.sql @@ -1,60 +1,80 @@ -CREATE TABLE e2e_address ( - id UUID NOT NULL, - CONSTRAINT "primary" PRIMARY KEY (id ASC), - FAMILY "primary" (id) +-- # 1 column +-- # row 1 +-- ## 269 +CREATE TABLE public.schema_migration ( + version VARCHAR(14) NOT NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + UNIQUE INDEX schema_migration_version_idx (version ASC), + FAMILY "primary" (version, rowid) ); - -CREATE TABLE e2e_authors ( +-- # row 2 +-- ## 210 +CREATE TABLE public.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 ( +-- # row 3 +-- ## 405 +CREATE TABLE public.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_user_id_idx (author_id ASC), + FAMILY "primary" (id, content, slug, published, author_id) +); +-- # row 4 +-- ## 119 +CREATE TABLE public.e2e_flow ( + id UUID NOT NULL, + CONSTRAINT "primary" PRIMARY KEY (id ASC), + FAMILY "primary" (id) +); +-- # row 5 +-- ## 122 +CREATE TABLE public.e2e_address ( id UUID NOT NULL, CONSTRAINT "primary" PRIMARY KEY (id ASC), FAMILY "primary" (id) ); - -CREATE TABLE e2e_token ( +-- # row 6 +-- ## 322 +CREATE TABLE public.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; +-- # row 7 +-- ## 156 +ALTER TABLE public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_e2e_users_id_fk FOREIGN KEY (author_id) REFERENCES public.e2e_authors(id) ON DELETE CASCADE; +-- # row 8 +-- ## 144 +ALTER TABLE public.e2e_token ADD CONSTRAINT e2e_token_e2e_flow_id_fk FOREIGN KEY (e2e_flow_id) REFERENCES public.e2e_flow(id) ON DELETE CASCADE; +-- # row 9 +-- ## 153 +ALTER TABLE public.e2e_token ADD CONSTRAINT e2e_token_e2e_address_id_fk FOREIGN KEY (e2e_address_id) REFERENCES public.e2e_address(id) ON DELETE CASCADE; +-- # row 10 +-- ## 115 +-- Validate foreign key constraints. These can fail if there was unvalidated data during the SHOW CREATE ALL TABLES +-- # row 11 +-- ## 85 +ALTER TABLE public.e2e_user_posts VALIDATE CONSTRAINT e2e_user_notes_e2e_users_id_fk; +-- # row 12 +-- ## 74 +ALTER TABLE public.e2e_token VALIDATE CONSTRAINT e2e_token_e2e_flow_id_fk; +-- # row 13 +-- ## 77 +ALTER TABLE public.e2e_token VALIDATE CONSTRAINT e2e_token_e2e_address_id_fk; +-- # 13 rows diff --git a/internal/e2e/fixtures/cockroach/up/15.sql b/internal/e2e/fixtures/cockroach/up/15.sql index 833b8b4f..d24fec17 100644 --- a/internal/e2e/fixtures/cockroach/up/15.sql +++ b/internal/e2e/fixtures/cockroach/up/15.sql @@ -1,62 +1,82 @@ -CREATE TABLE e2e_address ( - id UUID NOT NULL, - CONSTRAINT "primary" PRIMARY KEY (id ASC), - FAMILY "primary" (id) +-- # 1 column +-- # row 1 +-- ## 269 +CREATE TABLE public.schema_migration ( + version VARCHAR(14) NOT NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + UNIQUE INDEX schema_migration_version_idx (version ASC), + FAMILY "primary" (version, rowid) ); - -CREATE TABLE e2e_authors ( +-- # row 2 +-- ## 210 +CREATE TABLE public.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 ( +-- # row 3 +-- ## 405 +CREATE TABLE public.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_user_id_idx (author_id ASC), + FAMILY "primary" (id, content, slug, published, author_id) +); +-- # row 4 +-- ## 119 +CREATE TABLE public.e2e_flow ( + id UUID NOT NULL, + CONSTRAINT "primary" PRIMARY KEY (id ASC), + FAMILY "primary" (id) +); +-- # row 5 +-- ## 122 +CREATE TABLE public.e2e_address ( id UUID NOT NULL, CONSTRAINT "primary" PRIMARY KEY (id ASC), FAMILY "primary" (id) ); - -CREATE TABLE e2e_token ( +-- # row 6 +-- ## 488 +CREATE TABLE public.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, + expires_at TIMESTAMP NOT NULL DEFAULT '2000-01-01 00:00:00':::TIMESTAMP, + issued_at TIMESTAMP NOT NULL DEFAULT '2000-01-01 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; +-- # row 7 +-- ## 156 +ALTER TABLE public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_e2e_users_id_fk FOREIGN KEY (author_id) REFERENCES public.e2e_authors(id) ON DELETE CASCADE; +-- # row 8 +-- ## 153 +ALTER TABLE public.e2e_token ADD CONSTRAINT e2e_token_e2e_address_id_fk FOREIGN KEY (e2e_address_id) REFERENCES public.e2e_address(id) ON DELETE CASCADE; +-- # row 9 +-- ## 144 +ALTER TABLE public.e2e_token ADD CONSTRAINT e2e_token_e2e_flow_id_fk FOREIGN KEY (e2e_flow_id) REFERENCES public.e2e_flow(id) ON DELETE CASCADE; +-- # row 10 +-- ## 115 +-- Validate foreign key constraints. These can fail if there was unvalidated data during the SHOW CREATE ALL TABLES +-- # row 11 +-- ## 85 +ALTER TABLE public.e2e_user_posts VALIDATE CONSTRAINT e2e_user_notes_e2e_users_id_fk; +-- # row 12 +-- ## 77 +ALTER TABLE public.e2e_token VALIDATE CONSTRAINT e2e_token_e2e_address_id_fk; +-- # row 13 +-- ## 74 +ALTER TABLE public.e2e_token VALIDATE CONSTRAINT e2e_token_e2e_flow_id_fk; +-- # 13 rows diff --git a/internal/e2e/fixtures/cockroach/up/16.sql b/internal/e2e/fixtures/cockroach/up/16.sql new file mode 100644 index 00000000..d7d1aed6 --- /dev/null +++ b/internal/e2e/fixtures/cockroach/up/16.sql @@ -0,0 +1,89 @@ +-- # 1 column +-- # row 1 +-- ## 269 +CREATE TABLE public.schema_migration ( + version VARCHAR(14) NOT NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + UNIQUE INDEX schema_migration_version_idx (version ASC), + FAMILY "primary" (version, rowid) +); +-- # row 2 +-- ## 210 +CREATE TABLE public.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) +); +-- # row 3 +-- ## 405 +CREATE TABLE public.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_user_id_idx (author_id ASC), + FAMILY "primary" (id, content, slug, published, author_id) +); +-- # row 4 +-- ## 119 +CREATE TABLE public.e2e_flow ( + id UUID NOT NULL, + CONSTRAINT "primary" PRIMARY KEY (id ASC), + FAMILY "primary" (id) +); +-- # row 5 +-- ## 122 +CREATE TABLE public.e2e_address ( + id UUID NOT NULL, + CONSTRAINT "primary" PRIMARY KEY (id ASC), + FAMILY "primary" (id) +); +-- # row 6 +-- ## 517 +CREATE TABLE public.e2e_token ( + id UUID NOT NULL, + token VARCHAR(64) NOT NULL, + e2e_address_id UUID NOT NULL, + issued_at TIMESTAMP NOT NULL DEFAULT '2000-01-01 00:00:00':::TIMESTAMP, + e2e_flow_id UUID NULL, + flow_id UUID NULL, + expires_at TIMESTAMP NOT NULL DEFAULT '2001-01-01 00:00:00':::TIMESTAMP, + CONSTRAINT "primary" PRIMARY KEY (id ASC), + UNIQUE INDEX e2e_token_uq_idx (token ASC), + INDEX e2e_token_idx (token ASC), + FAMILY "primary" (id, token, e2e_address_id, issued_at, e2e_flow_id, flow_id, expires_at) +); +-- # row 7 +-- ## 156 +ALTER TABLE public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_e2e_users_id_fk FOREIGN KEY (author_id) REFERENCES public.e2e_authors(id) ON DELETE CASCADE; +-- # row 8 +-- ## 153 +ALTER TABLE public.e2e_token ADD CONSTRAINT e2e_token_e2e_address_id_fk FOREIGN KEY (e2e_address_id) REFERENCES public.e2e_address(id) ON DELETE CASCADE; +-- # row 9 +-- ## 144 +ALTER TABLE public.e2e_token ADD CONSTRAINT e2e_token_e2e_flow_id_fk FOREIGN KEY (e2e_flow_id) REFERENCES public.e2e_flow(id) ON DELETE CASCADE; +-- # row 10 +-- ## 137 +ALTER TABLE public.e2e_token ADD CONSTRAINT e2e_token_flow_id_fk FOREIGN KEY (flow_id) REFERENCES public.e2e_flow(id) ON DELETE RESTRICT; +-- # row 11 +-- ## 115 +-- Validate foreign key constraints. These can fail if there was unvalidated data during the SHOW CREATE ALL TABLES +-- # row 12 +-- ## 85 +ALTER TABLE public.e2e_user_posts VALIDATE CONSTRAINT e2e_user_notes_e2e_users_id_fk; +-- # row 13 +-- ## 77 +ALTER TABLE public.e2e_token VALIDATE CONSTRAINT e2e_token_e2e_address_id_fk; +-- # row 14 +-- ## 74 +ALTER TABLE public.e2e_token VALIDATE CONSTRAINT e2e_token_e2e_flow_id_fk; +-- # row 15 +-- ## 70 +ALTER TABLE public.e2e_token VALIDATE CONSTRAINT e2e_token_flow_id_fk; +-- # 15 rows diff --git a/internal/e2e/fixtures/cockroach/up/2.sql b/internal/e2e/fixtures/cockroach/up/2.sql index 7ac1b314..83728d31 100644 --- a/internal/e2e/fixtures/cockroach/up/2.sql +++ b/internal/e2e/fixtures/cockroach/up/2.sql @@ -1,4 +1,16 @@ -CREATE TABLE e2e_users ( +-- # 1 column +-- # row 1 +-- ## 269 +CREATE TABLE public.schema_migration ( + version VARCHAR(14) NOT NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + UNIQUE INDEX schema_migration_version_idx (version ASC), + FAMILY "primary" (version, rowid) +); +-- # row 2 +-- ## 247 +CREATE TABLE public.e2e_users ( id UUID NOT NULL, username VARCHAR(255) NULL, created_at TIMESTAMP NOT NULL, @@ -6,24 +18,23 @@ CREATE TABLE e2e_users ( CONSTRAINT "primary" PRIMARY KEY (id ASC), FAMILY "primary" (id, username, created_at, updated_at) ); - -CREATE TABLE e2e_user_notes ( +-- # row 3 +-- ## 240 +CREATE TABLE public.e2e_user_notes ( id UUID NOT NULL, notes VARCHAR(255) NULL, user_id UUID 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), FAMILY "primary" (id, notes, user_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_notes ADD CONSTRAINT e2e_user_notes_e2e_users_id_fk FOREIGN KEY (user_id) REFERENCES e2e_users(id) ON DELETE CASCADE; - --- Validate foreign key constraints. These can fail if there was unvalidated data during the dump. -ALTER TABLE e2e_user_notes VALIDATE CONSTRAINT e2e_user_notes_e2e_users_id_fk; +-- # row 4 +-- ## 152 +ALTER TABLE public.e2e_user_notes ADD CONSTRAINT e2e_user_notes_e2e_users_id_fk FOREIGN KEY (user_id) REFERENCES public.e2e_users(id) ON DELETE CASCADE; +-- # row 5 +-- ## 115 +-- Validate foreign key constraints. These can fail if there was unvalidated data during the SHOW CREATE ALL TABLES +-- # row 6 +-- ## 85 +ALTER TABLE public.e2e_user_notes VALIDATE CONSTRAINT e2e_user_notes_e2e_users_id_fk; +-- # 6 rows diff --git a/internal/e2e/fixtures/cockroach/up/3.sql b/internal/e2e/fixtures/cockroach/up/3.sql index e558dd85..cc99ebdb 100644 --- a/internal/e2e/fixtures/cockroach/up/3.sql +++ b/internal/e2e/fixtures/cockroach/up/3.sql @@ -1,4 +1,16 @@ -CREATE TABLE e2e_users ( +-- # 1 column +-- # row 1 +-- ## 269 +CREATE TABLE public.schema_migration ( + version VARCHAR(14) NOT NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + UNIQUE INDEX schema_migration_version_idx (version ASC), + FAMILY "primary" (version, rowid) +); +-- # row 2 +-- ## 247 +CREATE TABLE public.e2e_users ( id UUID NOT NULL, username VARCHAR(255) NULL, created_at TIMESTAMP NOT NULL, @@ -6,25 +18,24 @@ CREATE TABLE e2e_users ( CONSTRAINT "primary" PRIMARY KEY (id ASC), FAMILY "primary" (id, username, created_at, updated_at) ); - -CREATE TABLE e2e_user_notes ( +-- # row 3 +-- ## 270 +CREATE TABLE public.e2e_user_notes ( id UUID NOT NULL, notes VARCHAR(255) NULL, user_id UUID NOT NULL, slug VARCHAR(64) 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, notes, user_id, slug) ); - -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_notes ADD CONSTRAINT e2e_user_notes_e2e_users_id_fk FOREIGN KEY (user_id) REFERENCES e2e_users(id) ON DELETE CASCADE; - --- Validate foreign key constraints. These can fail if there was unvalidated data during the dump. -ALTER TABLE e2e_user_notes VALIDATE CONSTRAINT e2e_user_notes_e2e_users_id_fk; +-- # row 4 +-- ## 152 +ALTER TABLE public.e2e_user_notes ADD CONSTRAINT e2e_user_notes_e2e_users_id_fk FOREIGN KEY (user_id) REFERENCES public.e2e_users(id) ON DELETE CASCADE; +-- # row 5 +-- ## 115 +-- Validate foreign key constraints. These can fail if there was unvalidated data during the SHOW CREATE ALL TABLES +-- # row 6 +-- ## 85 +ALTER TABLE public.e2e_user_notes VALIDATE CONSTRAINT e2e_user_notes_e2e_users_id_fk; +-- # 6 rows diff --git a/internal/e2e/fixtures/cockroach/up/4.sql b/internal/e2e/fixtures/cockroach/up/4.sql index e558dd85..cc99ebdb 100644 --- a/internal/e2e/fixtures/cockroach/up/4.sql +++ b/internal/e2e/fixtures/cockroach/up/4.sql @@ -1,4 +1,16 @@ -CREATE TABLE e2e_users ( +-- # 1 column +-- # row 1 +-- ## 269 +CREATE TABLE public.schema_migration ( + version VARCHAR(14) NOT NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + UNIQUE INDEX schema_migration_version_idx (version ASC), + FAMILY "primary" (version, rowid) +); +-- # row 2 +-- ## 247 +CREATE TABLE public.e2e_users ( id UUID NOT NULL, username VARCHAR(255) NULL, created_at TIMESTAMP NOT NULL, @@ -6,25 +18,24 @@ CREATE TABLE e2e_users ( CONSTRAINT "primary" PRIMARY KEY (id ASC), FAMILY "primary" (id, username, created_at, updated_at) ); - -CREATE TABLE e2e_user_notes ( +-- # row 3 +-- ## 270 +CREATE TABLE public.e2e_user_notes ( id UUID NOT NULL, notes VARCHAR(255) NULL, user_id UUID NOT NULL, slug VARCHAR(64) 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, notes, user_id, slug) ); - -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_notes ADD CONSTRAINT e2e_user_notes_e2e_users_id_fk FOREIGN KEY (user_id) REFERENCES e2e_users(id) ON DELETE CASCADE; - --- Validate foreign key constraints. These can fail if there was unvalidated data during the dump. -ALTER TABLE e2e_user_notes VALIDATE CONSTRAINT e2e_user_notes_e2e_users_id_fk; +-- # row 4 +-- ## 152 +ALTER TABLE public.e2e_user_notes ADD CONSTRAINT e2e_user_notes_e2e_users_id_fk FOREIGN KEY (user_id) REFERENCES public.e2e_users(id) ON DELETE CASCADE; +-- # row 5 +-- ## 115 +-- Validate foreign key constraints. These can fail if there was unvalidated data during the SHOW CREATE ALL TABLES +-- # row 6 +-- ## 85 +ALTER TABLE public.e2e_user_notes VALIDATE CONSTRAINT e2e_user_notes_e2e_users_id_fk; +-- # 6 rows diff --git a/internal/e2e/fixtures/cockroach/up/5.sql b/internal/e2e/fixtures/cockroach/up/5.sql index b66869e4..0a021eae 100644 --- a/internal/e2e/fixtures/cockroach/up/5.sql +++ b/internal/e2e/fixtures/cockroach/up/5.sql @@ -1,4 +1,16 @@ -CREATE TABLE e2e_users ( +-- # 1 column +-- # row 1 +-- ## 269 +CREATE TABLE public.schema_migration ( + version VARCHAR(14) NOT NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + UNIQUE INDEX schema_migration_version_idx (version ASC), + FAMILY "primary" (version, rowid) +); +-- # row 2 +-- ## 247 +CREATE TABLE public.e2e_users ( id UUID NOT NULL, username VARCHAR(255) NULL, created_at TIMESTAMP NOT NULL, @@ -6,26 +18,25 @@ CREATE TABLE e2e_users ( CONSTRAINT "primary" PRIMARY KEY (id ASC), FAMILY "primary" (id, username, created_at, updated_at) ); - -CREATE TABLE e2e_user_notes ( +-- # row 3 +-- ## 324 +CREATE TABLE public.e2e_user_notes ( id UUID NOT NULL, notes VARCHAR(255) NULL, 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, notes, user_id, slug) ); - -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_notes ADD CONSTRAINT e2e_user_notes_e2e_users_id_fk FOREIGN KEY (user_id) REFERENCES e2e_users(id) ON DELETE CASCADE; - --- Validate foreign key constraints. These can fail if there was unvalidated data during the dump. -ALTER TABLE e2e_user_notes VALIDATE CONSTRAINT e2e_user_notes_e2e_users_id_fk; +-- # row 4 +-- ## 152 +ALTER TABLE public.e2e_user_notes ADD CONSTRAINT e2e_user_notes_e2e_users_id_fk FOREIGN KEY (user_id) REFERENCES public.e2e_users(id) ON DELETE CASCADE; +-- # row 5 +-- ## 115 +-- Validate foreign key constraints. These can fail if there was unvalidated data during the SHOW CREATE ALL TABLES +-- # row 6 +-- ## 85 +ALTER TABLE public.e2e_user_notes VALIDATE CONSTRAINT e2e_user_notes_e2e_users_id_fk; +-- # 6 rows diff --git a/internal/e2e/fixtures/cockroach/up/6.sql b/internal/e2e/fixtures/cockroach/up/6.sql index 6b7f10b2..cb08e9f8 100644 --- a/internal/e2e/fixtures/cockroach/up/6.sql +++ b/internal/e2e/fixtures/cockroach/up/6.sql @@ -1,4 +1,16 @@ -CREATE TABLE e2e_users ( +-- # 1 column +-- # row 1 +-- ## 269 +CREATE TABLE public.schema_migration ( + version VARCHAR(14) NOT NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + UNIQUE INDEX schema_migration_version_idx (version ASC), + FAMILY "primary" (version, rowid) +); +-- # row 2 +-- ## 247 +CREATE TABLE public.e2e_users ( id UUID NOT NULL, username VARCHAR(255) NULL, created_at TIMESTAMP NOT NULL, @@ -6,26 +18,25 @@ CREATE TABLE e2e_users ( CONSTRAINT "primary" PRIMARY KEY (id ASC), FAMILY "primary" (id, username, created_at, updated_at) ); - -CREATE TABLE e2e_user_posts ( +-- # row 3 +-- ## 324 +CREATE TABLE public.e2e_user_posts ( id UUID NOT NULL, notes VARCHAR(255) NULL, 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, notes, user_id, slug) ); - -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 (user_id) REFERENCES e2e_users(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; +-- # row 4 +-- ## 152 +ALTER TABLE public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_e2e_users_id_fk FOREIGN KEY (user_id) REFERENCES public.e2e_users(id) ON DELETE CASCADE; +-- # row 5 +-- ## 115 +-- Validate foreign key constraints. These can fail if there was unvalidated data during the SHOW CREATE ALL TABLES +-- # row 6 +-- ## 85 +ALTER TABLE public.e2e_user_posts VALIDATE CONSTRAINT e2e_user_notes_e2e_users_id_fk; +-- # 6 rows diff --git a/internal/e2e/fixtures/cockroach/up/7.sql b/internal/e2e/fixtures/cockroach/up/7.sql index c0843a8b..9cea5c38 100644 --- a/internal/e2e/fixtures/cockroach/up/7.sql +++ b/internal/e2e/fixtures/cockroach/up/7.sql @@ -1,4 +1,16 @@ -CREATE TABLE e2e_users ( +-- # 1 column +-- # row 1 +-- ## 269 +CREATE TABLE public.schema_migration ( + version VARCHAR(14) NOT NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + UNIQUE INDEX schema_migration_version_idx (version ASC), + FAMILY "primary" (version, rowid) +); +-- # row 2 +-- ## 247 +CREATE TABLE public.e2e_users ( id UUID NOT NULL, username VARCHAR(255) NULL, created_at TIMESTAMP NOT NULL, @@ -6,26 +18,25 @@ CREATE TABLE e2e_users ( CONSTRAINT "primary" PRIMARY KEY (id ASC), FAMILY "primary" (id, username, created_at, updated_at) ); - -CREATE TABLE e2e_user_posts ( +-- # row 3 +-- ## 352 +CREATE TABLE public.e2e_user_posts ( id UUID NOT NULL, user_id UUID NOT NULL, slug VARCHAR(64) NOT NULL, content VARCHAR(255) 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), UNIQUE INDEX e2e_user_notes_slug_idx (slug ASC), FAMILY "primary" (id, user_id, slug, content) ); - -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 (user_id) REFERENCES e2e_users(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; +-- # row 4 +-- ## 152 +ALTER TABLE public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_e2e_users_id_fk FOREIGN KEY (user_id) REFERENCES public.e2e_users(id) ON DELETE CASCADE; +-- # row 5 +-- ## 115 +-- Validate foreign key constraints. These can fail if there was unvalidated data during the SHOW CREATE ALL TABLES +-- # row 6 +-- ## 85 +ALTER TABLE public.e2e_user_posts VALIDATE CONSTRAINT e2e_user_notes_e2e_users_id_fk; +-- # 6 rows diff --git a/internal/e2e/fixtures/cockroach/up/8.sql b/internal/e2e/fixtures/cockroach/up/8.sql index fe96793b..8746816e 100644 --- a/internal/e2e/fixtures/cockroach/up/8.sql +++ b/internal/e2e/fixtures/cockroach/up/8.sql @@ -1,4 +1,16 @@ -CREATE TABLE e2e_users ( +-- # 1 column +-- # row 1 +-- ## 269 +CREATE TABLE public.schema_migration ( + version VARCHAR(14) NOT NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + UNIQUE INDEX schema_migration_version_idx (version ASC), + FAMILY "primary" (version, rowid) +); +-- # row 2 +-- ## 239 +CREATE TABLE public.e2e_users ( id UUID NOT NULL, name VARCHAR(255) NULL, created_at TIMESTAMP NOT NULL, @@ -6,26 +18,25 @@ CREATE TABLE e2e_users ( CONSTRAINT "primary" PRIMARY KEY (id ASC), FAMILY "primary" (id, name, created_at, updated_at) ); - -CREATE TABLE e2e_user_posts ( +-- # row 3 +-- ## 352 +CREATE TABLE public.e2e_user_posts ( id UUID NOT NULL, user_id UUID NOT NULL, slug VARCHAR(64) NOT NULL, content VARCHAR(255) 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), UNIQUE INDEX e2e_user_notes_slug_idx (slug ASC), FAMILY "primary" (id, user_id, slug, content) ); - -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 (user_id) REFERENCES e2e_users(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; +-- # row 4 +-- ## 152 +ALTER TABLE public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_e2e_users_id_fk FOREIGN KEY (user_id) REFERENCES public.e2e_users(id) ON DELETE CASCADE; +-- # row 5 +-- ## 115 +-- Validate foreign key constraints. These can fail if there was unvalidated data during the SHOW CREATE ALL TABLES +-- # row 6 +-- ## 85 +ALTER TABLE public.e2e_user_posts VALIDATE CONSTRAINT e2e_user_notes_e2e_users_id_fk; +-- # 6 rows diff --git a/internal/e2e/fixtures/cockroach/up/9.sql b/internal/e2e/fixtures/cockroach/up/9.sql index 99fb8e71..9ca0d17c 100644 --- a/internal/e2e/fixtures/cockroach/up/9.sql +++ b/internal/e2e/fixtures/cockroach/up/9.sql @@ -1,30 +1,41 @@ -CREATE TABLE e2e_users ( +-- # 1 column +-- # row 1 +-- ## 269 +CREATE TABLE public.schema_migration ( + version VARCHAR(14) NOT NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + UNIQUE INDEX schema_migration_version_idx (version ASC), + FAMILY "primary" (version, rowid) +); +-- # row 2 +-- ## 208 +CREATE TABLE public.e2e_users ( 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 ( +-- # row 3 +-- ## 352 +CREATE TABLE public.e2e_user_posts ( id UUID NOT NULL, user_id UUID NOT NULL, slug VARCHAR(64) NOT NULL, content VARCHAR(255) 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), UNIQUE INDEX e2e_user_notes_slug_idx (slug ASC), FAMILY "primary" (id, user_id, slug, content) ); - -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 (user_id) REFERENCES e2e_users(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; +-- # row 4 +-- ## 152 +ALTER TABLE public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_e2e_users_id_fk FOREIGN KEY (user_id) REFERENCES public.e2e_users(id) ON DELETE CASCADE; +-- # row 5 +-- ## 115 +-- Validate foreign key constraints. These can fail if there was unvalidated data during the SHOW CREATE ALL TABLES +-- # row 6 +-- ## 85 +ALTER TABLE public.e2e_user_posts VALIDATE CONSTRAINT e2e_user_notes_e2e_users_id_fk; +-- # 6 rows diff --git a/internal/e2e/fixtures/mysql/down/0.sql b/internal/e2e/fixtures/mysql/down/0.sql index 3678352a..b1e18406 100644 --- a/internal/e2e/fixtures/mysql/down/0.sql +++ b/internal/e2e/fixtures/mysql/down/0.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.27, for macos12.0 (arm64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ --- Server version 5.7.31 +-- Server version 5.7.36 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -25,7 +25,7 @@ DROP TABLE IF EXISTS `schema_migration`; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -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-09-03 11:40:22 +-- Dump completed on 2021-12-03 10:52:21 diff --git a/internal/e2e/fixtures/mysql/down/1.sql b/internal/e2e/fixtures/mysql/down/1.sql index f6e329b4..32f9f42f 100644 --- a/internal/e2e/fixtures/mysql/down/1.sql +++ b/internal/e2e/fixtures/mysql/down/1.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.27, for macos12.0 (arm64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ --- Server version 5.7.31 +-- Server version 5.7.36 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -28,7 +28,7 @@ CREATE TABLE `e2e_users` ( `updated_at` datetime NOT NULL, `username` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -41,7 +41,7 @@ DROP TABLE IF EXISTS `schema_migration`; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -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-09-03 11:40:22 +-- Dump completed on 2021-12-03 10:52:21 diff --git a/internal/e2e/fixtures/mysql/down/10.sql b/internal/e2e/fixtures/mysql/down/10.sql index 0bba3ca3..82c29f26 100644 --- a/internal/e2e/fixtures/mysql/down/10.sql +++ b/internal/e2e/fixtures/mysql/down/10.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.27, for macos12.0 (arm64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ --- Server version 5.7.31 +-- Server version 5.7.36 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -31,7 +31,7 @@ CREATE TABLE `e2e_user_posts` ( UNIQUE KEY `e2e_user_notes_slug_idx` (`slug`), KEY `e2e_user_notes_user_id_idx` (`user_id`), CONSTRAINT `e2e_user_posts_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `e2e_users` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -46,7 +46,7 @@ CREATE TABLE `e2e_users` ( `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -59,7 +59,7 @@ DROP TABLE IF EXISTS `schema_migration`; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -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-09-03 11:40:18 +-- Dump completed on 2021-12-03 10:52:19 diff --git a/internal/e2e/fixtures/mysql/down/11.sql b/internal/e2e/fixtures/mysql/down/11.sql index 5a2597e0..80312022 100644 --- a/internal/e2e/fixtures/mysql/down/11.sql +++ b/internal/e2e/fixtures/mysql/down/11.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.27, for macos12.0 (arm64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ --- Server version 5.7.31 +-- Server version 5.7.36 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -31,7 +31,7 @@ CREATE TABLE `e2e_user_posts` ( UNIQUE KEY `e2e_user_notes_slug_idx` (`slug`), KEY `e2e_user_notes_user_id_idx` (`user_id`), CONSTRAINT `e2e_user_posts_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `e2e_users` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -46,7 +46,7 @@ CREATE TABLE `e2e_users` ( `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -59,7 +59,7 @@ DROP TABLE IF EXISTS `schema_migration`; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -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-09-03 11:40:18 +-- Dump completed on 2021-12-03 10:52:19 diff --git a/internal/e2e/fixtures/mysql/down/12.sql b/internal/e2e/fixtures/mysql/down/12.sql index 704f6428..0d64a315 100644 --- a/internal/e2e/fixtures/mysql/down/12.sql +++ b/internal/e2e/fixtures/mysql/down/12.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.27, for macos12.0 (arm64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ --- Server version 5.7.31 +-- Server version 5.7.36 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -27,7 +27,7 @@ CREATE TABLE `e2e_authors` ( `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -46,7 +46,7 @@ CREATE TABLE `e2e_user_posts` ( UNIQUE KEY `e2e_user_notes_slug_idx` (`slug`), KEY `e2e_user_notes_user_id_idx` (`user_id`), CONSTRAINT `e2e_user_posts_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `e2e_authors` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -59,7 +59,7 @@ DROP TABLE IF EXISTS `schema_migration`; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -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-09-03 11:40:18 +-- Dump completed on 2021-12-03 10:52:18 diff --git a/internal/e2e/fixtures/mysql/down/13.sql b/internal/e2e/fixtures/mysql/down/13.sql index 93e3a1d4..b96d7695 100644 --- a/internal/e2e/fixtures/mysql/down/13.sql +++ b/internal/e2e/fixtures/mysql/down/13.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.27, for macos12.0 (arm64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ --- Server version 5.7.31 +-- Server version 5.7.36 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -27,7 +27,7 @@ CREATE TABLE `e2e_authors` ( `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -46,7 +46,7 @@ CREATE TABLE `e2e_user_posts` ( 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; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -59,7 +59,7 @@ DROP TABLE IF EXISTS `schema_migration`; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -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-09-03 11:40:17 +-- Dump completed on 2021-12-03 10:52:18 diff --git a/internal/e2e/fixtures/mysql/down/14.sql b/internal/e2e/fixtures/mysql/down/14.sql index 345aaec4..1e1d900c 100644 --- a/internal/e2e/fixtures/mysql/down/14.sql +++ b/internal/e2e/fixtures/mysql/down/14.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.27, for macos12.0 (arm64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ --- Server version 5.7.31 +-- Server version 5.7.36 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -27,7 +27,7 @@ CREATE TABLE `e2e_authors` ( `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -47,7 +47,7 @@ CREATE TABLE `e2e_user_posts` ( 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; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -60,7 +60,7 @@ DROP TABLE IF EXISTS `schema_migration`; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -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-09-03 11:40:17 +-- Dump completed on 2021-12-03 10:52:18 diff --git a/internal/e2e/fixtures/mysql/down/15.sql b/internal/e2e/fixtures/mysql/down/15.sql index a096f11a..b0695584 100644 --- a/internal/e2e/fixtures/mysql/down/15.sql +++ b/internal/e2e/fixtures/mysql/down/15.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.27, for macos12.0 (arm64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ --- Server version 5.7.31 +-- Server version 5.7.36 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -25,7 +25,7 @@ DROP TABLE IF EXISTS `e2e_address`; CREATE TABLE `e2e_address` ( `id` char(36) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -40,7 +40,7 @@ CREATE TABLE `e2e_authors` ( `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -53,7 +53,7 @@ DROP TABLE IF EXISTS `e2e_flow`; CREATE TABLE `e2e_flow` ( `id` char(36) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -77,7 +77,7 @@ CREATE TABLE `e2e_token` ( 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; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -97,7 +97,7 @@ CREATE TABLE `e2e_user_posts` ( 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; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -110,7 +110,7 @@ DROP TABLE IF EXISTS `schema_migration`; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -122,4 +122,4 @@ CREATE TABLE `schema_migration` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-09-03 11:40:17 +-- Dump completed on 2021-12-03 10:52:17 diff --git a/internal/e2e/fixtures/mysql/down/16.sql b/internal/e2e/fixtures/mysql/down/16.sql new file mode 100644 index 00000000..72a7d0ef --- /dev/null +++ b/internal/e2e/fixtures/mysql/down/16.sql @@ -0,0 +1,125 @@ +-- MySQL dump 10.13 Distrib 8.0.27, for macos12.0 (arm64) +-- +-- Host: 127.0.0.1 Database: pop_test +-- ------------------------------------------------------ +-- Server version 5.7.36 + +/*!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=latin1; +/*!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=latin1; +/*!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=latin1; +/*!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=latin1; +/*!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=latin1; +/*!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=latin1; +/*!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 2021-12-03 10:52:17 diff --git a/internal/e2e/fixtures/mysql/down/2.sql b/internal/e2e/fixtures/mysql/down/2.sql index 2f627f4e..badaef0d 100644 --- a/internal/e2e/fixtures/mysql/down/2.sql +++ b/internal/e2e/fixtures/mysql/down/2.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.27, for macos12.0 (arm64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ --- Server version 5.7.31 +-- Server version 5.7.36 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -31,7 +31,7 @@ CREATE TABLE `e2e_user_notes` ( KEY `e2e_user_notes_user_id_idx` (`user_id`), KEY `e2e_user_notes_title_idx` (`title`), CONSTRAINT `e2e_user_notes_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `e2e_users` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -47,7 +47,7 @@ CREATE TABLE `e2e_users` ( `updated_at` datetime NOT NULL, `username` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -60,7 +60,7 @@ DROP TABLE IF EXISTS `schema_migration`; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -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-09-03 11:40:21 +-- Dump completed on 2021-12-03 10:52:21 diff --git a/internal/e2e/fixtures/mysql/down/3.sql b/internal/e2e/fixtures/mysql/down/3.sql index 65f4e20c..d015926a 100644 --- a/internal/e2e/fixtures/mysql/down/3.sql +++ b/internal/e2e/fixtures/mysql/down/3.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.27, for macos12.0 (arm64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ --- Server version 5.7.31 +-- Server version 5.7.36 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -29,7 +29,7 @@ CREATE TABLE `e2e_user_notes` ( PRIMARY KEY (`id`), KEY `e2e_user_notes_user_id_idx` (`user_id`), CONSTRAINT `e2e_user_notes_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `e2e_users` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -45,7 +45,7 @@ CREATE TABLE `e2e_users` ( `updated_at` datetime NOT NULL, `username` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -58,7 +58,7 @@ DROP TABLE IF EXISTS `schema_migration`; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -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-09-03 11:40:21 +-- Dump completed on 2021-12-03 10:52:21 diff --git a/internal/e2e/fixtures/mysql/down/4.sql b/internal/e2e/fixtures/mysql/down/4.sql index 13a3cb14..ea72e630 100644 --- a/internal/e2e/fixtures/mysql/down/4.sql +++ b/internal/e2e/fixtures/mysql/down/4.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.27, for macos12.0 (arm64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ --- Server version 5.7.31 +-- Server version 5.7.36 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -31,7 +31,7 @@ CREATE TABLE `e2e_user_notes` ( UNIQUE KEY `e2e_user_notes_slug_idx` (`slug`), KEY `e2e_user_notes_user_id_idx` (`user_id`), CONSTRAINT `e2e_user_notes_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `e2e_users` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -47,7 +47,7 @@ CREATE TABLE `e2e_users` ( `updated_at` datetime NOT NULL, `username` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -60,7 +60,7 @@ DROP TABLE IF EXISTS `schema_migration`; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -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-09-03 11:40:20 +-- Dump completed on 2021-12-03 10:52:20 diff --git a/internal/e2e/fixtures/mysql/down/5.sql b/internal/e2e/fixtures/mysql/down/5.sql index 13a3cb14..ea72e630 100644 --- a/internal/e2e/fixtures/mysql/down/5.sql +++ b/internal/e2e/fixtures/mysql/down/5.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.27, for macos12.0 (arm64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ --- Server version 5.7.31 +-- Server version 5.7.36 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -31,7 +31,7 @@ CREATE TABLE `e2e_user_notes` ( UNIQUE KEY `e2e_user_notes_slug_idx` (`slug`), KEY `e2e_user_notes_user_id_idx` (`user_id`), CONSTRAINT `e2e_user_notes_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `e2e_users` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -47,7 +47,7 @@ CREATE TABLE `e2e_users` ( `updated_at` datetime NOT NULL, `username` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -60,7 +60,7 @@ DROP TABLE IF EXISTS `schema_migration`; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -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-09-03 11:40:20 +-- Dump completed on 2021-12-03 10:52:20 diff --git a/internal/e2e/fixtures/mysql/down/6.sql b/internal/e2e/fixtures/mysql/down/6.sql index 13a3cb14..ea72e630 100644 --- a/internal/e2e/fixtures/mysql/down/6.sql +++ b/internal/e2e/fixtures/mysql/down/6.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.27, for macos12.0 (arm64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ --- Server version 5.7.31 +-- Server version 5.7.36 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -31,7 +31,7 @@ CREATE TABLE `e2e_user_notes` ( UNIQUE KEY `e2e_user_notes_slug_idx` (`slug`), KEY `e2e_user_notes_user_id_idx` (`user_id`), CONSTRAINT `e2e_user_notes_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `e2e_users` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -47,7 +47,7 @@ CREATE TABLE `e2e_users` ( `updated_at` datetime NOT NULL, `username` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -60,7 +60,7 @@ DROP TABLE IF EXISTS `schema_migration`; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -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-09-03 11:40:20 +-- Dump completed on 2021-12-03 10:52:20 diff --git a/internal/e2e/fixtures/mysql/down/7.sql b/internal/e2e/fixtures/mysql/down/7.sql index 3e9364df..19adb66c 100644 --- a/internal/e2e/fixtures/mysql/down/7.sql +++ b/internal/e2e/fixtures/mysql/down/7.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.27, for macos12.0 (arm64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ --- Server version 5.7.31 +-- Server version 5.7.36 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -31,7 +31,7 @@ CREATE TABLE `e2e_user_posts` ( UNIQUE KEY `e2e_user_notes_slug_idx` (`slug`), KEY `e2e_user_notes_user_id_idx` (`user_id`), CONSTRAINT `e2e_user_posts_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `e2e_users` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -47,7 +47,7 @@ CREATE TABLE `e2e_users` ( `updated_at` datetime NOT NULL, `username` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -60,7 +60,7 @@ DROP TABLE IF EXISTS `schema_migration`; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -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-09-03 11:40:19 +-- Dump completed on 2021-12-03 10:52:20 diff --git a/internal/e2e/fixtures/mysql/down/8.sql b/internal/e2e/fixtures/mysql/down/8.sql index e5fde8cf..b7b8cf77 100644 --- a/internal/e2e/fixtures/mysql/down/8.sql +++ b/internal/e2e/fixtures/mysql/down/8.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.27, for macos12.0 (arm64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ --- Server version 5.7.31 +-- Server version 5.7.36 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -31,7 +31,7 @@ CREATE TABLE `e2e_user_posts` ( UNIQUE KEY `e2e_user_notes_slug_idx` (`slug`), KEY `e2e_user_notes_user_id_idx` (`user_id`), CONSTRAINT `e2e_user_posts_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `e2e_users` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -47,7 +47,7 @@ CREATE TABLE `e2e_users` ( `updated_at` datetime NOT NULL, `username` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -60,7 +60,7 @@ DROP TABLE IF EXISTS `schema_migration`; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -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-09-03 11:40:19 +-- Dump completed on 2021-12-03 10:52:19 diff --git a/internal/e2e/fixtures/mysql/down/9.sql b/internal/e2e/fixtures/mysql/down/9.sql index 01662983..e37596bc 100644 --- a/internal/e2e/fixtures/mysql/down/9.sql +++ b/internal/e2e/fixtures/mysql/down/9.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.27, for macos12.0 (arm64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ --- Server version 5.7.31 +-- Server version 5.7.36 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -31,7 +31,7 @@ CREATE TABLE `e2e_user_posts` ( UNIQUE KEY `e2e_user_notes_slug_idx` (`slug`), KEY `e2e_user_notes_user_id_idx` (`user_id`), CONSTRAINT `e2e_user_posts_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `e2e_users` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -47,7 +47,7 @@ CREATE TABLE `e2e_users` ( `updated_at` datetime NOT NULL, `name` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -60,7 +60,7 @@ DROP TABLE IF EXISTS `schema_migration`; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -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-09-03 11:40:19 +-- Dump completed on 2021-12-03 10:52:19 diff --git a/internal/e2e/fixtures/mysql/up/0.sql b/internal/e2e/fixtures/mysql/up/0.sql index 41b83d43..609940e3 100644 --- a/internal/e2e/fixtures/mysql/up/0.sql +++ b/internal/e2e/fixtures/mysql/up/0.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.27, for macos12.0 (arm64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ --- Server version 5.7.31 +-- Server version 5.7.36 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -28,7 +28,7 @@ CREATE TABLE `e2e_users` ( `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -41,7 +41,7 @@ DROP TABLE IF EXISTS `schema_migration`; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -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-09-03 11:40:11 +-- Dump completed on 2021-12-03 10:52:11 diff --git a/internal/e2e/fixtures/mysql/up/1.sql b/internal/e2e/fixtures/mysql/up/1.sql index f57f5f90..834ce710 100644 --- a/internal/e2e/fixtures/mysql/up/1.sql +++ b/internal/e2e/fixtures/mysql/up/1.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.27, for macos12.0 (arm64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ --- Server version 5.7.31 +-- Server version 5.7.36 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -31,7 +31,7 @@ CREATE TABLE `e2e_user_notes` ( KEY `e2e_user_notes_user_id_idx` (`user_id`), KEY `e2e_user_notes_title_idx` (`title`), CONSTRAINT `e2e_user_notes_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `e2e_users` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -47,7 +47,7 @@ CREATE TABLE `e2e_users` ( `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -60,7 +60,7 @@ DROP TABLE IF EXISTS `schema_migration`; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -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-09-03 11:40:11 +-- Dump completed on 2021-12-03 10:52:11 diff --git a/internal/e2e/fixtures/mysql/up/10.sql b/internal/e2e/fixtures/mysql/up/10.sql index 93603ddc..09c86bf5 100644 --- a/internal/e2e/fixtures/mysql/up/10.sql +++ b/internal/e2e/fixtures/mysql/up/10.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.27, for macos12.0 (arm64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ --- Server version 5.7.31 +-- Server version 5.7.36 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -31,7 +31,7 @@ CREATE TABLE `e2e_user_posts` ( UNIQUE KEY `e2e_user_notes_slug_idx` (`slug`), KEY `e2e_user_notes_user_id_idx` (`user_id`), CONSTRAINT `e2e_user_posts_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `e2e_users` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -46,7 +46,7 @@ CREATE TABLE `e2e_users` ( `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -59,7 +59,7 @@ DROP TABLE IF EXISTS `schema_migration`; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -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-09-03 11:40:14 +-- Dump completed on 2021-12-03 10:52:14 diff --git a/internal/e2e/fixtures/mysql/up/11.sql b/internal/e2e/fixtures/mysql/up/11.sql index ababca56..4221f908 100644 --- a/internal/e2e/fixtures/mysql/up/11.sql +++ b/internal/e2e/fixtures/mysql/up/11.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.27, for macos12.0 (arm64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ --- Server version 5.7.31 +-- Server version 5.7.36 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -27,7 +27,7 @@ CREATE TABLE `e2e_authors` ( `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -46,7 +46,7 @@ CREATE TABLE `e2e_user_posts` ( UNIQUE KEY `e2e_user_notes_slug_idx` (`slug`), KEY `e2e_user_notes_user_id_idx` (`user_id`), CONSTRAINT `e2e_user_posts_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `e2e_authors` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -59,7 +59,7 @@ DROP TABLE IF EXISTS `schema_migration`; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -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-09-03 11:40:14 +-- Dump completed on 2021-12-03 10:52:14 diff --git a/internal/e2e/fixtures/mysql/up/12.sql b/internal/e2e/fixtures/mysql/up/12.sql index 38006379..3a3cb4f8 100644 --- a/internal/e2e/fixtures/mysql/up/12.sql +++ b/internal/e2e/fixtures/mysql/up/12.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.27, for macos12.0 (arm64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ --- Server version 5.7.31 +-- Server version 5.7.36 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -27,7 +27,7 @@ CREATE TABLE `e2e_authors` ( `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -46,7 +46,7 @@ CREATE TABLE `e2e_user_posts` ( 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; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -59,7 +59,7 @@ DROP TABLE IF EXISTS `schema_migration`; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -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-09-03 11:40:15 +-- Dump completed on 2021-12-03 10:52:14 diff --git a/internal/e2e/fixtures/mysql/up/13.sql b/internal/e2e/fixtures/mysql/up/13.sql index 1b2b8ccd..d28ccc89 100644 --- a/internal/e2e/fixtures/mysql/up/13.sql +++ b/internal/e2e/fixtures/mysql/up/13.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.27, for macos12.0 (arm64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ --- Server version 5.7.31 +-- Server version 5.7.36 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -27,7 +27,7 @@ CREATE TABLE `e2e_authors` ( `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -47,7 +47,7 @@ CREATE TABLE `e2e_user_posts` ( 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; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -60,7 +60,7 @@ DROP TABLE IF EXISTS `schema_migration`; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -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-09-03 11:40:15 +-- Dump completed on 2021-12-03 10:52:15 diff --git a/internal/e2e/fixtures/mysql/up/14.sql b/internal/e2e/fixtures/mysql/up/14.sql index 76e0039b..c1da9916 100644 --- a/internal/e2e/fixtures/mysql/up/14.sql +++ b/internal/e2e/fixtures/mysql/up/14.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.27, for macos12.0 (arm64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ --- Server version 5.7.31 +-- Server version 5.7.36 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -25,7 +25,7 @@ DROP TABLE IF EXISTS `e2e_address`; CREATE TABLE `e2e_address` ( `id` char(36) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -40,7 +40,7 @@ CREATE TABLE `e2e_authors` ( `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -53,7 +53,7 @@ DROP TABLE IF EXISTS `e2e_flow`; CREATE TABLE `e2e_flow` ( `id` char(36) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -75,7 +75,7 @@ CREATE TABLE `e2e_token` ( 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; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -95,7 +95,7 @@ CREATE TABLE `e2e_user_posts` ( 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; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -108,7 +108,7 @@ DROP TABLE IF EXISTS `schema_migration`; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -120,4 +120,4 @@ CREATE TABLE `schema_migration` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-09-03 11:40:16 +-- Dump completed on 2021-12-03 10:52:15 diff --git a/internal/e2e/fixtures/mysql/up/15.sql b/internal/e2e/fixtures/mysql/up/15.sql index 7b441e25..2c097403 100644 --- a/internal/e2e/fixtures/mysql/up/15.sql +++ b/internal/e2e/fixtures/mysql/up/15.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.27, for macos12.0 (arm64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ --- Server version 5.7.31 +-- Server version 5.7.36 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -25,7 +25,7 @@ DROP TABLE IF EXISTS `e2e_address`; CREATE TABLE `e2e_address` ( `id` char(36) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -40,7 +40,7 @@ CREATE TABLE `e2e_authors` ( `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -53,7 +53,7 @@ DROP TABLE IF EXISTS `e2e_flow`; CREATE TABLE `e2e_flow` ( `id` char(36) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -77,7 +77,7 @@ CREATE TABLE `e2e_token` ( 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; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -97,7 +97,7 @@ CREATE TABLE `e2e_user_posts` ( 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; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -110,7 +110,7 @@ DROP TABLE IF EXISTS `schema_migration`; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -122,4 +122,4 @@ CREATE TABLE `schema_migration` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-09-03 11:40:16 +-- Dump completed on 2021-12-03 10:52:16 diff --git a/internal/e2e/fixtures/mysql/up/16.sql b/internal/e2e/fixtures/mysql/up/16.sql new file mode 100644 index 00000000..800d2e20 --- /dev/null +++ b/internal/e2e/fixtures/mysql/up/16.sql @@ -0,0 +1,128 @@ +-- MySQL dump 10.13 Distrib 8.0.27, for macos12.0 (arm64) +-- +-- Host: 127.0.0.1 Database: pop_test +-- ------------------------------------------------------ +-- Server version 5.7.36 + +/*!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=latin1; +/*!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=latin1; +/*!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=latin1; +/*!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 '2001-01-01 00:00:00', + `issued_at` datetime NOT NULL DEFAULT '2000-01-01 00:00:00', + `flow_id` char(36) DEFAULT 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`), + KEY `e2e_token_flow_id_fk` (`flow_id`), + CONSTRAINT `e2e_token_flow_id_fk` FOREIGN KEY (`flow_id`) REFERENCES `e2e_flow` (`id`) ON UPDATE NO ACTION, + 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=latin1; +/*!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=latin1; +/*!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=latin1; +/*!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 2021-12-03 10:52:16 diff --git a/internal/e2e/fixtures/mysql/up/2.sql b/internal/e2e/fixtures/mysql/up/2.sql index 0d92cf59..4a623c63 100644 --- a/internal/e2e/fixtures/mysql/up/2.sql +++ b/internal/e2e/fixtures/mysql/up/2.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.27, for macos12.0 (arm64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ --- Server version 5.7.31 +-- Server version 5.7.36 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -29,7 +29,7 @@ CREATE TABLE `e2e_user_notes` ( PRIMARY KEY (`id`), KEY `e2e_user_notes_user_id_idx` (`user_id`), CONSTRAINT `e2e_user_notes_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `e2e_users` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -45,7 +45,7 @@ CREATE TABLE `e2e_users` ( `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -58,7 +58,7 @@ DROP TABLE IF EXISTS `schema_migration`; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -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-09-03 11:40:11 +-- Dump completed on 2021-12-03 10:52:12 diff --git a/internal/e2e/fixtures/mysql/up/3.sql b/internal/e2e/fixtures/mysql/up/3.sql index e82698f0..d4c02421 100644 --- a/internal/e2e/fixtures/mysql/up/3.sql +++ b/internal/e2e/fixtures/mysql/up/3.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.27, for macos12.0 (arm64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ --- Server version 5.7.31 +-- Server version 5.7.36 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -30,7 +30,7 @@ CREATE TABLE `e2e_user_notes` ( PRIMARY KEY (`id`), KEY `e2e_user_notes_user_id_idx` (`user_id`), CONSTRAINT `e2e_user_notes_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `e2e_users` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -46,7 +46,7 @@ CREATE TABLE `e2e_users` ( `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -59,7 +59,7 @@ DROP TABLE IF EXISTS `schema_migration`; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -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-09-03 11:40:12 +-- Dump completed on 2021-12-03 10:52:12 diff --git a/internal/e2e/fixtures/mysql/up/4.sql b/internal/e2e/fixtures/mysql/up/4.sql index e82698f0..d4c02421 100644 --- a/internal/e2e/fixtures/mysql/up/4.sql +++ b/internal/e2e/fixtures/mysql/up/4.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.27, for macos12.0 (arm64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ --- Server version 5.7.31 +-- Server version 5.7.36 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -30,7 +30,7 @@ CREATE TABLE `e2e_user_notes` ( PRIMARY KEY (`id`), KEY `e2e_user_notes_user_id_idx` (`user_id`), CONSTRAINT `e2e_user_notes_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `e2e_users` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -46,7 +46,7 @@ CREATE TABLE `e2e_users` ( `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -59,7 +59,7 @@ DROP TABLE IF EXISTS `schema_migration`; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -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-09-03 11:40:12 +-- Dump completed on 2021-12-03 10:52:12 diff --git a/internal/e2e/fixtures/mysql/up/5.sql b/internal/e2e/fixtures/mysql/up/5.sql index d6c80c39..2ed3f003 100644 --- a/internal/e2e/fixtures/mysql/up/5.sql +++ b/internal/e2e/fixtures/mysql/up/5.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.27, for macos12.0 (arm64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ --- Server version 5.7.31 +-- Server version 5.7.36 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -31,7 +31,7 @@ CREATE TABLE `e2e_user_notes` ( UNIQUE KEY `e2e_user_notes_slug_idx` (`slug`), KEY `e2e_user_notes_user_id_idx` (`user_id`), CONSTRAINT `e2e_user_notes_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `e2e_users` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -47,7 +47,7 @@ CREATE TABLE `e2e_users` ( `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -60,7 +60,7 @@ DROP TABLE IF EXISTS `schema_migration`; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -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-09-03 11:40:12 +-- Dump completed on 2021-12-03 10:52:12 diff --git a/internal/e2e/fixtures/mysql/up/6.sql b/internal/e2e/fixtures/mysql/up/6.sql index b541bc2a..d6be95b9 100644 --- a/internal/e2e/fixtures/mysql/up/6.sql +++ b/internal/e2e/fixtures/mysql/up/6.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.27, for macos12.0 (arm64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ --- Server version 5.7.31 +-- Server version 5.7.36 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -31,7 +31,7 @@ CREATE TABLE `e2e_user_posts` ( UNIQUE KEY `e2e_user_notes_slug_idx` (`slug`), KEY `e2e_user_notes_user_id_idx` (`user_id`), CONSTRAINT `e2e_user_posts_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `e2e_users` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -47,7 +47,7 @@ CREATE TABLE `e2e_users` ( `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -60,7 +60,7 @@ DROP TABLE IF EXISTS `schema_migration`; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -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-09-03 11:40:12 +-- Dump completed on 2021-12-03 10:52:13 diff --git a/internal/e2e/fixtures/mysql/up/7.sql b/internal/e2e/fixtures/mysql/up/7.sql index 578e2541..fb608992 100644 --- a/internal/e2e/fixtures/mysql/up/7.sql +++ b/internal/e2e/fixtures/mysql/up/7.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.27, for macos12.0 (arm64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ --- Server version 5.7.31 +-- Server version 5.7.36 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -31,7 +31,7 @@ CREATE TABLE `e2e_user_posts` ( UNIQUE KEY `e2e_user_notes_slug_idx` (`slug`), KEY `e2e_user_notes_user_id_idx` (`user_id`), CONSTRAINT `e2e_user_posts_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `e2e_users` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -47,7 +47,7 @@ CREATE TABLE `e2e_users` ( `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -60,7 +60,7 @@ DROP TABLE IF EXISTS `schema_migration`; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -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-09-03 11:40:13 +-- Dump completed on 2021-12-03 10:52:13 diff --git a/internal/e2e/fixtures/mysql/up/8.sql b/internal/e2e/fixtures/mysql/up/8.sql index 47b40e4f..0fbeddf3 100644 --- a/internal/e2e/fixtures/mysql/up/8.sql +++ b/internal/e2e/fixtures/mysql/up/8.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.27, for macos12.0 (arm64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ --- Server version 5.7.31 +-- Server version 5.7.36 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -31,7 +31,7 @@ CREATE TABLE `e2e_user_posts` ( UNIQUE KEY `e2e_user_notes_slug_idx` (`slug`), KEY `e2e_user_notes_user_id_idx` (`user_id`), CONSTRAINT `e2e_user_posts_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `e2e_users` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -47,7 +47,7 @@ CREATE TABLE `e2e_users` ( `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -60,7 +60,7 @@ DROP TABLE IF EXISTS `schema_migration`; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -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-09-03 11:40:13 +-- Dump completed on 2021-12-03 10:52:13 diff --git a/internal/e2e/fixtures/mysql/up/9.sql b/internal/e2e/fixtures/mysql/up/9.sql index dc17ceb0..ddad1754 100644 --- a/internal/e2e/fixtures/mysql/up/9.sql +++ b/internal/e2e/fixtures/mysql/up/9.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) +-- MySQL dump 10.13 Distrib 8.0.27, for macos12.0 (arm64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ --- Server version 5.7.31 +-- Server version 5.7.36 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -31,7 +31,7 @@ CREATE TABLE `e2e_user_posts` ( UNIQUE KEY `e2e_user_notes_slug_idx` (`slug`), KEY `e2e_user_notes_user_id_idx` (`user_id`), CONSTRAINT `e2e_user_posts_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `e2e_users` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -46,7 +46,7 @@ CREATE TABLE `e2e_users` ( `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -59,7 +59,7 @@ DROP TABLE IF EXISTS `schema_migration`; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -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-09-03 11:40:13 +-- Dump completed on 2021-12-03 10:52:13 diff --git a/internal/e2e/fixtures/postgres/down/0.sql b/internal/e2e/fixtures/postgres/down/0.sql index 4bb26193..fe136f21 100644 --- a/internal/e2e/fixtures/postgres/down/0.sql +++ b/internal/e2e/fixtures/postgres/down/0.sql @@ -2,8 +2,8 @@ -- PostgreSQL database dump -- --- Dumped from database version 9.6.19 --- Dumped by pg_dump version 12.4 +-- Dumped from database version 10.19 (Debian 10.19-1.pgdg90+1) +-- Dumped by pg_dump version 14.1 SET statement_timeout = 0; SET lock_timeout = 0; diff --git a/internal/e2e/fixtures/postgres/down/1.sql b/internal/e2e/fixtures/postgres/down/1.sql index 3536360f..de46823c 100644 --- a/internal/e2e/fixtures/postgres/down/1.sql +++ b/internal/e2e/fixtures/postgres/down/1.sql @@ -2,8 +2,8 @@ -- PostgreSQL database dump -- --- Dumped from database version 9.6.19 --- Dumped by pg_dump version 12.4 +-- Dumped from database version 10.19 (Debian 10.19-1.pgdg90+1) +-- Dumped by pg_dump version 14.1 SET statement_timeout = 0; SET lock_timeout = 0; diff --git a/internal/e2e/fixtures/postgres/down/10.sql b/internal/e2e/fixtures/postgres/down/10.sql index 013b24e3..00b5166f 100644 --- a/internal/e2e/fixtures/postgres/down/10.sql +++ b/internal/e2e/fixtures/postgres/down/10.sql @@ -2,8 +2,8 @@ -- PostgreSQL database dump -- --- Dumped from database version 9.6.19 --- Dumped by pg_dump version 12.4 +-- Dumped from database version 10.19 (Debian 10.19-1.pgdg90+1) +-- Dumped by pg_dump version 14.1 SET statement_timeout = 0; SET lock_timeout = 0; diff --git a/internal/e2e/fixtures/postgres/down/11.sql b/internal/e2e/fixtures/postgres/down/11.sql index b8dbc7a9..0cf97e32 100644 --- a/internal/e2e/fixtures/postgres/down/11.sql +++ b/internal/e2e/fixtures/postgres/down/11.sql @@ -2,8 +2,8 @@ -- PostgreSQL database dump -- --- Dumped from database version 9.6.19 --- Dumped by pg_dump version 12.4 +-- Dumped from database version 10.19 (Debian 10.19-1.pgdg90+1) +-- Dumped by pg_dump version 14.1 SET statement_timeout = 0; SET lock_timeout = 0; diff --git a/internal/e2e/fixtures/postgres/down/12.sql b/internal/e2e/fixtures/postgres/down/12.sql index 35036c46..63e95071 100644 --- a/internal/e2e/fixtures/postgres/down/12.sql +++ b/internal/e2e/fixtures/postgres/down/12.sql @@ -2,8 +2,8 @@ -- PostgreSQL database dump -- --- Dumped from database version 9.6.19 --- Dumped by pg_dump version 12.4 +-- Dumped from database version 10.19 (Debian 10.19-1.pgdg90+1) +-- Dumped by pg_dump version 14.1 SET statement_timeout = 0; SET lock_timeout = 0; diff --git a/internal/e2e/fixtures/postgres/down/13.sql b/internal/e2e/fixtures/postgres/down/13.sql index 4b6fe46e..8005e62b 100644 --- a/internal/e2e/fixtures/postgres/down/13.sql +++ b/internal/e2e/fixtures/postgres/down/13.sql @@ -2,8 +2,8 @@ -- PostgreSQL database dump -- --- Dumped from database version 9.6.19 --- Dumped by pg_dump version 12.4 +-- Dumped from database version 10.19 (Debian 10.19-1.pgdg90+1) +-- Dumped by pg_dump version 14.1 SET statement_timeout = 0; SET lock_timeout = 0; diff --git a/internal/e2e/fixtures/postgres/down/14.sql b/internal/e2e/fixtures/postgres/down/14.sql index 186c9ddf..9426da31 100644 --- a/internal/e2e/fixtures/postgres/down/14.sql +++ b/internal/e2e/fixtures/postgres/down/14.sql @@ -2,8 +2,8 @@ -- PostgreSQL database dump -- --- Dumped from database version 9.6.19 --- Dumped by pg_dump version 12.4 +-- Dumped from database version 10.19 (Debian 10.19-1.pgdg90+1) +-- Dumped by pg_dump version 14.1 SET statement_timeout = 0; SET lock_timeout = 0; diff --git a/internal/e2e/fixtures/postgres/down/15.sql b/internal/e2e/fixtures/postgres/down/15.sql index 3184199f..b5474a62 100644 --- a/internal/e2e/fixtures/postgres/down/15.sql +++ b/internal/e2e/fixtures/postgres/down/15.sql @@ -2,8 +2,8 @@ -- PostgreSQL database dump -- --- Dumped from database version 9.6.19 --- Dumped by pg_dump version 12.4 +-- Dumped from database version 10.19 (Debian 10.19-1.pgdg90+1) +-- Dumped by pg_dump version 14.1 SET statement_timeout = 0; SET lock_timeout = 0; diff --git a/internal/e2e/fixtures/postgres/down/16.sql b/internal/e2e/fixtures/postgres/down/16.sql new file mode 100644 index 00000000..7ba446d2 --- /dev/null +++ b/internal/e2e/fixtures/postgres/down/16.sql @@ -0,0 +1,200 @@ +-- +-- PostgreSQL database dump +-- + +-- Dumped from database version 10.19 (Debian 10.19-1.pgdg90+1) +-- Dumped by pg_dump version 14.1 + +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/postgres/down/2.sql b/internal/e2e/fixtures/postgres/down/2.sql index 95c59a8d..b20db2f4 100644 --- a/internal/e2e/fixtures/postgres/down/2.sql +++ b/internal/e2e/fixtures/postgres/down/2.sql @@ -2,8 +2,8 @@ -- PostgreSQL database dump -- --- Dumped from database version 9.6.19 --- Dumped by pg_dump version 12.4 +-- Dumped from database version 10.19 (Debian 10.19-1.pgdg90+1) +-- Dumped by pg_dump version 14.1 SET statement_timeout = 0; SET lock_timeout = 0; diff --git a/internal/e2e/fixtures/postgres/down/3.sql b/internal/e2e/fixtures/postgres/down/3.sql index ea80a8e3..f6dab6d4 100644 --- a/internal/e2e/fixtures/postgres/down/3.sql +++ b/internal/e2e/fixtures/postgres/down/3.sql @@ -2,8 +2,8 @@ -- PostgreSQL database dump -- --- Dumped from database version 9.6.19 --- Dumped by pg_dump version 12.4 +-- Dumped from database version 10.19 (Debian 10.19-1.pgdg90+1) +-- Dumped by pg_dump version 14.1 SET statement_timeout = 0; SET lock_timeout = 0; diff --git a/internal/e2e/fixtures/postgres/down/4.sql b/internal/e2e/fixtures/postgres/down/4.sql index bdb95120..b6fc38a0 100644 --- a/internal/e2e/fixtures/postgres/down/4.sql +++ b/internal/e2e/fixtures/postgres/down/4.sql @@ -2,8 +2,8 @@ -- PostgreSQL database dump -- --- Dumped from database version 9.6.19 --- Dumped by pg_dump version 12.4 +-- Dumped from database version 10.19 (Debian 10.19-1.pgdg90+1) +-- Dumped by pg_dump version 14.1 SET statement_timeout = 0; SET lock_timeout = 0; diff --git a/internal/e2e/fixtures/postgres/down/5.sql b/internal/e2e/fixtures/postgres/down/5.sql index bdb95120..b6fc38a0 100644 --- a/internal/e2e/fixtures/postgres/down/5.sql +++ b/internal/e2e/fixtures/postgres/down/5.sql @@ -2,8 +2,8 @@ -- PostgreSQL database dump -- --- Dumped from database version 9.6.19 --- Dumped by pg_dump version 12.4 +-- Dumped from database version 10.19 (Debian 10.19-1.pgdg90+1) +-- Dumped by pg_dump version 14.1 SET statement_timeout = 0; SET lock_timeout = 0; diff --git a/internal/e2e/fixtures/postgres/down/6.sql b/internal/e2e/fixtures/postgres/down/6.sql index bdb95120..b6fc38a0 100644 --- a/internal/e2e/fixtures/postgres/down/6.sql +++ b/internal/e2e/fixtures/postgres/down/6.sql @@ -2,8 +2,8 @@ -- PostgreSQL database dump -- --- Dumped from database version 9.6.19 --- Dumped by pg_dump version 12.4 +-- Dumped from database version 10.19 (Debian 10.19-1.pgdg90+1) +-- Dumped by pg_dump version 14.1 SET statement_timeout = 0; SET lock_timeout = 0; diff --git a/internal/e2e/fixtures/postgres/down/7.sql b/internal/e2e/fixtures/postgres/down/7.sql index 5632aa96..cad91541 100644 --- a/internal/e2e/fixtures/postgres/down/7.sql +++ b/internal/e2e/fixtures/postgres/down/7.sql @@ -2,8 +2,8 @@ -- PostgreSQL database dump -- --- Dumped from database version 9.6.19 --- Dumped by pg_dump version 12.4 +-- Dumped from database version 10.19 (Debian 10.19-1.pgdg90+1) +-- Dumped by pg_dump version 14.1 SET statement_timeout = 0; SET lock_timeout = 0; diff --git a/internal/e2e/fixtures/postgres/down/8.sql b/internal/e2e/fixtures/postgres/down/8.sql index e13e666a..acbc6fa7 100644 --- a/internal/e2e/fixtures/postgres/down/8.sql +++ b/internal/e2e/fixtures/postgres/down/8.sql @@ -2,8 +2,8 @@ -- PostgreSQL database dump -- --- Dumped from database version 9.6.19 --- Dumped by pg_dump version 12.4 +-- Dumped from database version 10.19 (Debian 10.19-1.pgdg90+1) +-- Dumped by pg_dump version 14.1 SET statement_timeout = 0; SET lock_timeout = 0; diff --git a/internal/e2e/fixtures/postgres/down/9.sql b/internal/e2e/fixtures/postgres/down/9.sql index 3055d073..9882e3f8 100644 --- a/internal/e2e/fixtures/postgres/down/9.sql +++ b/internal/e2e/fixtures/postgres/down/9.sql @@ -2,8 +2,8 @@ -- PostgreSQL database dump -- --- Dumped from database version 9.6.19 --- Dumped by pg_dump version 12.4 +-- Dumped from database version 10.19 (Debian 10.19-1.pgdg90+1) +-- Dumped by pg_dump version 14.1 SET statement_timeout = 0; SET lock_timeout = 0; diff --git a/internal/e2e/fixtures/postgres/up/0.sql b/internal/e2e/fixtures/postgres/up/0.sql index 3222989b..1278a3e3 100644 --- a/internal/e2e/fixtures/postgres/up/0.sql +++ b/internal/e2e/fixtures/postgres/up/0.sql @@ -2,8 +2,8 @@ -- PostgreSQL database dump -- --- Dumped from database version 9.6.19 --- Dumped by pg_dump version 12.4 +-- Dumped from database version 10.19 (Debian 10.19-1.pgdg90+1) +-- Dumped by pg_dump version 14.1 SET statement_timeout = 0; SET lock_timeout = 0; diff --git a/internal/e2e/fixtures/postgres/up/1.sql b/internal/e2e/fixtures/postgres/up/1.sql index 15a7f6fa..81a6014b 100644 --- a/internal/e2e/fixtures/postgres/up/1.sql +++ b/internal/e2e/fixtures/postgres/up/1.sql @@ -2,8 +2,8 @@ -- PostgreSQL database dump -- --- Dumped from database version 9.6.19 --- Dumped by pg_dump version 12.4 +-- Dumped from database version 10.19 (Debian 10.19-1.pgdg90+1) +-- Dumped by pg_dump version 14.1 SET statement_timeout = 0; SET lock_timeout = 0; diff --git a/internal/e2e/fixtures/postgres/up/10.sql b/internal/e2e/fixtures/postgres/up/10.sql index b8dbc7a9..0cf97e32 100644 --- a/internal/e2e/fixtures/postgres/up/10.sql +++ b/internal/e2e/fixtures/postgres/up/10.sql @@ -2,8 +2,8 @@ -- PostgreSQL database dump -- --- Dumped from database version 9.6.19 --- Dumped by pg_dump version 12.4 +-- Dumped from database version 10.19 (Debian 10.19-1.pgdg90+1) +-- Dumped by pg_dump version 14.1 SET statement_timeout = 0; SET lock_timeout = 0; diff --git a/internal/e2e/fixtures/postgres/up/11.sql b/internal/e2e/fixtures/postgres/up/11.sql index 35036c46..63e95071 100644 --- a/internal/e2e/fixtures/postgres/up/11.sql +++ b/internal/e2e/fixtures/postgres/up/11.sql @@ -2,8 +2,8 @@ -- PostgreSQL database dump -- --- Dumped from database version 9.6.19 --- Dumped by pg_dump version 12.4 +-- Dumped from database version 10.19 (Debian 10.19-1.pgdg90+1) +-- Dumped by pg_dump version 14.1 SET statement_timeout = 0; SET lock_timeout = 0; diff --git a/internal/e2e/fixtures/postgres/up/12.sql b/internal/e2e/fixtures/postgres/up/12.sql index 4b6fe46e..8005e62b 100644 --- a/internal/e2e/fixtures/postgres/up/12.sql +++ b/internal/e2e/fixtures/postgres/up/12.sql @@ -2,8 +2,8 @@ -- PostgreSQL database dump -- --- Dumped from database version 9.6.19 --- Dumped by pg_dump version 12.4 +-- Dumped from database version 10.19 (Debian 10.19-1.pgdg90+1) +-- Dumped by pg_dump version 14.1 SET statement_timeout = 0; SET lock_timeout = 0; diff --git a/internal/e2e/fixtures/postgres/up/13.sql b/internal/e2e/fixtures/postgres/up/13.sql index 186c9ddf..9426da31 100644 --- a/internal/e2e/fixtures/postgres/up/13.sql +++ b/internal/e2e/fixtures/postgres/up/13.sql @@ -2,8 +2,8 @@ -- PostgreSQL database dump -- --- Dumped from database version 9.6.19 --- Dumped by pg_dump version 12.4 +-- Dumped from database version 10.19 (Debian 10.19-1.pgdg90+1) +-- Dumped by pg_dump version 14.1 SET statement_timeout = 0; SET lock_timeout = 0; diff --git a/internal/e2e/fixtures/postgres/up/14.sql b/internal/e2e/fixtures/postgres/up/14.sql index 5dcc6ea3..db2a35de 100644 --- a/internal/e2e/fixtures/postgres/up/14.sql +++ b/internal/e2e/fixtures/postgres/up/14.sql @@ -2,8 +2,8 @@ -- PostgreSQL database dump -- --- Dumped from database version 9.6.19 --- Dumped by pg_dump version 12.4 +-- Dumped from database version 10.19 (Debian 10.19-1.pgdg90+1) +-- Dumped by pg_dump version 14.1 SET statement_timeout = 0; SET lock_timeout = 0; diff --git a/internal/e2e/fixtures/postgres/up/15.sql b/internal/e2e/fixtures/postgres/up/15.sql index 42000937..7ba446d2 100644 --- a/internal/e2e/fixtures/postgres/up/15.sql +++ b/internal/e2e/fixtures/postgres/up/15.sql @@ -2,8 +2,8 @@ -- PostgreSQL database dump -- --- Dumped from database version 9.6.19 --- Dumped by pg_dump version 12.4 +-- Dumped from database version 10.19 (Debian 10.19-1.pgdg90+1) +-- Dumped by pg_dump version 14.1 SET statement_timeout = 0; SET lock_timeout = 0; diff --git a/internal/e2e/fixtures/postgres/up/16.sql b/internal/e2e/fixtures/postgres/up/16.sql new file mode 100644 index 00000000..b8415aaa --- /dev/null +++ b/internal/e2e/fixtures/postgres/up/16.sql @@ -0,0 +1,209 @@ +-- +-- PostgreSQL database dump +-- + +-- Dumped from database version 10.19 (Debian 10.19-1.pgdg90+1) +-- Dumped by pg_dump version 14.1 + +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 '2001-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, + flow_id uuid +); + + +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_token e2e_token_flow_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.e2e_token + ADD CONSTRAINT e2e_token_flow_id_fk FOREIGN KEY (flow_id) REFERENCES public.e2e_flow(id) ON DELETE RESTRICT; + + +-- +-- 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/2.sql b/internal/e2e/fixtures/postgres/up/2.sql index ec5a91af..464175d4 100644 --- a/internal/e2e/fixtures/postgres/up/2.sql +++ b/internal/e2e/fixtures/postgres/up/2.sql @@ -2,8 +2,8 @@ -- PostgreSQL database dump -- --- Dumped from database version 9.6.19 --- Dumped by pg_dump version 12.4 +-- Dumped from database version 10.19 (Debian 10.19-1.pgdg90+1) +-- Dumped by pg_dump version 14.1 SET statement_timeout = 0; SET lock_timeout = 0; diff --git a/internal/e2e/fixtures/postgres/up/3.sql b/internal/e2e/fixtures/postgres/up/3.sql index e7231d8b..cdfbe39a 100644 --- a/internal/e2e/fixtures/postgres/up/3.sql +++ b/internal/e2e/fixtures/postgres/up/3.sql @@ -2,8 +2,8 @@ -- PostgreSQL database dump -- --- Dumped from database version 9.6.19 --- Dumped by pg_dump version 12.4 +-- Dumped from database version 10.19 (Debian 10.19-1.pgdg90+1) +-- Dumped by pg_dump version 14.1 SET statement_timeout = 0; SET lock_timeout = 0; diff --git a/internal/e2e/fixtures/postgres/up/4.sql b/internal/e2e/fixtures/postgres/up/4.sql index e7231d8b..cdfbe39a 100644 --- a/internal/e2e/fixtures/postgres/up/4.sql +++ b/internal/e2e/fixtures/postgres/up/4.sql @@ -2,8 +2,8 @@ -- PostgreSQL database dump -- --- Dumped from database version 9.6.19 --- Dumped by pg_dump version 12.4 +-- Dumped from database version 10.19 (Debian 10.19-1.pgdg90+1) +-- Dumped by pg_dump version 14.1 SET statement_timeout = 0; SET lock_timeout = 0; diff --git a/internal/e2e/fixtures/postgres/up/5.sql b/internal/e2e/fixtures/postgres/up/5.sql index a6bd35b4..7c1a1bfb 100644 --- a/internal/e2e/fixtures/postgres/up/5.sql +++ b/internal/e2e/fixtures/postgres/up/5.sql @@ -2,8 +2,8 @@ -- PostgreSQL database dump -- --- Dumped from database version 9.6.19 --- Dumped by pg_dump version 12.4 +-- Dumped from database version 10.19 (Debian 10.19-1.pgdg90+1) +-- Dumped by pg_dump version 14.1 SET statement_timeout = 0; SET lock_timeout = 0; diff --git a/internal/e2e/fixtures/postgres/up/6.sql b/internal/e2e/fixtures/postgres/up/6.sql index f23d0efe..4d463163 100644 --- a/internal/e2e/fixtures/postgres/up/6.sql +++ b/internal/e2e/fixtures/postgres/up/6.sql @@ -2,8 +2,8 @@ -- PostgreSQL database dump -- --- Dumped from database version 9.6.19 --- Dumped by pg_dump version 12.4 +-- Dumped from database version 10.19 (Debian 10.19-1.pgdg90+1) +-- Dumped by pg_dump version 14.1 SET statement_timeout = 0; SET lock_timeout = 0; diff --git a/internal/e2e/fixtures/postgres/up/7.sql b/internal/e2e/fixtures/postgres/up/7.sql index 76896365..77c552c9 100644 --- a/internal/e2e/fixtures/postgres/up/7.sql +++ b/internal/e2e/fixtures/postgres/up/7.sql @@ -2,8 +2,8 @@ -- PostgreSQL database dump -- --- Dumped from database version 9.6.19 --- Dumped by pg_dump version 12.4 +-- Dumped from database version 10.19 (Debian 10.19-1.pgdg90+1) +-- Dumped by pg_dump version 14.1 SET statement_timeout = 0; SET lock_timeout = 0; diff --git a/internal/e2e/fixtures/postgres/up/8.sql b/internal/e2e/fixtures/postgres/up/8.sql index 4983375e..a47bf9cd 100644 --- a/internal/e2e/fixtures/postgres/up/8.sql +++ b/internal/e2e/fixtures/postgres/up/8.sql @@ -2,8 +2,8 @@ -- PostgreSQL database dump -- --- Dumped from database version 9.6.19 --- Dumped by pg_dump version 12.4 +-- Dumped from database version 10.19 (Debian 10.19-1.pgdg90+1) +-- Dumped by pg_dump version 14.1 SET statement_timeout = 0; SET lock_timeout = 0; diff --git a/internal/e2e/fixtures/postgres/up/9.sql b/internal/e2e/fixtures/postgres/up/9.sql index 013b24e3..00b5166f 100644 --- a/internal/e2e/fixtures/postgres/up/9.sql +++ b/internal/e2e/fixtures/postgres/up/9.sql @@ -2,8 +2,8 @@ -- PostgreSQL database dump -- --- Dumped from database version 9.6.19 --- Dumped by pg_dump version 12.4 +-- Dumped from database version 10.19 (Debian 10.19-1.pgdg90+1) +-- Dumped by pg_dump version 14.1 SET statement_timeout = 0; SET lock_timeout = 0; diff --git a/internal/e2e/fixtures/sqlite3/down/10.sql b/internal/e2e/fixtures/sqlite3/down/10.sql index d3e88a50..6b688e85 100644 --- a/internal/e2e/fixtures/sqlite3/down/10.sql +++ b/internal/e2e/fixtures/sqlite3/down/10.sql @@ -14,5 +14,5 @@ CREATE TABLE IF NOT EXISTS "e2e_user_posts" ( "content" TEXT NOT NULL DEFAULT '', FOREIGN KEY (user_id) REFERENCES e2e_users (id) ON UPDATE NO ACTION ON DELETE CASCADE ); -CREATE INDEX "e2e_user_notes_user_id_idx" ON "e2e_user_posts" (user_id); 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" (user_id); diff --git a/internal/e2e/fixtures/sqlite3/down/11.sql b/internal/e2e/fixtures/sqlite3/down/11.sql index 29ee4c6a..444b2aef 100644 --- a/internal/e2e/fixtures/sqlite3/down/11.sql +++ b/internal/e2e/fixtures/sqlite3/down/11.sql @@ -14,5 +14,5 @@ CREATE TABLE IF NOT EXISTS "e2e_user_posts" ( "content" TEXT NOT NULL DEFAULT '', FOREIGN KEY ("user_id") REFERENCES "e2e_users" (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" ("user_id"); +CREATE UNIQUE INDEX "e2e_user_notes_slug_idx" ON "e2e_user_posts" (slug); diff --git a/internal/e2e/fixtures/sqlite3/down/12.sql b/internal/e2e/fixtures/sqlite3/down/12.sql index e5827388..abca4c08 100644 --- a/internal/e2e/fixtures/sqlite3/down/12.sql +++ b/internal/e2e/fixtures/sqlite3/down/12.sql @@ -14,5 +14,5 @@ CREATE TABLE IF NOT EXISTS "e2e_user_posts" ( "content" TEXT NOT NULL DEFAULT '', FOREIGN KEY ("user_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" ("user_id"); +CREATE UNIQUE INDEX "e2e_user_notes_slug_idx" ON "e2e_user_posts" (slug); diff --git a/internal/e2e/fixtures/sqlite3/down/13.sql b/internal/e2e/fixtures/sqlite3/down/13.sql index a612ac6d..51a8b100 100644 --- a/internal/e2e/fixtures/sqlite3/down/13.sql +++ b/internal/e2e/fixtures/sqlite3/down/13.sql @@ -14,5 +14,5 @@ CREATE TABLE IF NOT EXISTS "e2e_user_posts" ( "content" TEXT NOT NULL DEFAULT '', 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 UNIQUE INDEX "e2e_user_notes_slug_idx" ON "e2e_user_posts" (slug); diff --git a/internal/e2e/fixtures/sqlite3/down/14.sql b/internal/e2e/fixtures/sqlite3/down/14.sql index 7fb5c07e..c94c5c25 100644 --- a/internal/e2e/fixtures/sqlite3/down/14.sql +++ b/internal/e2e/fixtures/sqlite3/down/14.sql @@ -15,5 +15,5 @@ CREATE TABLE IF NOT EXISTS "e2e_user_posts" ( "published" bool NOT NULL DEFAULT FALSE, FOREIGN KEY (author_id) REFERENCES e2e_authors (id) ON UPDATE NO ACTION ON DELETE CASCADE ); -CREATE INDEX "e2e_user_notes_user_id_idx" ON "e2e_user_posts" (author_id); 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 index b6b42c9c..1712ae99 100644 --- a/internal/e2e/fixtures/sqlite3/down/15.sql +++ b/internal/e2e/fixtures/sqlite3/down/15.sql @@ -15,8 +15,8 @@ CREATE TABLE IF NOT EXISTS "e2e_user_posts" ( "published" bool NOT NULL DEFAULT FALSE, FOREIGN KEY (author_id) REFERENCES e2e_authors (id) ON UPDATE NO ACTION ON DELETE CASCADE ); -CREATE INDEX "e2e_user_notes_user_id_idx" ON "e2e_user_posts" (author_id); 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 ); diff --git a/internal/e2e/fixtures/sqlite3/down/16.sql b/internal/e2e/fixtures/sqlite3/down/16.sql new file mode 100644 index 00000000..583429a0 --- /dev/null +++ b/internal/e2e/fixtures/sqlite3/down/16.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/fixtures/sqlite3/down/8.sql b/internal/e2e/fixtures/sqlite3/down/8.sql index 105c01b0..520a5028 100644 --- a/internal/e2e/fixtures/sqlite3/down/8.sql +++ b/internal/e2e/fixtures/sqlite3/down/8.sql @@ -14,5 +14,5 @@ CREATE TABLE IF NOT EXISTS "e2e_user_posts" ( "content" TEXT NOT NULL DEFAULT '', FOREIGN KEY (user_id) REFERENCES e2e_users (id) ON UPDATE NO ACTION ON DELETE CASCADE ); -CREATE INDEX "e2e_user_notes_user_id_idx" ON "e2e_user_posts" (user_id); 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" (user_id); diff --git a/internal/e2e/fixtures/sqlite3/down/9.sql b/internal/e2e/fixtures/sqlite3/down/9.sql index 04269690..05acdb2a 100644 --- a/internal/e2e/fixtures/sqlite3/down/9.sql +++ b/internal/e2e/fixtures/sqlite3/down/9.sql @@ -14,5 +14,5 @@ CREATE TABLE IF NOT EXISTS "e2e_user_posts" ( "content" TEXT NOT NULL DEFAULT '', FOREIGN KEY (user_id) REFERENCES e2e_users (id) ON UPDATE NO ACTION ON DELETE CASCADE ); -CREATE INDEX "e2e_user_notes_user_id_idx" ON "e2e_user_posts" (user_id); 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" (user_id); diff --git a/internal/e2e/fixtures/sqlite3/up/10.sql b/internal/e2e/fixtures/sqlite3/up/10.sql index 6b688e85..d3e88a50 100644 --- a/internal/e2e/fixtures/sqlite3/up/10.sql +++ b/internal/e2e/fixtures/sqlite3/up/10.sql @@ -14,5 +14,5 @@ CREATE TABLE IF NOT EXISTS "e2e_user_posts" ( "content" TEXT NOT NULL DEFAULT '', FOREIGN KEY (user_id) REFERENCES e2e_users (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" (user_id); +CREATE UNIQUE INDEX "e2e_user_notes_slug_idx" ON "e2e_user_posts" (slug); diff --git a/internal/e2e/fixtures/sqlite3/up/11.sql b/internal/e2e/fixtures/sqlite3/up/11.sql index 430a70d2..4d51a6b6 100644 --- a/internal/e2e/fixtures/sqlite3/up/11.sql +++ b/internal/e2e/fixtures/sqlite3/up/11.sql @@ -14,5 +14,5 @@ CREATE TABLE IF NOT EXISTS "e2e_user_posts" ( "content" TEXT NOT NULL DEFAULT '', FOREIGN KEY (user_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" (user_id); +CREATE UNIQUE INDEX "e2e_user_notes_slug_idx" ON "e2e_user_posts" (slug); diff --git a/internal/e2e/fixtures/sqlite3/up/12.sql b/internal/e2e/fixtures/sqlite3/up/12.sql index 0845a1c4..57038068 100644 --- a/internal/e2e/fixtures/sqlite3/up/12.sql +++ b/internal/e2e/fixtures/sqlite3/up/12.sql @@ -14,5 +14,5 @@ CREATE TABLE IF NOT EXISTS "e2e_user_posts" ( "content" TEXT NOT NULL DEFAULT '', 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 UNIQUE INDEX "e2e_user_notes_slug_idx" ON "e2e_user_posts" (slug); diff --git a/internal/e2e/fixtures/sqlite3/up/13.sql b/internal/e2e/fixtures/sqlite3/up/13.sql index 7fb5c07e..c94c5c25 100644 --- a/internal/e2e/fixtures/sqlite3/up/13.sql +++ b/internal/e2e/fixtures/sqlite3/up/13.sql @@ -15,5 +15,5 @@ CREATE TABLE IF NOT EXISTS "e2e_user_posts" ( "published" bool NOT NULL DEFAULT FALSE, FOREIGN KEY (author_id) REFERENCES e2e_authors (id) ON UPDATE NO ACTION ON DELETE CASCADE ); -CREATE INDEX "e2e_user_notes_user_id_idx" ON "e2e_user_posts" (author_id); 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/up/14.sql b/internal/e2e/fixtures/sqlite3/up/14.sql index 1f4ef83a..951facfd 100644 --- a/internal/e2e/fixtures/sqlite3/up/14.sql +++ b/internal/e2e/fixtures/sqlite3/up/14.sql @@ -15,8 +15,8 @@ CREATE TABLE IF NOT EXISTS "e2e_user_posts" ( "published" bool NOT NULL DEFAULT FALSE, FOREIGN KEY (author_id) REFERENCES e2e_authors (id) ON UPDATE NO ACTION ON DELETE CASCADE ); -CREATE INDEX "e2e_user_notes_user_id_idx" ON "e2e_user_posts" (author_id); 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 ); diff --git a/internal/e2e/fixtures/sqlite3/up/15.sql b/internal/e2e/fixtures/sqlite3/up/15.sql index 120b0bc3..583429a0 100644 --- a/internal/e2e/fixtures/sqlite3/up/15.sql +++ b/internal/e2e/fixtures/sqlite3/up/15.sql @@ -15,8 +15,8 @@ CREATE TABLE IF NOT EXISTS "e2e_user_posts" ( "published" bool NOT NULL DEFAULT FALSE, FOREIGN KEY (author_id) REFERENCES e2e_authors (id) ON UPDATE NO ACTION ON DELETE CASCADE ); -CREATE INDEX "e2e_user_notes_user_id_idx" ON "e2e_user_posts" (author_id); 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 ); diff --git a/internal/e2e/fixtures/sqlite3/up/16.sql b/internal/e2e/fixtures/sqlite3/up/16.sql new file mode 100644 index 00000000..ba6c5459 --- /dev/null +++ b/internal/e2e/fixtures/sqlite3/up/16.sql @@ -0,0 +1,39 @@ +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 '2001-01-01 00:00:00', +"issued_at" DATETIME NOT NULL DEFAULT '2000-01-01 00:00:00', +"flow_id" char(36), +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, +FOREIGN KEY (flow_id) REFERENCES e2e_flow (id) ON UPDATE NO ACTION ON DELETE RESTRICT +); +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/2.sql b/internal/e2e/fixtures/sqlite3/up/2.sql index 1dc891e0..33c74af4 100644 --- a/internal/e2e/fixtures/sqlite3/up/2.sql +++ b/internal/e2e/fixtures/sqlite3/up/2.sql @@ -12,6 +12,6 @@ CREATE TABLE IF NOT EXISTS "e2e_user_notes" ( "id" TEXT PRIMARY KEY, "notes" TEXT, "user_id" char(36) NOT NULL, -FOREIGN KEY (user_id) REFERENCES e2e_users (id) ON DELETE cascade +FOREIGN KEY (user_id) REFERENCES e2e_users (id) ON UPDATE NO ACTION ON DELETE CASCADE ); CREATE INDEX "e2e_user_notes_user_id_idx" ON "e2e_user_notes" (user_id); diff --git a/internal/e2e/fixtures/sqlite3/up/3.sql b/internal/e2e/fixtures/sqlite3/up/3.sql index c7255a11..2c65bea4 100644 --- a/internal/e2e/fixtures/sqlite3/up/3.sql +++ b/internal/e2e/fixtures/sqlite3/up/3.sql @@ -12,6 +12,6 @@ CREATE TABLE IF NOT EXISTS "e2e_user_notes" ( "id" TEXT PRIMARY KEY, "notes" TEXT, "user_id" char(36) NOT NULL, "slug" TEXT, -FOREIGN KEY (user_id) REFERENCES e2e_users (id) ON DELETE cascade +FOREIGN KEY (user_id) REFERENCES e2e_users (id) ON UPDATE NO ACTION ON DELETE CASCADE ); CREATE INDEX "e2e_user_notes_user_id_idx" ON "e2e_user_notes" (user_id); diff --git a/internal/e2e/fixtures/sqlite3/up/4.sql b/internal/e2e/fixtures/sqlite3/up/4.sql index c7255a11..2c65bea4 100644 --- a/internal/e2e/fixtures/sqlite3/up/4.sql +++ b/internal/e2e/fixtures/sqlite3/up/4.sql @@ -12,6 +12,6 @@ CREATE TABLE IF NOT EXISTS "e2e_user_notes" ( "id" TEXT PRIMARY KEY, "notes" TEXT, "user_id" char(36) NOT NULL, "slug" TEXT, -FOREIGN KEY (user_id) REFERENCES e2e_users (id) ON DELETE cascade +FOREIGN KEY (user_id) REFERENCES e2e_users (id) ON UPDATE NO ACTION ON DELETE CASCADE ); CREATE INDEX "e2e_user_notes_user_id_idx" ON "e2e_user_notes" (user_id); diff --git a/internal/e2e/fixtures/sqlite3/up/7.sql b/internal/e2e/fixtures/sqlite3/up/7.sql index 40a1a5eb..87109179 100644 --- a/internal/e2e/fixtures/sqlite3/up/7.sql +++ b/internal/e2e/fixtures/sqlite3/up/7.sql @@ -11,8 +11,9 @@ CREATE TABLE IF NOT EXISTS "e2e_users" ( CREATE TABLE IF NOT EXISTS "e2e_user_posts" ( "id" TEXT PRIMARY KEY, "user_id" char(36) NOT NULL, -"slug" TEXT NOT NULL, "content" TEXT NOT NULL DEFAULT '', +"slug" TEXT NOT NULL, +"content" TEXT NOT NULL DEFAULT '', FOREIGN KEY (user_id) REFERENCES e2e_users (id) ON UPDATE NO ACTION ON DELETE CASCADE ); -CREATE INDEX "e2e_user_notes_user_id_idx" ON "e2e_user_posts" (user_id); 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" (user_id); diff --git a/internal/e2e/fixtures/sqlite3/up/8.sql b/internal/e2e/fixtures/sqlite3/up/8.sql index e4c96346..305400b6 100644 --- a/internal/e2e/fixtures/sqlite3/up/8.sql +++ b/internal/e2e/fixtures/sqlite3/up/8.sql @@ -11,8 +11,9 @@ CREATE TABLE IF NOT EXISTS "e2e_users" ( CREATE TABLE IF NOT EXISTS "e2e_user_posts" ( "id" TEXT PRIMARY KEY, "user_id" char(36) NOT NULL, -"slug" TEXT NOT NULL, "content" TEXT NOT NULL DEFAULT '', +"slug" TEXT NOT NULL, +"content" TEXT NOT NULL DEFAULT '', FOREIGN KEY (user_id) REFERENCES e2e_users (id) ON UPDATE NO ACTION ON DELETE CASCADE ); -CREATE INDEX "e2e_user_notes_user_id_idx" ON "e2e_user_posts" (user_id); 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" (user_id); diff --git a/internal/e2e/fixtures/sqlite3/up/9.sql b/internal/e2e/fixtures/sqlite3/up/9.sql index 19233aa4..b2e49432 100644 --- a/internal/e2e/fixtures/sqlite3/up/9.sql +++ b/internal/e2e/fixtures/sqlite3/up/9.sql @@ -2,16 +2,17 @@ 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_users" ( -"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, "user_id" char(36) NOT NULL, -"slug" TEXT NOT NULL, "content" TEXT NOT NULL DEFAULT '', +"slug" TEXT NOT NULL, +"content" TEXT NOT NULL DEFAULT '', FOREIGN KEY (user_id) REFERENCES e2e_users (id) ON UPDATE NO ACTION ON DELETE CASCADE ); -CREATE INDEX "e2e_user_notes_user_id_idx" ON "e2e_user_posts" (user_id); 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" (user_id); +CREATE TABLE IF NOT EXISTS "e2e_users" ( +"id" TEXT PRIMARY KEY, +"created_at" DATETIME NOT NULL, +"updated_at" DATETIME NOT NULL +); diff --git a/internal/e2e/migrations/20191100000017_add_fk_column.down.fizz b/internal/e2e/migrations/20191100000017_add_fk_column.down.fizz new file mode 100644 index 00000000..87b7e16b --- /dev/null +++ b/internal/e2e/migrations/20191100000017_add_fk_column.down.fizz @@ -0,0 +1,5 @@ +{{ if eq .Dialect "mysql" }} +drop_foreign_key("e2e_token", "e2e_token_flow_id_fk") +{{ end }} +drop_column("e2e_token", "flow_id") +change_column("e2e_token", "expires_at", "timestamp", { "default": "2000-01-01 00:00:00" }) diff --git a/internal/e2e/migrations/20191100000017_add_fk_column.up.fizz b/internal/e2e/migrations/20191100000017_add_fk_column.up.fizz new file mode 100644 index 00000000..9a433815 --- /dev/null +++ b/internal/e2e/migrations/20191100000017_add_fk_column.up.fizz @@ -0,0 +1,8 @@ +add_column("e2e_token", "flow_id", "uuid", {"null": true, "foreign_key": { + "table": "e2e_flow", + "columns": ["id"], + "name": "e2e_token_flow_id_fk", + "on_delete": "RESTRICT", + "on_update": "NO ACTION" +}}) +change_column("e2e_token", "expires_at", "timestamp", { "default": "2001-01-01 00:00:00" }) diff --git a/internal/e2e/sqlite3_test.go b/internal/e2e/sqlite3_test.go index 7d404484..d235e7fb 100644 --- a/internal/e2e/sqlite3_test.go +++ b/internal/e2e/sqlite3_test.go @@ -1,6 +1,7 @@ package e2e_test import ( + "github.com/gobuffalo/pop/v6/logging" "io/ioutil" "github.com/gobuffalo/pop/v6" @@ -16,11 +17,17 @@ func (s *SQLiteSuite) Test_SQLite_MigrationSteps() { td, err := ioutil.TempDir("", "pop-e2e-sqlite") r.NoError(err) + td = td + ".sqlite?mode=rwc&_fk=true" + s.Suite.T().Logf("Storing SQLite DB in %s", td) - c, err := pop.NewConnection(&pop.ConnectionDetails{URL: "sqlite3://" + td + "db.sql?mode=rwc&_fk=true"}) + c, err := pop.NewConnection(&pop.ConnectionDetails{URL: "sqlite3://" + td}) r.NoError(err) r.NoError(c.Open(), "%s", c.URL()) r.NoError(c.RawQuery("SELECT 1").Exec(), "%s", c.URL()) + pop.Debug = false + pop.SetLogger(func(lvl logging.Level, s string, args ...interface{}) { + }) + run(&s.Suite, c, runTestData(&s.Suite, c, false)) } diff --git a/schema.go b/schema.go new file mode 100644 index 00000000..a2f3437f --- /dev/null +++ b/schema.go @@ -0,0 +1,14 @@ +package fizz + +type SchemaQuery interface { + ReplaceSchema(map[string]*Table) + Build() error + TableInfo(string) (*Table, error) + ReplaceColumn(table string, oldColumn string, newColumn Column) error + ColumnInfo(table string, column string) (*Column, error) + IndexInfo(table string, idx string) (*Index, error) + Delete(string) + ResetCache() + SetTable(*Table) + DeleteColumn(string, string) +} diff --git a/test.sh b/test.sh index 9b2841ac..419012f6 100755 --- a/test.sh +++ b/test.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -e clear +set -euxo pipefail verbose="" @@ -36,12 +36,12 @@ function test { ./tsoda drop -e $SODA_DIALECT ./tsoda create -e $SODA_DIALECT ./tsoda migrate -e $SODA_DIALECT -p ./testdata/migrations - go test -tags sqlite -count=1 $verbose $(go list ./... | grep -v /vendor/) + go test -tags sqlite $verbose -failfast ./... echo "!!! Resetting $1" ./tsoda drop -e $SODA_DIALECT ./tsoda create -e $SODA_DIALECT echo "!!! Running e2e tests $1" - go test -tags sqlite,e2e -count=1 $verbose ./internal/e2e + go test -tags sqlite,e2e -count=1 -failfast $verbose ./internal/e2e } test "sqlite" diff --git a/translators/cockroach.go b/translators/cockroach.go index c1155dd6..35eeb8e1 100644 --- a/translators/cockroach.go +++ b/translators/cockroach.go @@ -1,6 +1,8 @@ package translators import ( + "bytes" + "encoding/json" "fmt" "strings" @@ -8,7 +10,7 @@ import ( ) type Cockroach struct { - Schema SchemaQuery + Schema fizz.SchemaQuery } func NewCockroach(url string, name string) *Cockroach { @@ -27,6 +29,10 @@ func (Cockroach) Name() string { return "cockroach" } +func (p *Cockroach) SchemaQuery() fizz.SchemaQuery { + return p.Schema +} + func (p *Cockroach) CreateTable(t fizz.Table) (string, error) { p.Schema.SetTable(&t) sql := []string{} @@ -42,7 +48,11 @@ func (p *Cockroach) CreateTable(t fizz.Table) (string, error) { return "", fmt.Errorf("can not use %s as a primary key", c.ColType) } } - cols = append(cols, p.buildAddColumn(c)) + stmt, err := p.buildAddColumn(c, false) + if err != nil { + return "", err + } + cols = append(cols, stmt) if c.Primary { cols = append(cols, fmt.Sprintf(`PRIMARY KEY("%s")`, c.Name)) } @@ -138,7 +148,12 @@ func (p *Cockroach) ChangeColumn(t fizz.Table) (string, error) { newCol.Options["null"] = true } - createColumnSQL := fmt.Sprintf(`ALTER TABLE "%s" ADD COLUMN %s;COMMIT TRANSACTION;BEGIN TRANSACTION;`, table.Name, p.buildAddColumn(newCol)) + stmt, err := p.buildAddColumn(newCol, true) + if err != nil { + return "", err + } + + createColumnSQL := fmt.Sprintf(`ALTER TABLE "%s" ADD COLUMN %s;COMMIT TRANSACTION;BEGIN TRANSACTION;`, table.Name, stmt) ins := fmt.Sprintf(`UPDATE "%s" SET "%s" = "%s";COMMIT TRANSACTION;BEGIN TRANSACTION;`, t.Name, c.Name, tempCol) sql := []string{createColumnSQL, ins} @@ -164,7 +179,11 @@ func (p *Cockroach) AddColumn(t fizz.Table) (string, error) { return "", fmt.Errorf("not enough columns supplied") } c := t.Columns[0] - s := fmt.Sprintf("ALTER TABLE \"%s\" ADD COLUMN %s;COMMIT TRANSACTION;BEGIN TRANSACTION;", t.Name, p.buildAddColumn(c)) + stmt, err := p.buildAddColumn(c, true) + if err != nil { + return "", err + } + s := fmt.Sprintf("ALTER TABLE \"%s\" ADD COLUMN %s;COMMIT TRANSACTION;BEGIN TRANSACTION;", t.Name, stmt) // Update schema cache if we can tableInfo, err := p.Schema.TableInfo(t.Name) @@ -322,12 +341,13 @@ func (p *Cockroach) DropForeignKey(t fizz.Table) (string, error) { return s, nil } -func (p *Cockroach) buildAddColumn(c fizz.Column) string { +func (p *Cockroach) buildAddColumn(c fizz.Column, respectForeignKeys bool) (string, error) { s := fmt.Sprintf("\"%s\" %s", c.Name, p.colType(c)) if ok, _ := c.Options["null"].(bool); !ok || c.Primary { s = fmt.Sprintf("%s NOT NULL", s) } + if c.Options["default"] != nil { s = fmt.Sprintf("%s DEFAULT '%v'", s, c.Options["default"]) } @@ -335,7 +355,31 @@ func (p *Cockroach) buildAddColumn(c fizz.Column) string { s = fmt.Sprintf("%s DEFAULT %s", s, c.Options["default_raw"]) } - return s + if c.Options["foreign_key"] != nil && respectForeignKeys { + var b bytes.Buffer + var co foreignKeyColumnOption + if err := json.NewEncoder(&b).Encode(c.Options["foreign_key"]); err != nil { + return "", err + } + if err := json.NewDecoder(&b).Decode(&co); err != nil { + return "", err + } + + s += fmt.Sprintf(" CONSTRAINT %s REFERENCES %s (%s)", co.Name, co.Table, strings.Join(co.Columns, ", ")) + + options := map[string]interface{}{} + if len(co.OnDelete) > 0 { + s += fmt.Sprintf(" ON DELETE %s", co.OnDelete) + options["on_delete"] = co.OnDelete + } + + if len(co.OnUpdate) > 0 { + s += fmt.Sprintf(" ON UPDATE %s", co.OnUpdate) + options["on_update"] = co.OnUpdate + } + } + + return s, nil } func (p *Cockroach) buildChangeColumn(oldCol fizz.Column, c fizz.Column) fizz.Column { diff --git a/translators/cockroach_test.go b/translators/cockroach_test.go index 55ddb8c0..2301f547 100644 --- a/translators/cockroach_test.go +++ b/translators/cockroach_test.go @@ -192,6 +192,23 @@ func (p *CockroachSuite) Test_Cockroach_AddColumn() { r.Equal(ddl, res) } +func (p *CockroachSuite) Test_Cockroach_AddColumnForeignKeys() { + r := p.Require() + + ddl := `ALTER TABLE "users" ADD COLUMN "mycolumn" VARCHAR (50) NOT NULL DEFAULT 'foo' CONSTRAINT projects_subscription_id_fk REFERENCES subscriptions (id, kid) ON DELETE RESTRICT ON UPDATE NO ACTION;COMMIT TRANSACTION;BEGIN TRANSACTION;` + schema.schema["users"] = &fizz.Table{} + + res, _ := fizz.AString(`add_column("users", "mycolumn", "string", {"default": "foo", "size": 50, "foreign_key": { + "table": "subscriptions", + "columns": ["id", "kid"], + "name": "projects_subscription_id_fk", + "on_delete": "RESTRICT", + "on_update": "NO ACTION" +}})`, p.crdbt()) + + r.Equal(ddl, res) +} + func (p *CockroachSuite) Test_Cockroach_DropColumn() { r := p.Require() ddl := `ALTER TABLE "table_name" DROP COLUMN "column_name";COMMIT TRANSACTION;BEGIN TRANSACTION;` diff --git a/translators/mssqlserver.go b/translators/mssqlserver.go index fc28e517..4f130af8 100644 --- a/translators/mssqlserver.go +++ b/translators/mssqlserver.go @@ -200,6 +200,7 @@ func (p *MsSqlServer) buildAddColumn(tableName string, c fizz.Column) string { if c.Options["null"] == nil { s = fmt.Sprintf("%s NOT NULL", s) } + setDefault := c.Options["default"] != nil || c.Options["default_raw"] != nil if setDefault { dfConstraintName := fmt.Sprintf("DF_%s_%s", tableName, c.Name) diff --git a/translators/mssqlserver_test.go b/translators/mssqlserver_test.go index d03bf7c3..55a956a5 100644 --- a/translators/mssqlserver_test.go +++ b/translators/mssqlserver_test.go @@ -70,7 +70,7 @@ updated_at DATETIME NOT NULL );` res, _ := fizz.AString(` - create_table("users") { + create_table("users") {1 t.Column("first_name", "string", {}) t.Column("last_name", "string", {}) t.Column("email", "string", {"size":20}) @@ -93,7 +93,7 @@ updated_at DATETIME NOT NULL CREATE TABLE profiles ( id INT PRIMARY KEY IDENTITY(1,1), user_id INT NOT NULL, -first_name NVARCHAR (255) NOT NULL, +first_name NVARCHAR (255), last_name NVARCHAR (255) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL @@ -108,7 +108,7 @@ ALTER TABLE profiles ADD CONSTRAINT profiles_users_id_fk FOREIGN KEY (user_id) R create_table("profiles") { t.Column("id", "INT", {"primary": true}) t.Column("user_id", "INT", {}) - t.Column("first_name", "string", {}) + t.Column("first_name", "string", {"null": false}) t.Column("last_name", "string", {}) t.ForeignKey("user_id", {"users": ["id"]}, {}) } @@ -122,7 +122,7 @@ func (p *MsSqlServerSQLSuite) Test_MsSqlServer_CreateTables_WithCompositePrimary user_id INT NOT NULL, profile_id INT NOT NULL, created_at DATETIME NOT NULL, -updated_at DATETIME NOT NULL +updated_at DATETIME NOT NULL, PRIMARY KEY([user_id], [profile_id]) );` diff --git a/translators/mysql.go b/translators/mysql.go index 388b3303..6af480bc 100644 --- a/translators/mysql.go +++ b/translators/mysql.go @@ -1,6 +1,8 @@ package translators import ( + "bytes" + "encoding/json" "fmt" "regexp" "strings" @@ -10,7 +12,7 @@ import ( // MySQL is a MySQL-specific translator. type MySQL struct { - Schema SchemaQuery + Schema fizz.SchemaQuery strDefaultSize int } @@ -93,21 +95,46 @@ func (p *MySQL) AddColumn(t fizz.Table) (string, error) { if len(t.Columns) == 0 { return "", fmt.Errorf("not enough columns supplied") } + c := t.Columns[0] + + var constraint string + if c.Options["foreign_key"] != nil { + var b bytes.Buffer + var co foreignKeyColumnOption + if err := json.NewEncoder(&b).Encode(c.Options["foreign_key"]); err != nil { + return "", err + } + if err := json.NewDecoder(&b).Decode(&co); err != nil { + return "", err + } - if _, ok := t.Columns[0].Options["first"]; ok { + constraint += fmt.Sprintf(", ADD CONSTRAINT %s FOREIGN KEY (%s) REFERENCES %s(%s)", co.Name, c.Name, co.Table, strings.Join(co.Columns, ", ")) + + options := map[string]interface{}{} + if len(co.OnDelete) > 0 { + constraint += fmt.Sprintf(" ON DELETE %s", co.OnDelete) + options["on_delete"] = co.OnDelete + } + + if len(co.OnUpdate) > 0 { + constraint += fmt.Sprintf(" ON UPDATE %s", co.OnUpdate) + options["on_update"] = co.OnUpdate + } + } + + if _, ok := c.Options["first"]; ok { c := t.Columns[0] - s := fmt.Sprintf("ALTER TABLE %s ADD COLUMN %s FIRST;", p.escapeIdentifier(t.Name), p.buildColumn(c)) + s := fmt.Sprintf("ALTER TABLE %s ADD COLUMN %s%s FIRST;", p.escapeIdentifier(t.Name), p.buildColumn(c), constraint) return s, nil } - if val, ok := t.Columns[0].Options["after"]; ok { + if val, ok := c.Options["after"]; ok { c := t.Columns[0] - s := fmt.Sprintf("ALTER TABLE %s ADD COLUMN %s AFTER `%s`;", p.escapeIdentifier(t.Name), p.buildColumn(c), val) + s := fmt.Sprintf("ALTER TABLE %s ADD COLUMN %s%s AFTER `%s`;", p.escapeIdentifier(t.Name), p.buildColumn(c), constraint, val) return s, nil } - c := t.Columns[0] - s := fmt.Sprintf("ALTER TABLE %s ADD COLUMN %s;", p.escapeIdentifier(t.Name), p.buildColumn(c)) + s := fmt.Sprintf("ALTER TABLE %s ADD COLUMN %s%s;", p.escapeIdentifier(t.Name), p.buildColumn(c), constraint) return s, nil } @@ -131,11 +158,14 @@ func (p *MySQL) RenameColumn(t fizz.Table) (string, error) { return "", err } var c fizz.Column - for _, c = range ti.Columns { + var k int + for k, c = range ti.Columns { if c.Name == oc.Name { + ti.Columns[k].Name = nc.Name break } } + col := p.buildColumn(c) col = strings.Replace(col, oc.Name, fmt.Sprintf("%s` `%s", oc.Name, nc.Name), -1) s := fmt.Sprintf("ALTER TABLE %s CHANGE %s;", p.escapeIdentifier(t.Name), col) @@ -213,6 +243,7 @@ func (p *MySQL) buildColumn(c fizz.Column) string { if ok, _ := c.Options["null"].(bool); !ok || c.Primary { s = fmt.Sprintf("%s NOT NULL", s) } + if c.Options["default"] != nil { d := fmt.Sprintf("%#v", c.Options["default"]) re := regexp.MustCompile("^(\")(.+)(\")$") diff --git a/translators/mysql_test.go b/translators/mysql_test.go index 76f7436d..c46135ff 100644 --- a/translators/mysql_test.go +++ b/translators/mysql_test.go @@ -229,6 +229,31 @@ func (p *MySQLSuite) Test_MySQL_AddColumnAfter() { r.Equal(ddl, res) } +func (p *MySQLSuite) Test_MySQL_AddColumnForeignKeys() { + r := p.Require() + + ddl := "ALTER TABLE `users` ADD COLUMN `mycolumn` VARCHAR (50) NOT NULL DEFAULT 'foo' ADD CONSTRAINT projects_subscription_id_fk FOREIGN KEY (mycolumn) REFERENCES subscriptions(id, kid) ON DELETE RESTRICT ON UPDATE NO ACTION;" + + _, err := fizz.AString(` + create_table("users") { + t.Column("id", "INT", {"primary": true}) + t.Column("email", "string", {"size":20}) + }`, myt) + r.NoError(err) + + res, _ := fizz.AString(` + add_column("users", "mycolumn", "string", {"default": "foo", "size": 50, "foreign_key": { + "table": "subscriptions", + "columns": ["id", "kid"], + "name": "projects_subscription_id_fk", + "on_delete": "RESTRICT", + "on_update": "NO ACTION" + }})`, + myt) + + r.Equal(ddl, res) +} + func (p *MySQLSuite) Test_MySQL_AddColumnFirst() { r := p.Require() ddl := `ALTER TABLE ` + "`users`" + ` ADD COLUMN ` + "`mycolumn`" + ` VARCHAR (50) NOT NULL DEFAULT 'foo' FIRST;` @@ -251,9 +276,17 @@ func (p *MySQLSuite) Test_MySQL_DropColumn() { func (p *MySQLSuite) Test_MySQL_RenameColumn() { r := p.Require() - ddl := `ALTER TABLE ` + "`users`" + ` CHANGE ` + "`email`" + ` ` + "`email_address`" + ` varchar(50) NOT NULL DEFAULT 'foo@example.com';` + ddl := `ALTER TABLE ` + "`users`" + ` CHANGE ` + "`email`" + ` ` + "`email_address`" + ` VARCHAR (50) NOT NULL DEFAULT 'foo@example.com';` - res, err := fizz.AString(`rename_column("users", "email", "email_address")`, myt) + _, err := fizz.AString(` + create_table("users") { + t.Column("id", "INT", {"primary": true}) + t.Column("email", "string", {"size":50, "default": "foo@example.com"}) + } +`, myt) + res, err := fizz.AString(` + rename_column("users", "email", "email_address") +`, myt) r.NoError(err) r.Equal(ddl, res) } diff --git a/translators/postgres.go b/translators/postgres.go index 48746495..424fbbd5 100644 --- a/translators/postgres.go +++ b/translators/postgres.go @@ -1,6 +1,8 @@ package translators import ( + "bytes" + "encoding/json" "fmt" "strings" @@ -34,7 +36,11 @@ func (p *Postgres) CreateTable(t fizz.Table) (string, error) { return "", fmt.Errorf("can not use %s as a primary key", c.ColType) } } - cols = append(cols, p.buildAddColumn(c)) + stmt, err := p.buildAddColumn(c, false) + if err != nil { + return "", err + } + cols = append(cols, stmt) if c.Primary { cols = append(cols, fmt.Sprintf(`PRIMARY KEY("%s")`, c.Name)) } @@ -95,7 +101,11 @@ func (p *Postgres) AddColumn(t fizz.Table) (string, error) { return "", fmt.Errorf("not enough columns supplied") } c := t.Columns[0] - s := fmt.Sprintf("ALTER TABLE \"%s\" ADD COLUMN %s;", t.Name, p.buildAddColumn(c)) + stmt, err := p.buildAddColumn(c, true) + if err != nil { + return "", err + } + s := fmt.Sprintf("ALTER TABLE \"%s\" ADD COLUMN %s;", t.Name, stmt) return s, nil } @@ -171,12 +181,13 @@ func (p *Postgres) DropForeignKey(t fizz.Table) (string, error) { return s, nil } -func (p *Postgres) buildAddColumn(c fizz.Column) string { +func (p *Postgres) buildAddColumn(c fizz.Column, respectForeignKeys bool) (string, error) { s := fmt.Sprintf("\"%s\" %s", c.Name, p.colType(c)) if ok, _ := c.Options["null"].(bool); !ok || c.Primary { s = fmt.Sprintf("%s NOT NULL", s) } + if c.Options["default"] != nil { s = fmt.Sprintf("%s DEFAULT '%v'", s, c.Options["default"]) } @@ -184,7 +195,31 @@ func (p *Postgres) buildAddColumn(c fizz.Column) string { s = fmt.Sprintf("%s DEFAULT %s", s, c.Options["default_raw"]) } - return s + if c.Options["foreign_key"] != nil && respectForeignKeys { + var b bytes.Buffer + var co foreignKeyColumnOption + if err := json.NewEncoder(&b).Encode(c.Options["foreign_key"]); err != nil { + return "", err + } + if err := json.NewDecoder(&b).Decode(&co); err != nil { + return "", err + } + + s += fmt.Sprintf(" CONSTRAINT %s REFERENCES %s (%s)", co.Name, co.Table, strings.Join(co.Columns, ", ")) + + options := map[string]interface{}{} + if len(co.OnDelete) > 0 { + s += fmt.Sprintf(" ON DELETE %s", co.OnDelete) + options["on_delete"] = co.OnDelete + } + + if len(co.OnUpdate) > 0 { + s += fmt.Sprintf(" ON UPDATE %s", co.OnUpdate) + options["on_update"] = co.OnUpdate + } + } + + return s, nil } func (p *Postgres) buildChangeColumn(c fizz.Column) string { diff --git a/translators/postgres_test.go b/translators/postgres_test.go index c2437bcd..d58c33fc 100644 --- a/translators/postgres_test.go +++ b/translators/postgres_test.go @@ -217,6 +217,23 @@ func (p *PostgreSQLSuite) Test_Postgres_AddColumn() { r.Equal(ddl, res) } +func (p *PostgreSQLSuite) Test_Postgres_AddColumnForeignKeys() { + r := p.Require() + + ddl := `ALTER TABLE "users" ADD COLUMN "mycolumn" VARCHAR (50) NOT NULL DEFAULT 'foo' CONSTRAINT projects_subscription_id_fk REFERENCES subscriptions (id, kid) ON DELETE RESTRICT ON UPDATE NO ACTION;` + schema.schema["users"] = &fizz.Table{} + + res, _ := fizz.AString(`add_column("users", "mycolumn", "string", {"default": "foo", "size": 50, "foreign_key": { + "table": "subscriptions", + "columns": ["id", "kid"], + "name": "projects_subscription_id_fk", + "on_delete": "RESTRICT", + "on_update": "NO ACTION" +}})`, pgt) + + r.Equal(ddl, res) +} + func (p *PostgreSQLSuite) Test_Postgres_DropColumn() { r := p.Require() ddl := `ALTER TABLE "table_name" DROP COLUMN "column_name";` diff --git a/translators/schema.go b/translators/schema.go index 11ddb84a..c98b3f81 100644 --- a/translators/schema.go +++ b/translators/schema.go @@ -7,21 +7,11 @@ import ( "github.com/gobuffalo/fizz" ) -type SchemaQuery interface { - ReplaceSchema(map[string]*fizz.Table) - Build() error - TableInfo(string) (*fizz.Table, error) - ReplaceColumn(table string, oldColumn string, newColumn fizz.Column) error - ColumnInfo(table string, column string) (*fizz.Column, error) - IndexInfo(table string, idx string) (*fizz.Index, error) - Delete(string) - SetTable(*fizz.Table) - DeleteColumn(string, string) -} +type SchemaQuery = fizz.SchemaQuery type Schema struct { schema map[string]*fizz.Table - Builder SchemaQuery + Builder fizz.SchemaQuery Name string URL string } @@ -38,6 +28,10 @@ func (s *Schema) ReplaceSchema(newSchema map[string]*fizz.Table) { s.schema = newSchema } +func (s *Schema) ResetCache() { + s.schema = map[string]*fizz.Table{} +} + func (s *Schema) Build() error { return fmt.Errorf("build not implemented for this translator") } diff --git a/translators/sqlite.go b/translators/sqlite.go index b49e806f..274fb07d 100644 --- a/translators/sqlite.go +++ b/translators/sqlite.go @@ -1,14 +1,15 @@ package translators import ( + "bytes" + "encoding/json" "fmt" - "strings" - "github.com/gobuffalo/fizz" + "strings" ) type SQLite struct { - Schema SchemaQuery + Schema fizz.SchemaQuery } func NewSQLite(url string) *SQLite { @@ -24,6 +25,10 @@ func NewSQLite(url string) *SQLite { } } +func (p *SQLite) SchemaQuery() fizz.SchemaQuery { + return p.Schema +} + func (SQLite) Name() string { return "sqlite3" } @@ -45,7 +50,11 @@ func (p *SQLite) CreateTable(t fizz.Table) (string, error) { return "", fmt.Errorf("can not use %s as a primary key", c.ColType) } } else { - s = p.buildColumn(c) + var err error + s, err = p.buildColumn(c, false, nil) + if err != nil { + return "", err + } } cols = append(cols, s) } @@ -102,7 +111,6 @@ func (p *SQLite) RenameTable(t []fizz.Table) (string, error) { func (p *SQLite) ChangeColumn(t fizz.Table) (string, error) { tableInfo, err := p.Schema.TableInfo(t.Name) - if err != nil { return "", err } @@ -132,9 +140,6 @@ func (p *SQLite) ChangeColumn(t fizz.Table) (string, error) { // We do not need to use withForeignKeyPreservingTempTable here because this will not touch any foreign keys! s, err := p.withForeignKeyPreservingTempTable(*tableInfo, t.Name, func(newTable fizz.Table, tableName string) (string, error) { - if t.Columns[0].Name == "slug" { - fmt.Print("asdf") - } return fmt.Sprintf("INSERT INTO \"%s\" (%s) SELECT %s FROM \"%s\";", newTable.Name, strings.Join(newTable.ColumnNames(), ", "), strings.Join(newTable.ColumnNames(), ", "), tableName), nil }) @@ -143,7 +148,6 @@ func (p *SQLite) ChangeColumn(t fizz.Table) (string, error) { } sql = append(sql, s) - return strings.Join(sql, "\n"), nil } @@ -160,7 +164,12 @@ func (p *SQLite) AddColumn(t fizz.Table) (string, error) { tableInfo.Columns = append(tableInfo.Columns, c) - s := fmt.Sprintf("ALTER TABLE \"%s\" ADD COLUMN %s;", t.Name, p.buildColumn(c)) + bc, err := p.buildColumn(c, true, tableInfo) + if err != nil { + return "", err + } + + s := fmt.Sprintf("ALTER TABLE \"%s\" ADD COLUMN %s;", t.Name, bc) return s, nil } @@ -187,11 +196,6 @@ func (p *SQLite) DropColumn(t fizz.Table) (string, error) { newIndexes := []fizz.Index{} for _, i := range tableInfo.Indexes { - if tableInfo.HasColumns(i.Columns...) { - newIndexes = append(newIndexes, i) - continue - } - s, err := p.DropIndex(fizz.Table{ Name: tableInfo.Name, Indexes: []fizz.Index{i}, @@ -200,7 +204,7 @@ func (p *SQLite) DropColumn(t fizz.Table) (string, error) { return "", err } sql = append(sql, s) - if !tableInfo.HasColumns(i.Columns...) { + if tableInfo.HasColumns(i.Columns...) { newIndexes = append(newIndexes, i) } } @@ -210,12 +214,19 @@ func (p *SQLite) DropColumn(t fizz.Table) (string, error) { for _, i := range tableInfo.ForeignKeys { if tableInfo.HasColumns(i.Column) { newForeignKeys = append(newForeignKeys, i) - continue } } tableInfo.ForeignKeys = newForeignKeys - sql = append(sql, fmt.Sprintf(`ALTER TABLE "%s" DROP COLUMN "%s";`, t.Name, droppedColumn.Name)) + s, err := p.withForeignKeyPreservingTempTable(*tableInfo, t.Name, func(newTable fizz.Table, tableName string) (string, error) { + return fmt.Sprintf("INSERT INTO \"%s\" (%s) SELECT %s FROM \"%s\";\n", newTable.Name, strings.Join(newTable.ColumnNames(), ", "), strings.Join(newTable.ColumnNames(), ", "), tableName), nil + }) + + if err != nil { + return "", err + } + sql = append(sql, s) + return strings.Join(sql, "\n"), nil } @@ -374,18 +385,61 @@ func (p *SQLite) withForeignKeyPreservingTempTable(newTable fizz.Table, tableNam ), "\n"), nil } -func (p *SQLite) buildColumn(c fizz.Column) string { +type foreignKeyColumnOption struct { + Table string `json:"table"` + Columns []string `json:"columns"` + Name string `json:"name"` + OnDelete string `json:"on_delete"` + OnUpdate string `json:"on_update"` +} + +func (p *SQLite) buildColumn(c fizz.Column, respectForeignKeys bool, tableInfo *fizz.Table) (string, error) { s := fmt.Sprintf("\"%s\" %s", c.Name, p.colType(c)) if ok, _ := c.Options["null"].(bool); !ok { s = fmt.Sprintf("%s NOT NULL", s) } + if c.Options["default"] != nil { s = fmt.Sprintf("%s DEFAULT '%v'", s, c.Options["default"]) } if c.Options["default_raw"] != nil { s = fmt.Sprintf("%s DEFAULT %s", s, c.Options["default_raw"]) } - return s + + if c.Options["foreign_key"] != nil && respectForeignKeys { + var b bytes.Buffer + var co foreignKeyColumnOption + if err := json.NewEncoder(&b).Encode(c.Options["foreign_key"]); err != nil { + return "", err + } + if err := json.NewDecoder(&b).Decode(&co); err != nil { + return "", err + } + + s += fmt.Sprintf(" CONSTRAINT %s REFERENCES %s (%s)", co.Name, co.Table, strings.Join(co.Columns, ", ")) + + options := map[string]interface{}{} + if len(co.OnDelete) > 0 { + s += fmt.Sprintf(" ON DELETE %s", co.OnDelete) + options["on_delete"] = co.OnDelete + } + + if len(co.OnUpdate) > 0 { + s += fmt.Sprintf(" ON UPDATE %s", co.OnUpdate) + options["on_update"] = co.OnUpdate + } + + tableInfo.ForeignKeys = append(tableInfo.ForeignKeys, fizz.ForeignKey{ + Name: co.Name, + Column: c.Name, + References: fizz.ForeignKeyRef{ + Table: co.Table, + Columns: co.Columns, + }, + Options: options, + }) + } + return s, nil } func (p *SQLite) colType(c fizz.Column) string { diff --git a/translators/sqlite_test.go b/translators/sqlite_test.go index c76ddf99..f9a90f4e 100644 --- a/translators/sqlite_test.go +++ b/translators/sqlite_test.go @@ -22,6 +22,9 @@ type fauxSchema struct { schema map[string]*fizz.Table } +func (s *fauxSchema) ResetCache() { +} + func (s *fauxSchema) Build() error { return nil } @@ -50,8 +53,8 @@ func (p *fauxSchema) Delete(table string) { delete(p.schema, table) } -func (s *fauxSchema) SetTable(table *fizz.Table) { - s.schema[table.Name] = table +func (p *fauxSchema) SetTable(table *fizz.Table) { + p.schema[table.Name] = table } func (p *fauxSchema) TableInfo(table string) (*fizz.Table, error) { @@ -208,9 +211,33 @@ func (p *SQLiteSuite) Test_SQLite_AddColumn() { r.Equal(ddl, res) } +func (p *SQLiteSuite) Test_SQLite_AddColumnWithForeignKeys() { + r := p.Require() + + ddl := `ALTER TABLE "users" ADD COLUMN "mycolumn" TEXT NOT NULL DEFAULT 'foo' CONSTRAINT projects_subscription_id_fk REFERENCES subscriptions (id, kid) ON DELETE RESTRICT ON UPDATE NO ACTION;` + schema.schema["users"] = &fizz.Table{} + + res, _ := fizz.AString(`add_column("users", "mycolumn", "string", {"default": "foo", "size": 50, "foreign_key": { + "table": "subscriptions", + "columns": ["id", "kid"], + "name": "projects_subscription_id_fk", + "on_delete": "RESTRICT", + "on_update": "NO ACTION" +}})`, sqt) + + r.Equal(ddl, res) +} + func (p *SQLiteSuite) Test_SQLite_DropColumn() { r := p.Require() - ddl := `ALTER TABLE "users" DROP COLUMN "created_at";` + ddl := `CREATE TABLE "_users_tmp" ( +"id" INTEGER PRIMARY KEY AUTOINCREMENT, +"updated_at" DATETIME NOT NULL +); +INSERT INTO "_users_tmp" (id, updated_at) SELECT id, updated_at FROM "users"; + +DROP TABLE "users"; +ALTER TABLE "_users_tmp" RENAME TO "users";` schema.schema["users"] = &fizz.Table{ Name: "users", @@ -357,7 +384,17 @@ FOREIGN KEY (user_id) REFERENCES users (uuid) ON DELETE cascade );`, res) res, _ = fizz.AString(`drop_column("user_notes","notes")`, sqt) - r.Equal(`ALTER TABLE "user_notes" DROP COLUMN "notes";`, res) + r.Equal(`CREATE TABLE "_user_notes_tmp" ( +"uuid" TEXT PRIMARY KEY, +"user_id" char(36) NOT NULL, +"created_at" DATETIME NOT NULL, +"updated_at" DATETIME NOT NULL, +FOREIGN KEY (user_id) REFERENCES users (uuid) ON DELETE cascade +); +INSERT INTO "_user_notes_tmp" (uuid, user_id, created_at, updated_at) SELECT uuid, user_id, created_at, updated_at FROM "user_notes"; + +DROP TABLE "user_notes"; +ALTER TABLE "_user_notes_tmp" RENAME TO "user_notes";`, res) res, _ = fizz.AString(`rename_table("users","user_accounts")`, sqt) r.Equal(`ALTER TABLE "users" RENAME TO "user_accounts";`, res)