Repository: gobuffalo/fizz Branch: main Commit: 43801550a873 Files: 223 Total size: 498.3 KB Directory structure: gitextract_9i9t9223/ ├── .github/ │ ├── CODEOWNERS │ ├── FUNDING.yml │ └── workflows/ │ ├── standard-stale.yml │ └── tests.yml ├── .gitignore ├── LICENSE ├── Makefile ├── README.md ├── SHOULDERS.md ├── bubbler.go ├── bubbler_test.go ├── columns.go ├── columns_test.go ├── database.yml ├── docker-compose.yml ├── fizz.go ├── foreign_keys.go ├── go.mod ├── go.sum ├── index.go ├── raw_sql.go ├── tables.go ├── tables_private_test.go ├── tables_test.go ├── test.sh ├── testdata/ │ ├── e2e/ │ │ ├── cockroach_test.go │ │ ├── fixtures/ │ │ │ ├── cockroach/ │ │ │ │ ├── down/ │ │ │ │ │ ├── 0.sql │ │ │ │ │ ├── 1.sql │ │ │ │ │ ├── 10.sql │ │ │ │ │ ├── 11.sql │ │ │ │ │ ├── 12.sql │ │ │ │ │ ├── 13.sql │ │ │ │ │ ├── 14.sql │ │ │ │ │ ├── 15.sql │ │ │ │ │ ├── 2.sql │ │ │ │ │ ├── 3.sql │ │ │ │ │ ├── 4.sql │ │ │ │ │ ├── 5.sql │ │ │ │ │ ├── 6.sql │ │ │ │ │ ├── 7.sql │ │ │ │ │ ├── 8.sql │ │ │ │ │ └── 9.sql │ │ │ │ └── up/ │ │ │ │ ├── 0.sql │ │ │ │ ├── 1.sql │ │ │ │ ├── 10.sql │ │ │ │ ├── 11.sql │ │ │ │ ├── 12.sql │ │ │ │ ├── 13.sql │ │ │ │ ├── 14.sql │ │ │ │ ├── 15.sql │ │ │ │ ├── 2.sql │ │ │ │ ├── 3.sql │ │ │ │ ├── 4.sql │ │ │ │ ├── 5.sql │ │ │ │ ├── 6.sql │ │ │ │ ├── 7.sql │ │ │ │ ├── 8.sql │ │ │ │ └── 9.sql │ │ │ ├── mysql/ │ │ │ │ ├── down/ │ │ │ │ │ ├── 0.sql │ │ │ │ │ ├── 1.sql │ │ │ │ │ ├── 10.sql │ │ │ │ │ ├── 11.sql │ │ │ │ │ ├── 12.sql │ │ │ │ │ ├── 13.sql │ │ │ │ │ ├── 14.sql │ │ │ │ │ ├── 15.sql │ │ │ │ │ ├── 2.sql │ │ │ │ │ ├── 3.sql │ │ │ │ │ ├── 4.sql │ │ │ │ │ ├── 5.sql │ │ │ │ │ ├── 6.sql │ │ │ │ │ ├── 7.sql │ │ │ │ │ ├── 8.sql │ │ │ │ │ └── 9.sql │ │ │ │ └── up/ │ │ │ │ ├── 0.sql │ │ │ │ ├── 1.sql │ │ │ │ ├── 10.sql │ │ │ │ ├── 11.sql │ │ │ │ ├── 12.sql │ │ │ │ ├── 13.sql │ │ │ │ ├── 14.sql │ │ │ │ ├── 15.sql │ │ │ │ ├── 2.sql │ │ │ │ ├── 3.sql │ │ │ │ ├── 4.sql │ │ │ │ ├── 5.sql │ │ │ │ ├── 6.sql │ │ │ │ ├── 7.sql │ │ │ │ ├── 8.sql │ │ │ │ └── 9.sql │ │ │ ├── postgres/ │ │ │ │ ├── down/ │ │ │ │ │ ├── 0.sql │ │ │ │ │ ├── 1.sql │ │ │ │ │ ├── 10.sql │ │ │ │ │ ├── 11.sql │ │ │ │ │ ├── 12.sql │ │ │ │ │ ├── 13.sql │ │ │ │ │ ├── 14.sql │ │ │ │ │ ├── 15.sql │ │ │ │ │ ├── 2.sql │ │ │ │ │ ├── 3.sql │ │ │ │ │ ├── 4.sql │ │ │ │ │ ├── 5.sql │ │ │ │ │ ├── 6.sql │ │ │ │ │ ├── 7.sql │ │ │ │ │ ├── 8.sql │ │ │ │ │ └── 9.sql │ │ │ │ └── up/ │ │ │ │ ├── 0.sql │ │ │ │ ├── 1.sql │ │ │ │ ├── 10.sql │ │ │ │ ├── 11.sql │ │ │ │ ├── 12.sql │ │ │ │ ├── 13.sql │ │ │ │ ├── 14.sql │ │ │ │ ├── 15.sql │ │ │ │ ├── 2.sql │ │ │ │ ├── 3.sql │ │ │ │ ├── 4.sql │ │ │ │ ├── 5.sql │ │ │ │ ├── 6.sql │ │ │ │ ├── 7.sql │ │ │ │ ├── 8.sql │ │ │ │ └── 9.sql │ │ │ └── sqlite3/ │ │ │ ├── down/ │ │ │ │ ├── 0.sql │ │ │ │ ├── 1.sql │ │ │ │ ├── 10.sql │ │ │ │ ├── 11.sql │ │ │ │ ├── 12.sql │ │ │ │ ├── 13.sql │ │ │ │ ├── 14.sql │ │ │ │ ├── 15.sql │ │ │ │ ├── 2.sql │ │ │ │ ├── 3.sql │ │ │ │ ├── 4.sql │ │ │ │ ├── 5.sql │ │ │ │ ├── 6.sql │ │ │ │ ├── 7.sql │ │ │ │ ├── 8.sql │ │ │ │ └── 9.sql │ │ │ └── up/ │ │ │ ├── 0.sql │ │ │ ├── 1.sql │ │ │ ├── 10.sql │ │ │ ├── 11.sql │ │ │ ├── 12.sql │ │ │ ├── 13.sql │ │ │ ├── 14.sql │ │ │ ├── 15.sql │ │ │ ├── 2.sql │ │ │ ├── 3.sql │ │ │ ├── 4.sql │ │ │ ├── 5.sql │ │ │ ├── 6.sql │ │ │ ├── 7.sql │ │ │ ├── 8.sql │ │ │ └── 9.sql │ │ ├── go.mod │ │ ├── go.sum │ │ ├── integration_test.go │ │ ├── migrations/ │ │ │ ├── 20191100000001_users.down.fizz │ │ │ ├── 20191100000001_users.up.fizz │ │ │ ├── 20191100000002_user_notes.down.fizz │ │ │ ├── 20191100000002_user_notes.up.fizz │ │ │ ├── 20191100000003_user_notes_drop_title.down.fizz │ │ │ ├── 20191100000003_user_notes_drop_title.up.fizz │ │ │ ├── 20191100000004_user_notes_add_slug.down.fizz │ │ │ ├── 20191100000004_user_notes_add_slug.up.fizz │ │ │ ├── 20191100000005_user_notes_add_slug.down.fizz │ │ │ ├── 20191100000005_user_notes_add_slug.up.fizz │ │ │ ├── 20191100000006_user_notes_add_slug.down.fizz │ │ │ ├── 20191100000006_user_notes_add_slug.up.fizz │ │ │ ├── 20191100000007_user_notes_rename.down.fizz │ │ │ ├── 20191100000007_user_notes_rename.up.fizz │ │ │ ├── 20191100000008_user_notes_rename_notes.down.fizz │ │ │ ├── 20191100000008_user_notes_rename_notes.up.fizz │ │ │ ├── 20191100000009_users_username.down.fizz │ │ │ ├── 20191100000009_users_username.up.fizz │ │ │ ├── 20191100000010_users_drop_name.down.fizz │ │ │ ├── 20191100000010_users_drop_name.up.fizz │ │ │ ├── 20191100000011_user_posts_change_column.down.fizz │ │ │ ├── 20191100000011_user_posts_change_column.up.fizz │ │ │ ├── 20191100000012_rename_user.down.fizz │ │ │ ├── 20191100000012_rename_user.up.fizz │ │ │ ├── 20191100000013_rename_user_notes_user.down.fizz │ │ │ ├── 20191100000013_rename_user_notes_user.up.fizz │ │ │ ├── 20191100000014_rename_user_add_published.down.fizz │ │ │ ├── 20191100000014_rename_user_add_published.up.fizz │ │ │ ├── 20191100000015_auto_fk.down.fizz │ │ │ ├── 20191100000015_auto_fk.up.fizz │ │ │ ├── 20191100000016_rename_auto_fk.down.fizz │ │ │ └── 20191100000016_rename_auto_fk.up.fizz │ │ ├── migrator_test.go │ │ ├── mysql_test.go │ │ ├── postgres_test.go │ │ └── sqlite3_test.go │ └── migrations/ │ ├── .gitignore │ ├── 20160808213308_setup_tests.down.fizz │ ├── 20160808213308_setup_tests.up.fizz │ ├── 20160808213310_setup_tests2.down.fizz │ ├── 20160808213310_setup_tests2.up.fizz │ └── multiple/ │ ├── 20180413210602_create_users.mysql.up.sql │ ├── 20180413210602_create_users.postgres.up.sql │ ├── 20180413210602_create_users.sqlite3.up.sql │ └── 20180413210602_create_users.up.sql ├── translator.go ├── translators/ │ ├── cockroach.go │ ├── cockroach_meta.go │ ├── cockroach_test.go │ ├── mariadb.go │ ├── mariadb_test.go │ ├── mssqlserver.go │ ├── mssqlserver_test.go │ ├── mysql.go │ ├── mysql_meta.go │ ├── mysql_test.go │ ├── postgres.go │ ├── postgres_test.go │ ├── schema.go │ ├── schema_test.go │ ├── sqlite.go │ ├── sqlite_meta.go │ ├── sqlite_meta_test.go │ ├── sqlite_test.go │ └── translators_test.go └── version.go ================================================ FILE CONTENTS ================================================ ================================================ FILE: .github/CODEOWNERS ================================================ translators/cockroach* @mclark4386 # Default owner * @gobuffalo/core-managers @gobuffalo/database ================================================ FILE: .github/FUNDING.yml ================================================ # These are supported funding model platforms github: [markbates, stanislas-m] patreon: buffalo ================================================ FILE: .github/workflows/standard-stale.yml ================================================ name: Standard Autocloser on: schedule: - cron: "30 1 * * *" jobs: call-standard-autocloser: name: Autocloser uses: gobuffalo/.github/.github/workflows/stale.yml@v1 secrets: inherit ================================================ FILE: .github/workflows/tests.yml ================================================ name: Tests on: push: branches: - main pull_request: jobs: mysql-tests: name: MySQL tests - Go v${{ matrix.go-version }} runs-on: ubuntu-latest strategy: matrix: go-version: - "1.17.x" - "1.18.x" services: mysql: image: mysql:5.7 env: MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: pop_test MYSQL_PORT: 3307 ports: - 3307:3306 # needed because the mysql container does not provide a healthcheck options: --health-cmd "mysqladmin ping -h localhost" --health-interval 5s --health-timeout 5s --health-retries 10 steps: - uses: actions/checkout@v3 - name: Setup Go ${{ matrix.go }} uses: actions/setup-go@v3 with: go-version: ${{ matrix.go-version }} - name: Install and run soda env: SODA_DIALECT: "mysql" MYSQL_PORT: 3307 run: | go install -tags sqlite github.com/gobuffalo/pop/v6/soda@latest soda drop -e $SODA_DIALECT -p ./testdata/migrations soda create -e $SODA_DIALECT -p ./testdata/migrations soda migrate -e $SODA_DIALECT -p ./testdata/migrations - name: Test env: SODA_DIALECT: "mysql" MYSQL_PORT: 3307 run: | go test -v -tags sqlite -race ./... - name: Reset database and run e2e env: SODA_DIALECT: "mysql" run: | soda drop -e $SODA_DIALECT -p ./testdata/migrations soda create -e $SODA_DIALECT -p ./testdata/migrations cd testdata/e2e go test -v -tags sqlite,e2e -race ./... pg-tests: name: PostgreSQL tests - Go v${{ matrix.go-version }} runs-on: ubuntu-latest strategy: matrix: go-version: - "1.17.x" - "1.18.x" services: postgres: image: postgres:10 env: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres POSTGRES_DB: postgres ports: - 5433:5432 # needed because the postgres container does not provide a healthcheck options: --health-cmd pg_isready --health-interval 5s --health-timeout 5s --health-retries 10 steps: - uses: actions/checkout@v3 - name: Setup Go ${{ matrix.go }} uses: actions/setup-go@v3 with: go-version: ${{ matrix.go-version }} - name: Install and run soda env: SODA_DIALECT: "postgres" POSTGRESQL_URL: "postgres://postgres:postgres@${{job.services.postgres.host}}:${{ job.services.postgres.ports[5432] }}/pop_test?sslmode=disable" run: | go install -tags sqlite github.com/gobuffalo/pop/v6/soda@latest soda drop -e $SODA_DIALECT -p ./testdata/migrations soda create -e $SODA_DIALECT -p ./testdata/migrations soda migrate -e $SODA_DIALECT -p ./testdata/migrations - name: Test env: SODA_DIALECT: "postgres" POSTGRESQL_URL: "postgres://postgres:postgres@${{job.services.postgres.host}}:${{ job.services.postgres.ports[5432] }}/pop_test?sslmode=disable" run: | go test -v -tags sqlite -race ./... - name: Reset database and run e2e env: SODA_DIALECT: "postgres" run: | soda drop -e $SODA_DIALECT -p ./testdata/migrations soda create -e $SODA_DIALECT -p ./testdata/migrations cd testdata/e2e go test -v -tags sqlite,e2e -race ./... crdb-tests: name: Cockroach tests - Go v${{ matrix.go-version }} runs-on: ubuntu-latest strategy: matrix: go-version: - "1.17.x" - "1.18.x" steps: - uses: actions/checkout@v3 - name: Setup Go ${{ matrix.go }} uses: actions/setup-go@v3 with: go-version: ${{ matrix.go-version }} - name: Install Cockroach run: | mkdir -p crdb pushd crdb wget -qO- https://binaries.cockroachdb.com/cockroach-v21.1.19.linux-amd64.tgz | tar -xz mv cockroach-v21.1.19.linux-amd64/* . ln -s `pwd`/cockroach /usr/local/bin/ cockroach version ./cockroach start-single-node --insecure --background popd - name: Install and run soda env: SODA_DIALECT: "cockroach" COCKROACH_PORT: 26257 run: | go install -tags sqlite github.com/gobuffalo/pop/v6/soda@latest soda drop -e $SODA_DIALECT -p ./testdata/migrations soda create -e $SODA_DIALECT -p ./testdata/migrations soda migrate -e $SODA_DIALECT -p ./testdata/migrations - name: Test env: SODA_DIALECT: "cockroach" COCKROACH_PORT: 26257 run: | go test -v -tags sqlite -race ./... - name: Reset database and run e2e env: SODA_DIALECT: "cockroach" COCKROACH_PORT: 26257 run: | soda drop -e $SODA_DIALECT -p ./testdata/migrations soda create -e $SODA_DIALECT -p ./testdata/migrations cd testdata/e2e go test -v -tags sqlite,e2e -race ./... sqlite-tests: name: SQLite tests ${{ matrix.os }} - Go v${{ matrix.go-version }} runs-on: ${{ matrix.os }} strategy: matrix: go-version: - "1.17.x" - "1.18.x" os: - "macos-latest" - "windows-latest" - "ubuntu-latest" steps: - name: Install sqlite3 run: choco install sqlite if: matrix.os == 'windows-latest' - uses: actions/checkout@v3 - name: Setup Go ${{ matrix.go }} uses: actions/setup-go@v3 with: go-version: ${{ matrix.go-version }} - name: Install and run soda env: SODA_DIALECT: "sqlite" run: | go install -tags sqlite github.com/gobuffalo/pop/v6/soda@latest soda drop -e $SODA_DIALECT -p ./testdata/migrations soda create -e $SODA_DIALECT -p ./testdata/migrations soda migrate -e $SODA_DIALECT -p ./testdata/migrations shell: bash - name: Test if: ${{ matrix.os != 'windows-latest' }} env: SODA_DIALECT: "sqlite" run: | go test -v -tags sqlite -race ./... shell: bash - name: Test without race detection if: ${{ matrix.os == 'windows-latest' }} env: SODA_DIALECT: "sqlite" run: | go test -v -tags sqlite ./... shell: bash - name: Reset database and run e2e if: ${{ matrix.os != 'windows-latest' }} env: SODA_DIALECT: "sqlite" run: | soda drop -e $SODA_DIALECT -p ./testdata/migrations soda create -e $SODA_DIALECT -p ./testdata/migrations cd testdata/e2e go test -v -tags sqlite,e2e -race ./... shell: bash - name: Reset database and run e2e without race detection if: ${{ matrix.os == 'windows-latest' }} env: SODA_DIALECT: "sqlite" run: | soda drop -e $SODA_DIALECT -p ./testdata/migrations soda create -e $SODA_DIALECT -p ./testdata/migrations cd testdata/e2e go test -v -tags sqlite,e2e ./... shell: bash ================================================ FILE: .gitignore ================================================ *.log .DS_Store doc tmp pkg *.gem *.pid coverage coverage.data build/* *.pbxuser *.mode1v3 .svn profile .console_history .sass-cache/* .rake_tasks~ *.log.lck solr/ .jhw-cache/ jhw.* *.sublime* node_modules/ dist/ generated/ .vendor/ bin/* gin-bin .idea/ .vscode/ cockroach-data/ migrations/schema.sql vendor/ sqldumps/ sql/ ================================================ FILE: LICENSE ================================================ The MIT License (MIT) Copyright (c) 2019 Mark Bates Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: Makefile ================================================ TAGS ?= sqlite GO_BIN ?= go install: $(GO_BIN) install -tags ${TAGS} -v . tidy: $(GO_BIN) mod tidy build: $(GO_BIN) build -v . test: ./test.sh -cover -v lint: go get github.com/golangci/golangci-lint/cmd/golangci-lint golangci-lint run --enable-all update: rm go.* $(GO_BIN) mod init github.com/gobuffalo/fizz $(GO_BIN) mod tidy --go=1.16 ================================================ FILE: README.md ================================================ # Fizz [![Actions Status](https://github.com/gobuffalo/fizz/workflows/Tests/badge.svg)](https://github.com/gobuffalo/fizz/actions) [![Go Reference](https://pkg.go.dev/badge/github.com/gobuffalo/fizz.svg)](https://pkg.go.dev/github.com/gobuffalo/fizz) A Common DSL for Migrating Databases ## Supported Database Engines Fizz supports minimum supported version of all supported database engines. Currently, the following database engines are officially supported. (Since Fizz is used with the migration feature of Pop, supported databases and the versions are correlated with Pop.) * PostgreSQL 10 * MySQL 5.7 / MariaDB 10.3 * SQLite3 3.22 * CockroachDB v21.1 * MSSQL 2017 (not fully supported) ## Usage ### Create a Table ``` javascript create_table("users") { t.Column("id", "integer", {primary: true}) t.Column("email", "string", {}) t.Column("twitter_handle", "string", {"size": 50}) t.Column("age", "integer", {"default": 0}) t.Column("admin", "bool", {"default": false}) t.Column("company_id", "uuid", {"default_raw": "uuid_generate_v1()"}) t.Column("bio", "text", {"null": true}) t.Column("joined_at", "timestamp", {}) t.Index("email", {"unique": true}) } create_table("todos") { t.Column("user_id", "integer", {}) t.Column("title", "string", {"size": 100}) t.Column("details", "text", {"null": true}) t.ForeignKey("user_id", {"users": ["id"]}, {"on_delete": "cascade"}) } ``` The `id` column don't have to be an integer. For instance, your can use an UUID type instead: ```javascript create_table("users") { t.Column("id", "uuid", {primary: true}) // ... } ``` By default, fizz will generate two `timestamp` columns: `created_at` and `updated_at`. The `t.Columns` method takes the following arguments: name of the column, the type of the field, and finally the last argument is any options you want to set on that column. #### "Common" Types: * `string` * `text` * `timestamp`, `time`, `datetime` * `integer` * `bool` * `uuid` Any other type passed it will be be passed straight through to the underlying database. For example for PostgreSQL you could pass `jsonb`and it will be supported, however, SQLite will yell very loudly at you if you do the same thing! #### 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`. * `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"}` * `first` - (MySQL Only) Add a column to the first position in the table. `example: {"first": true}` #### Composite primary key ```javascript create_table("user_privileges") { t.Column("user_id", "int") t.Column("privilege_id", "int") t.PrimaryKey("user_id", "privilege_id") } ``` Please note that the `t.PrimaryKey` statement MUST be after the columns definitions. ### Drop a Table ``` javascript drop_table("table_name") ``` ### Rename a Table ``` javascript rename_table("old_table_name", "new_table_name") ``` ### Add a Column ``` javascript add_column("table_name", "column_name", "string", {}) ``` See [above](#column-info) for more details on column types and options. ### Alter a column ``` javascript change_column("table_name", "column_name", "string", {}) ``` ### Rename a Column ``` javascript rename_column("table_name", "old_column_name", "new_column_name") ``` ### Drop a Column ``` javascript drop_column("table_name", "column_name") ``` ### Add an Index #### Supported Options: * `name` - This defaults to `table_name_column_name_idx` * `unique` #### Simple Index: ``` javascript add_index("table_name", "column_name", {}) ``` #### Multi-Column Index: ``` javascript add_index("table_name", ["column_1", "column_2"], {}) ``` #### Unique Index: ``` javascript add_index("table_name", "column_name", {"unique": true}) ``` #### Index Names: ``` javascript add_index("table_name", "column_name", {}) # name => table_name_column_name_idx add_index("table_name", "column_name", {"name": "custom_index_name"}) ``` ### Rename an Index ``` javascript rename_index("table_name", "old_index_name", "new_index_name") ``` ### Drop an Index ``` javascript drop_index("table_name", "index_name") ``` ### Add a Foreign Key ```javascript add_foreign_key("table_name", "field", {"ref_table_name": ["ref_column"]}, { "name": "optional_fk_name", "on_delete": "action", "on_update": "action", }) ``` #### Supported Options * `name` - This defaults to `table_name_ref_table_name_ref_column_name_fk` * `on_delete` - `CASCADE`, `SET NULL`, ... * `on_update` **Note:** `on_update` and `on_delete` are not supported on CockroachDB yet. ### Drop a Foreign Key ```javascript drop_foreign_key("table_name", "fk_name", {"if_exists": true}) ``` #### Supported Options * `if_exists` - Adds `IF EXISTS` condition ### Raw SQL ``` javascript sql("select * from users;") ``` ### Execute an External Command Sometimes during a migration you need to shell out to an external command. ```javascript exec("echo hello") ``` ## Development ### Testing To run end-to-end tests, use ``` make test ``` If you made changes to the end-to-end tests and want to update the fixtures, run the following command a couple of times until tests pass: ``` REFRESH_FIXTURES=true make test ``` ================================================ FILE: SHOULDERS.md ================================================ # Fizz Stands on the Shoulders of Giants Fizz does not try to reinvent the wheel! Instead, it uses the already great wheels developed by the Go community and puts them all together in the best way possible. Without these giants, this project would not be possible. Please make sure to check them out and thank them for all of their hard work. Thank you to the following **GIANTS**: * [github.com/Masterminds/semver/v3](https://godoc.org/github.com/Masterminds/semver/v3) * [github.com/aymerick/douceur](https://godoc.org/github.com/aymerick/douceur) * [github.com/davecgh/go-spew](https://godoc.org/github.com/davecgh/go-spew) * [github.com/fatih/structs](https://godoc.org/github.com/fatih/structs) * [github.com/go-sql-driver/mysql](https://godoc.org/github.com/go-sql-driver/mysql) * [github.com/gobuffalo/flect](https://godoc.org/github.com/gobuffalo/flect) * [github.com/gobuffalo/github_flavored_markdown](https://godoc.org/github.com/gobuffalo/github_flavored_markdown) * [github.com/gobuffalo/helpers](https://godoc.org/github.com/gobuffalo/helpers) * [github.com/gobuffalo/plush/v4](https://godoc.org/github.com/gobuffalo/plush/v4) * [github.com/gobuffalo/tags/v3](https://godoc.org/github.com/gobuffalo/tags/v3) * [github.com/gobuffalo/validate/v3](https://godoc.org/github.com/gobuffalo/validate/v3) * [github.com/gofrs/uuid](https://godoc.org/github.com/gofrs/uuid) * [github.com/gorilla/css](https://godoc.org/github.com/gorilla/css) * [github.com/kballard/go-shellquote](https://godoc.org/github.com/kballard/go-shellquote) * [github.com/kr/pretty](https://godoc.org/github.com/kr/pretty) * [github.com/kr/pty](https://godoc.org/github.com/kr/pty) * [github.com/kr/text](https://godoc.org/github.com/kr/text) * [github.com/microcosm-cc/bluemonday](https://godoc.org/github.com/microcosm-cc/bluemonday) * [github.com/pmezard/go-difflib](https://godoc.org/github.com/pmezard/go-difflib) * [github.com/sergi/go-diff](https://godoc.org/github.com/sergi/go-diff) * [github.com/sourcegraph/annotate](https://godoc.org/github.com/sourcegraph/annotate) * [github.com/sourcegraph/syntaxhighlight](https://godoc.org/github.com/sourcegraph/syntaxhighlight) * [github.com/stretchr/objx](https://godoc.org/github.com/stretchr/objx) * [github.com/stretchr/testify](https://godoc.org/github.com/stretchr/testify) * [golang.org/x/net](https://godoc.org/golang.org/x/net) * [golang.org/x/sync](https://godoc.org/golang.org/x/sync) * [golang.org/x/sys](https://godoc.org/golang.org/x/sys) * [golang.org/x/term](https://godoc.org/golang.org/x/term) * [golang.org/x/text](https://godoc.org/golang.org/x/text) * [golang.org/x/tools](https://godoc.org/golang.org/x/tools) * [gopkg.in/check.v1](https://godoc.org/gopkg.in/check.v1) * [gopkg.in/yaml.v2](https://godoc.org/gopkg.in/yaml.v2) * [gopkg.in/yaml.v3](https://godoc.org/gopkg.in/yaml.v3) ================================================ FILE: bubbler.go ================================================ package fizz import ( "os" "strings" "github.com/gobuffalo/plush/v4" ) type BubbleType int type Bubbler struct { Translator data []string } func NewBubbler(t Translator) *Bubbler { return &Bubbler{ Translator: t, data: []string{}, } } func (b *Bubbler) String() string { return strings.Join(b.data, "\n") } func (b *Bubbler) Bubble(s string) (string, error) { f := fizzer{b} ctx := plush.NewContextWith(map[string]interface{}{ "exec": f.Exec(os.Stdout), "create_table": f.CreateTable, "change_column": f.ChangeColumn, "add_column": f.AddColumn, "drop_column": f.DropColumn, "rename_column": f.RenameColumn, "raw": f.RawSQL, "sql": f.RawSQL, "add_index": f.AddIndex, "drop_index": f.DropIndex, "rename_index": f.RenameIndex, "add_foreign_key": f.AddForeignKey, "drop_foreign_key": f.DropForeignKey, "drop_table": f.DropTable, "rename_table": f.RenameTable, }) err := plush.RunScript(s, ctx) return b.String(), err } ================================================ FILE: bubbler_test.go ================================================ package fizz import ( "bytes" "strings" "testing" "github.com/stretchr/testify/require" ) func Test_Exec(t *testing.T) { r := require.New(t) b := NewBubbler(nil) f := fizzer{b} bb := &bytes.Buffer{} c := f.Exec(bb) r.NoError(c("echo hello")) r.Equal("hello", strings.TrimSpace(bb.String())) } func Test_ExecQuoted(t *testing.T) { r := require.New(t) b := NewBubbler(nil) f := fizzer{b} bb := &bytes.Buffer{} c := f.Exec(bb) // without proper splitting we would get "'a b c'" r.NoError(c("echo 'a b c'")) r.Equal("a b c", strings.TrimSpace(bb.String())) } ================================================ FILE: columns.go ================================================ package fizz import ( "encoding/json" "fmt" "sort" "strings" ) // Deprecated: Fizz won't force you to have an ID field now. var INT_ID_COL = Column{ Name: "id", Primary: true, ColType: "integer", Options: Options{}, } // Deprecated: Fizz won't force you to have an ID field now. var UUID_ID_COL = Column{ Name: "id", Primary: true, ColType: "uuid", Options: Options{}, } var CREATED_COL = Column{Name: "created_at", ColType: "timestamp", Options: nil} var UPDATED_COL = Column{Name: "updated_at", ColType: "timestamp", Options: nil} type Column struct { Name string ColType string Primary bool Options map[string]interface{} } func (c Column) String() string { if c.Primary || c.Options != nil { var opts map[string]interface{} if c.Options == nil { opts = make(map[string]interface{}) } else { opts = c.Options } if c.Primary { opts["primary"] = true } o := make([]string, 0, len(opts)) for k, v := range opts { vv, _ := json.Marshal(v) o = append(o, fmt.Sprintf("%s: %s", k, string(vv))) } sort.SliceStable(o, func(i, j int) bool { return o[i] < o[j] }) return fmt.Sprintf(`t.Column("%s", "%s", {%s})`, c.Name, c.ColType, strings.Join(o, ", ")) } return fmt.Sprintf(`t.Column("%s", "%s")`, c.Name, c.ColType) } func (f fizzer) ChangeColumn(table, name, ctype string, options Options) error { t := Table{ Name: table, Columns: []Column{ {Name: name, ColType: ctype, Options: options}, }, } return f.add(f.Bubbler.ChangeColumn(t)) } func (f fizzer) AddColumn(table, name, ctype string, options Options) error { t := Table{ Name: table, Columns: []Column{ {Name: name, ColType: ctype, Options: options}, }, } return f.add(f.Bubbler.AddColumn(t)) } func (f fizzer) DropColumn(table, name string) error { t := Table{ Name: table, Columns: []Column{ {Name: name}, }, } return f.add(f.Bubbler.DropColumn(t)) } func (f fizzer) RenameColumn(table, old, new string) error { t := Table{ Name: table, Columns: []Column{ {Name: old}, {Name: new}, }, } return f.add(f.Bubbler.RenameColumn(t)) } ================================================ FILE: columns_test.go ================================================ package fizz_test import ( "testing" "github.com/gobuffalo/fizz" "github.com/stretchr/testify/require" ) func Test_Column_Stringer(t *testing.T) { t.Run("primary column", func(tt *testing.T) { r := require.New(tt) c := fizz.Column{ Name: "pk", ColType: "int", Primary: true, } r.Equal(`t.Column("pk", "int", {primary: true})`, c.String()) }) t.Run("primary column with raw default", func(tt *testing.T) { r := require.New(tt) c := fizz.Column{ Name: "pk", ColType: "int", Primary: true, Options: map[string]interface{}{ "default_raw": "uuid_generate_v4()", }, } r.Equal(`t.Column("pk", "int", {default_raw: "uuid_generate_v4()", primary: true})`, c.String()) }) t.Run("simple column", func(tt *testing.T) { r := require.New(tt) c := fizz.Column{ Name: "name", ColType: "string", } r.Equal(`t.Column("name", "string")`, c.String()) }) t.Run("with option", func(tt *testing.T) { r := require.New(tt) c := fizz.Column{ Name: "alive", ColType: "boolean", Options: map[string]interface{}{ "null": true, }, } r.Equal(`t.Column("alive", "boolean", {null: true})`, c.String()) }) t.Run("with string option", func(tt *testing.T) { r := require.New(tt) c := fizz.Column{ Name: "price", ColType: "numeric", Options: map[string]interface{}{ "default": "1.00", }, } r.Equal(`t.Column("price", "numeric", {default: "1.00"})`, c.String()) }) } ================================================ FILE: database.yml ================================================ mysql: dialect: "mysql" database: "pop_test" host: {{ envOr "MYSQL_HOST" "127.0.0.1" }} port: {{ envOr "MYSQL_PORT" "3307" }} user: {{ envOr "MYSQL_USER" "root" }} password: {{ envOr "MYSQL_PASSWORD" "root" }} postgres: url: "postgres://postgres:postgres@localhost:5433/pop_test?sslmode=disable" pool: 25 cockroach: # url: "cockroach://root@127.0.0.1:26258/pop_test?application_name=cockroach&sslmode=disable" dialect: "cockroach" database: "pop_test" host: {{ envOr "COCKROACH_HOST" "127.0.0.1" }} port: {{ envOr "COCKROACH_PORT" "26258" }} user: {{ envOr "COCKROACH_USER" "root" }} password: {{ envOr "COCKROACH_PASSWORD" "" }} options: sslmode: disable sqlserver: dialect: "sqlserver" database: "pop_test" host: {{ envOr "MSSQLSERVER_HOST" "127.0.0.1" }} port: {{ envOr "MSSQLSERVER_PORT" "1433" }} user: {{ envOr "MSSQLSERVER_USER" "sa" }} password: {{ envOr "MSSQLSERVER_PASSWORD" "Tt@12345678" }} sqlite: dialect: "sqlite3" database: "./tmp/test.sqlite" options: mode: rwc ================================================ FILE: docker-compose.yml ================================================ version: '2' services: mysql: image: mysql:5.7 environment: - MYSQL_ROOT_PASSWORD=root - MYSQL_DATABASE=pop_test - MYSQL_USER=pop - MYSQL_PASSWORD=pop #volumes: #- ./_vol/mysql:/docker-entrypoint-initdb.d ports: - "3307:3306" healthcheck: test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"] interval: 5s timeout: 5s retries: 10 start_period: 3s postgres: image: postgres:10 environment: - POSTGRES_DB=pop_test - POSTGRES_PASSWORD=postgres ports: - "5433:5432" #volumes: #- ./_vol/postgres:/docker-entrypoint-initdb.d healthcheck: test: ["CMD", "pg_isready"] interval: 5s timeout: 5s retries: 10 start_period: 3s cockroach: image: cockroachdb/cockroach:latest-v21.1 ports: - "26258:26257" - "8081:8080" #volumes: #- ./_vol/cockroach:/cockroach/cockroach-data command: start-single-node --insecure healthcheck: test: ["CMD", "curl", "http://localhost:8080/health"] interval: 5s timeout: 5s retries: 10 start_period: 3s # mssqlserver: # image: "microsoft/mssql-server-linux" # environment: # - SA_PASSWORD=Tt@12345678 # - MSSQLSERVER_PASSWORD=Tt@12345678 # - ACCEPT_EULA=Y # ports: # - "1433:1433" ================================================ FILE: fizz.go ================================================ /* Package fizz is a common DSL for writing SQL migrations */ package fizz import ( "io" "io/ioutil" "os" "os/exec" shellquote "github.com/kballard/go-shellquote" ) // Options is a generic map of options. type Options map[string]interface{} type fizzer struct { Bubbler *Bubbler } func (f fizzer) add(s string, err error) error { if err != nil { return err } f.Bubbler.data = append(f.Bubbler.data, s) return nil } func (f fizzer) Exec(out io.Writer) func(string) error { return func(s string) error { args, err := shellquote.Split(s) if err != nil { return err } cmd := exec.Command(args[0], args[1:]...) cmd.Stdin = os.Stdin cmd.Stdout = out cmd.Stderr = os.Stderr err = cmd.Run() if err != nil { return err } return nil } } // AFile reads in a fizz migration from an io.Reader and translates its contents to SQL. func AFile(f io.Reader, t Translator) (string, error) { b, err := ioutil.ReadAll(f) if err != nil { return "", err } return AString(string(b), t) } // AString reads a fizz string, and translates its contents to SQL. func AString(s string, t Translator) (string, error) { b := NewBubbler(t) return b.Bubble(s) } ================================================ FILE: foreign_keys.go ================================================ package fizz import ( "encoding/json" "fmt" "sort" "strings" ) type ForeignKeyRef struct { Table string Columns []string } type ForeignKey struct { Name string Column string References ForeignKeyRef Options Options } func (f ForeignKey) String() string { refs := fmt.Sprintf(`{"%s": ["%s"]}`, f.References.Table, strings.Join(f.References.Columns, `", "`)) var opts map[string]interface{} if f.Options == nil { opts = make(map[string]interface{}) } else { opts = f.Options } o := make([]string, 0, len(opts)) for k, v := range opts { vv, _ := json.Marshal(v) o = append(o, fmt.Sprintf("%s: %s", k, string(vv))) } sort.SliceStable(o, func(i, j int) bool { return o[i] < o[j] }) return fmt.Sprintf(`t.ForeignKey("%s", %s, {%s})`, f.Column, refs, strings.Join(o, ", ")) } func (f fizzer) AddForeignKey(table string, column string, refs interface{}, options Options) error { fkr, err := parseForeignKeyRef(refs) if err != nil { return err } fk := ForeignKey{ Column: column, References: fkr, Options: options, } if options["name"] != nil { var ok bool fk.Name, ok = options["name"].(string) if !ok { return fmt.Errorf(`expected options field "name" to be of type "string" but got "%T"`, options["name"]) } } else { fk.Name = fmt.Sprintf("%s_%s_%s_fk", table, fk.References.Table, strings.Join(fk.References.Columns, "_")) } return f.add(f.Bubbler.AddForeignKey(Table{ Name: table, ForeignKeys: []ForeignKey{fk}, })) } func (f fizzer) DropForeignKey(table string, fk string, options Options) error { return f.add(f.Bubbler.DropForeignKey(Table{ Name: table, ForeignKeys: []ForeignKey{ { Name: fk, Options: options, }, }, })) } func parseForeignKeyRef(refs interface{}) (ForeignKeyRef, error) { fkr := ForeignKeyRef{} refMap, ok := refs.(map[string]interface{}) if !ok { return fkr, fmt.Errorf(`invalid references format %s\nmust be "{"table": ["colum1", "column2"]}"`, refs) } if len(refMap) != 1 { return fkr, fmt.Errorf("only one table is supported as Foreign key reference") } for table, columns := range refMap { fkr.Table = table for _, c := range columns.([]interface{}) { fkr.Columns = append(fkr.Columns, fmt.Sprintf("%s", c)) } } return fkr, nil } ================================================ FILE: go.mod ================================================ module github.com/gobuffalo/fizz go 1.16 require ( github.com/Masterminds/semver/v3 v3.1.1 github.com/go-sql-driver/mysql v1.6.0 github.com/gobuffalo/plush/v4 v4.1.16 github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 github.com/stretchr/testify v1.8.0 ) ================================================ FILE: go.sum ================================================ github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk= github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= 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/gobuffalo/flect v0.3.0 h1:erfPWM+K1rFNIQeRPdeEXxo8yFr/PO17lhRnS8FUrtk= github.com/gobuffalo/flect v0.3.0/go.mod h1:5pf3aGnsvqvCj50AVni7mJJF8ICxGZ8HomberC3pXLE= github.com/gobuffalo/github_flavored_markdown v1.1.3 h1:rSMPtx9ePkFB22vJ+dH+m/EUBS8doQ3S8LeEXcdwZHk= github.com/gobuffalo/github_flavored_markdown v1.1.3/go.mod h1:IzgO5xS6hqkDmUh91BW/+Qxo/qYnvfzoz3A7uLkg77I= github.com/gobuffalo/helpers v0.6.7 h1:C9CedoRSfgWg2ZoIkVXgjI5kgmSpL34Z3qdnzpfNVd8= github.com/gobuffalo/helpers v0.6.7/go.mod h1:j0u1iC1VqlCaJEEVkZN8Ia3TEzfj/zoXANqyJExTMTA= github.com/gobuffalo/plush/v4 v4.1.16 h1:Y6jVVTLdg1BxRXDIbTJz+J8QRzEAtv5ZwYpGdIFR7VU= github.com/gobuffalo/plush/v4 v4.1.16/go.mod h1:6t7swVsarJ8qSLw1qyAH/KbrcSTwdun2ASEQkOznakg= github.com/gobuffalo/tags/v3 v3.1.4 h1:X/ydLLPhgXV4h04Hp2xlbI2oc5MDaa7eub6zw8oHjsM= github.com/gobuffalo/tags/v3 v3.1.4/go.mod h1:ArRNo3ErlHO8BtdA0REaZxijuWnWzF6PUXngmMXd2I0= github.com/gobuffalo/validate/v3 v3.3.3 h1:o7wkIGSvZBYBd6ChQoLxkz2y1pfmhbI4jNJYh6PuNJ4= github.com/gobuffalo/validate/v3 v3.3.3/go.mod h1:YC7FsbJ/9hW/VjQdmXPvFqvRis4vrRYFxr69WiNZw6g= github.com/gofrs/uuid v4.2.0+incompatible h1:yyYWMnhkhrKwwr8gAOcOCYxOOscHgDS9yZgBrnJfGa0= github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY= github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= 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/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/microcosm-cc/bluemonday v1.0.20 h1:flpzsq4KU3QIYAYGV/szUat7H+GPOXR0B2JU5A1Wp8Y= github.com/microcosm-cc/bluemonday v1.0.20/go.mod h1:yfBmMi8mxvaZut3Yytv+jTXRY8mxyjJ0/kQBTElld50= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 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= github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d h1:yKm7XZV6j9Ev6lojP2XaIshpT4ymkqhMeSghO5Ps00E= 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/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221002022538-bcab6841153b h1:6e93nYa3hNqAvLr0pD4PN1fFS+gKzp2zAXqrnTCstqU= golang.org/x/net v0.0.0-20221002022538-bcab6841153b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0 h1:cu5kTvlzcw1Q5S9f5ip1/cpiB4nXvw1XYzFPGgzLUOY= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 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/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= ================================================ FILE: index.go ================================================ package fizz import ( "encoding/json" "fmt" "sort" "strings" ) // Index is the index definition for fizz. type Index struct { Name string Columns []string Unique bool Options Options } func (i Index) String() string { var opts map[string]interface{} if i.Options == nil { opts = make(map[string]interface{}) } else { opts = i.Options } if i.Name != "" { opts["name"] = i.Name } if i.Unique { opts["unique"] = true } o := make([]string, 0, len(opts)) for k, v := range opts { vv, _ := json.Marshal(v) o = append(o, fmt.Sprintf("%s: %s", k, string(vv))) } sort.SliceStable(o, func(i, j int) bool { return o[i] < o[j] }) if len(i.Columns) > 1 { cols := make([]string, len(i.Columns)) for k, v := range i.Columns { cols[k] = `"` + v + `"` } return fmt.Sprintf(`t.Index([%s], {%s})`, strings.Join(cols, ", "), strings.Join(o, ", ")) } return fmt.Sprintf(`t.Index("%s", {%s})`, i.Columns[0], strings.Join(o, ", ")) } func (f fizzer) AddIndex(table string, columns interface{}, options Options) error { t := NewTable(table, nil) if err := t.Index(columns, options); err != nil { return err } return f.add(f.Bubbler.AddIndex(t)) } func (f fizzer) DropIndex(table, name string) error { return f.add(f.Bubbler.DropIndex(Table{ Name: table, Indexes: []Index{ {Name: name}, }, })) } func (f fizzer) RenameIndex(table, old, new string) error { return f.add(f.Bubbler.RenameIndex(Table{ Name: table, Indexes: []Index{ {Name: old}, {Name: new}, }, })) } ================================================ FILE: raw_sql.go ================================================ package fizz import ( "strings" ) func (f fizzer) RawSQL(sql string) error { if !strings.HasSuffix(sql, ";") { sql += ";" } return f.add(sql, nil) } // Deprecated: use RawSQL instead. func (f fizzer) RawSql(sql string) error { return f.RawSQL(sql) } ================================================ FILE: tables.go ================================================ package fizz import ( "bytes" "encoding/json" "errors" "fmt" "sort" "strings" "github.com/gobuffalo/plush/v4" ) // Table is the table definition for fizz. type Table struct { Name string `db:"name"` Columns []Column Indexes []Index ForeignKeys []ForeignKey primaryKeys []string Options map[string]interface{} columnsCache map[string]struct{} useTimestampMacro bool } func (t Table) String() string { return t.Fizz() } // Fizz returns the fizz DDL to create the table. func (t Table) Fizz() string { var buff bytes.Buffer timestampsOpt, _ := t.Options["timestamps"].(bool) // Write table options o := make([]string, 0, len(t.Options)) for k, v := range t.Options { // Special handling for timestamps option if k == "timestamps" { continue } vv, _ := json.Marshal(v) o = append(o, fmt.Sprintf("%s: %s", k, string(vv))) } if len(o) > 0 { sort.SliceStable(o, func(i, j int) bool { return o[i] < o[j] }) buff.WriteString(fmt.Sprintf("create_table(\"%s\", {%s}) {\n", t.Name, strings.Join(o, ", "))) } else { buff.WriteString(fmt.Sprintf("create_table(\"%s\") {\n", t.Name)) } // Write columns if t.useTimestampMacro { for _, c := range t.Columns { if c.Name == "created_at" || c.Name == "updated_at" { continue } buff.WriteString(fmt.Sprintf("\t%s\n", c.String())) } } else { for _, c := range t.Columns { buff.WriteString(fmt.Sprintf("\t%s\n", c.String())) } } if t.useTimestampMacro { buff.WriteString("\tt.Timestamps()\n") } else if timestampsOpt { // Missing timestamp columns will only be added on fizz execution, so we need to consider them as present. if !t.HasColumns("created_at") { buff.WriteString(fmt.Sprintf("\t%s\n", CREATED_COL.String())) } if !t.HasColumns("updated_at") { buff.WriteString(fmt.Sprintf("\t%s\n", UPDATED_COL.String())) } } // Write primary key (single column pk will be written in inline form as the column opt) if len(t.primaryKeys) > 1 { pks := make([]string, len(t.primaryKeys)) for i, pk := range t.primaryKeys { pks[i] = fmt.Sprintf("\"%s\"", pk) } buff.WriteString(fmt.Sprintf("\tt.PrimaryKey(%s)\n", strings.Join(pks, ", "))) } // Write indexes for _, i := range t.Indexes { buff.WriteString(fmt.Sprintf("\t%s\n", i.String())) } // Write foreign keys for _, fk := range t.ForeignKeys { buff.WriteString(fmt.Sprintf("\t%s\n", fk.String())) } buff.WriteString("}") return buff.String() } // UnFizz returns the fizz DDL to remove the table. func (t Table) UnFizz() string { return fmt.Sprintf("drop_table(\"%s\")", t.Name) } func (t *Table) DisableTimestamps() { t.Options["timestamps"] = false } // Column adds a column to the table definition. func (t *Table) Column(name string, colType string, options Options) error { if _, found := t.columnsCache[name]; found { return fmt.Errorf("duplicated column %s", name) } var primary bool if _, ok := options["primary"]; ok { if t.primaryKeys != nil { return errors.New("could not define multiple primary keys") } primary = true t.primaryKeys = []string{name} } c := Column{ Name: name, ColType: colType, Options: options, Primary: primary, } if t.columnsCache == nil { t.columnsCache = make(map[string]struct{}) } t.columnsCache[name] = struct{}{} // Ensure id is first if name == "id" { t.Columns = append([]Column{c}, t.Columns...) } else { t.Columns = append(t.Columns, c) } if (name == "created_at" || name == "updated_at") && colType != "timestamp" { // timestamp macro only works for time type t.useTimestampMacro = false } return nil } // ForeignKey adds a new foreign key to the table definition. func (t *Table) ForeignKey(column string, refs interface{}, options Options) error { fkr, err := parseForeignKeyRef(refs) if err != nil { return err } fk := ForeignKey{ Column: column, References: fkr, Options: options, } if options["name"] != nil { var ok bool fk.Name, ok = options["name"].(string) if !ok { return fmt.Errorf(`expected options field "name" to be of type "string" but got "%T"`, options["name"]) } } else { fk.Name = fmt.Sprintf("%s_%s_%s_fk", t.Name, fk.References.Table, strings.Join(fk.References.Columns, "_")) } t.ForeignKeys = append(t.ForeignKeys, fk) return nil } // Index adds a new index to the table definition. func (t *Table) Index(columns interface{}, options Options) error { i := Index{} switch tp := columns.(type) { default: return fmt.Errorf("unexpected type %T for %s index columns", tp, t.Name) // %T prints whatever type t has case string: i.Columns = []string{tp} case []string: if len(tp) == 0 { return fmt.Errorf("expected at least one column to apply %s index", t.Name) } i.Columns = tp case []interface{}: if len(tp) == 0 { return fmt.Errorf("expected at least one column to apply %s index", t.Name) } cl := make([]string, len(tp)) for i, c := range tp { var ok bool cl[i], ok = c.(string) if !ok { return fmt.Errorf(`expected variable to be of type "string" but got "%T"`, c) } } i.Columns = cl } if options["name"] != nil { var ok bool i.Name, ok = options["name"].(string) if !ok { return fmt.Errorf(`expected options field "name" to be of type "string" but got "%T"`, options["name"]) } } else { i.Name = fmt.Sprintf("%s_%s_idx", t.Name, strings.Join(i.Columns, "_")) } unique, _ := options["unique"].(bool) i.Unique = unique t.Indexes = append(t.Indexes, i) return nil } // Timestamp is a shortcut to add a timestamp column with default options. func (t *Table) Timestamp(name string) error { return t.Column(name, "timestamp", Options{}) } // Timestamps adds created_at and updated_at columns to the Table definition. func (t *Table) Timestamps() error { if err := t.Timestamp("created_at"); err != nil { return err } return t.Timestamp("updated_at") } // PrimaryKey adds a primary key to the table. It's useful to define a composite // primary key. func (t *Table) PrimaryKey(pk ...string) error { if len(pk) == 0 { return errors.New("missing columns for primary key") } if t.primaryKeys != nil { return errors.New("duplicate primary key") } if !t.HasColumns(pk...) { return errors.New("columns must be declared before the primary key") } if len(pk) == 1 { for i, c := range t.Columns { if c.Name == pk[0] { t.Columns[i].Primary = true break } } } t.primaryKeys = make([]string, 0) t.primaryKeys = append(t.primaryKeys, pk...) return nil } // PrimaryKeys gets the list of registered primary key fields. func (t *Table) PrimaryKeys() []string { return t.primaryKeys } // ColumnNames returns the names of the Table's columns. func (t *Table) ColumnNames() []string { cols := make([]string, len(t.Columns)) for i, c := range t.Columns { cols[i] = c.Name } return cols } // HasColumns checks if the Table has all the given columns. func (t *Table) HasColumns(args ...string) bool { for _, a := range args { if _, ok := t.columnsCache[a]; !ok { // Just because the cache couldn't find the column doesn't mean it's not there. // Let's see if it really doesn't exist! var found bool for _, name := range t.ColumnNames() { if found = name == a; found { break } } return found } } return true } // NewTable creates a new Table. func NewTable(name string, opts map[string]interface{}) Table { if opts == nil { opts = make(map[string]interface{}) } // auto-timestamp as default if enabled, exists := opts["timestamps"]; !exists || enabled == true { opts["timestamps"] = true } useTimestampMacro, _ := opts["timestamps"].(bool) return Table{ Name: name, Columns: []Column{}, Indexes: []Index{}, Options: opts, columnsCache: map[string]struct{}{}, useTimestampMacro: useTimestampMacro, } } func (f fizzer) CreateTable(name string, opts map[string]interface{}, help plush.HelperContext) error { t := NewTable(name, opts) if help.HasBlock() { ctx := help.Context.New() ctx.Set("t", &t) if _, err := help.BlockWith(ctx); err != nil { return err } } if t.Options["timestamps"].(bool) { if !t.HasColumns("created_at") { if err := t.Timestamp("created_at"); err != nil { return err } } if !t.HasColumns("updated_at") { if err := t.Timestamp("updated_at"); err != nil { return err } } } return f.add(f.Bubbler.CreateTable(t)) } func (f fizzer) DropTable(name string) error { return f.add(f.Bubbler.DropTable(Table{Name: name})) } func (f fizzer) RenameTable(old, new string) error { return f.add(f.Bubbler.RenameTable([]Table{ {Name: old}, {Name: new}, })) } ================================================ FILE: tables_private_test.go ================================================ package fizz import ( "testing" "github.com/stretchr/testify/require" ) func Test_Table_HasColumnNoCache(t *testing.T) { r := require.New(t) table := NewTable("users", nil) r.NoError(table.Column("firstname", "string", nil)) r.NoError(table.Column("lastname", "string", nil)) table.columnsCache = map[string]struct{}{} r.True(table.HasColumns("firstname", "lastname")) r.False(table.HasColumns("age")) } ================================================ FILE: tables_test.go ================================================ package fizz_test import ( "testing" "github.com/gobuffalo/fizz" "github.com/stretchr/testify/require" ) func Test_Table_Stringer(t *testing.T) { r := require.New(t) expected := `create_table("users") { t.Column("name", "string") t.Column("alive", "boolean", {null: true}) t.Column("birth_date", "timestamp", {null: true}) t.Column("bio", "text", {null: true}) t.Column("price", "numeric", {default: "1.00", null: true}) t.Column("email", "string", {default: "foo@example.com", size: 50}) t.Timestamps() }` table := fizz.NewTable("users", nil) r.NoError(table.Column("name", "string", nil)) r.NoError(table.Column("alive", "boolean", fizz.Options{ "null": true, })) r.NoError(table.Column("birth_date", "timestamp", fizz.Options{ "null": true, })) r.NoError(table.Column("bio", "text", fizz.Options{ "null": true, })) r.NoError(table.Column("price", "numeric", fizz.Options{ "null": true, "default": "1.00", })) r.NoError(table.Column("email", "string", fizz.Options{ "size": 50, "default": "foo@example.com", })) r.Equal(expected, table.String()) } func Test_Table_StringerOpts(t *testing.T) { r := require.New(t) // Timestamps expected := `create_table("users") { t.Column("name", "string") t.Timestamps() }` table := fizz.NewTable("users", map[string]interface{}{ "timestamps": true, }) r.NoError(table.Column("name", "string", nil)) r.Equal(expected, table.String()) // Random option expected = `create_table("users", {myopt: "test"}) { t.Column("name", "string") t.Timestamps() }` table = fizz.NewTable("users", map[string]interface{}{ "myopt": "test", }) r.NoError(table.Column("name", "string", nil)) r.Equal(expected, table.String()) } func Test_Table_StringerAutoDisableTimestamps(t *testing.T) { r := require.New(t) // Custom type timestamps expected := `create_table("users") { t.Column("name", "string") t.Column("created_at", "int") t.Column("updated_at", "int") }` table := fizz.NewTable("users", map[string]interface{}{ "timestamps": true, }) r.NoError(table.Column("name", "string", nil)) r.NoError(table.Column("created_at", "int", nil)) r.NoError(table.Column("updated_at", "int", nil)) r.Equal(expected, table.String()) // only one timestamp override expected = `create_table("users") { t.Column("name", "string") t.Column("created_at", "int") t.Column("updated_at", "timestamp") }` table = fizz.NewTable("users", map[string]interface{}{ "timestamps": true, }) r.NoError(table.Column("name", "string", nil)) r.NoError(table.Column("created_at", "int", nil)) r.Equal(expected, table.String()) // timestamp columns provided but same as default expected = `create_table("users") { t.Column("name", "string") t.Timestamps() }` table = fizz.NewTable("users", map[string]interface{}{ "timestamps": true, }) r.NoError(table.Column("name", "string", nil)) r.NoError(table.Column("created_at", "timestamp", nil)) r.NoError(table.Column("updated_at", "timestamp", nil)) r.Equal(expected, table.String()) } func Test_Table_StringerIndex(t *testing.T) { r := require.New(t) // Single column index expected := `create_table("users") { t.Column("name", "string") t.Column("email", "string") t.Timestamps() t.Index("email", {name: "users_email_idx", unique: true}) }` table := fizz.NewTable("users", nil) r.NoError(table.Column("name", "string", nil)) r.NoError(table.Column("email", "string", nil)) r.NoError(table.Index("email", fizz.Options{ "unique": true, })) r.Equal(expected, table.String()) // Multiple-column index expected = `create_table("users") { t.Column("name", "string") t.Column("email", "string") t.Timestamps() t.Index(["name", "email"], {name: "users_name_email_idx"}) }` table = fizz.NewTable("users", nil) r.NoError(table.Column("name", "string", nil)) r.NoError(table.Column("email", "string", nil)) r.NoError(table.Index([]string{"name", "email"}, nil)) r.Equal(expected, table.String()) } func Test_Table_StringerForeignKey(t *testing.T) { r := require.New(t) // Single column expected := `create_table("users_color") { t.Column("name", "string") t.Column("user_id", "int") t.Timestamps() t.ForeignKey("user_id", {"users": ["id"]}, {on_delete: "cascade"}) }` table := fizz.NewTable("users_color", nil) r.NoError(table.Column("name", "string", nil)) r.NoError(table.Column("user_id", "int", nil)) r.NoError(table.ForeignKey("user_id", map[string]interface{}{ "users": []interface{}{"id"}, }, fizz.Options{ "on_delete": "cascade", })) r.Equal(expected, table.String()) // Multiple columns expected = `create_table("users_color") { t.Column("name", "string") t.Column("user_id", "int") t.Timestamps() t.ForeignKey("user_id", {"users": ["id", "id2"]}, {on_delete: "cascade", on_update: "restrict"}) }` table = fizz.NewTable("users_color", nil) r.NoError(table.Column("name", "string", nil)) r.NoError(table.Column("user_id", "int", nil)) r.NoError(table.ForeignKey("user_id", map[string]interface{}{ "users": []interface{}{"id", "id2"}, }, fizz.Options{ "on_delete": "cascade", "on_update": "restrict", })) r.Equal(expected, table.String()) } func Test_Table_UnFizz(t *testing.T) { r := require.New(t) table := fizz.NewTable("users", nil) r.Equal(`drop_table("users")`, table.UnFizz()) } func Test_Table_HasColumn(t *testing.T) { r := require.New(t) table := fizz.NewTable("users", nil) r.NoError(table.Column("firstname", "string", nil)) r.NoError(table.Column("lastname", "string", nil)) r.True(table.HasColumns("firstname", "lastname")) r.False(table.HasColumns("age")) } func Test_Table_ColumnNames(t *testing.T) { r := require.New(t) table := fizz.NewTable("users", nil) r.NoError(table.Column("firstname", "string", nil)) r.NoError(table.Column("lastname", "string", nil)) r.Equal([]string{"firstname", "lastname"}, table.ColumnNames()) } func Test_Table_DuplicateColumn(t *testing.T) { r := require.New(t) table := fizz.NewTable("users", map[string]interface{}{}) r.NoError(table.Column("name", "string", fizz.Options{})) r.Error(table.Column("name", "string", fizz.Options{})) r.Error(table.Column("name", "string", fizz.Options{ "null": true, })) } func Test_Table_AddEmptyIndex(t *testing.T) { r := require.New(t) // Empty index table := fizz.NewTable("users", nil) r.NoError(table.Column("name", "string", nil)) r.NoError(table.Column("email", "string", nil)) r.Error(table.Index([]string{}, nil)) } func Test_Table_AddPrimaryKey(t *testing.T) { r := require.New(t) // Add single primary key expected := `create_table("users") { t.Column("id", "int", {primary: true}) t.Column("name", "string") t.Column("email", "string") t.Timestamps() }` table := fizz.NewTable("users", nil) r.NoError(table.Column("id", "int", fizz.Options{"primary": true})) r.NoError(table.Column("name", "string", nil)) r.NoError(table.Column("email", "string", nil)) r.Equal(expected, table.String()) table = fizz.NewTable("users", nil) r.NoError(table.Column("id", "int", nil)) r.NoError(table.Column("name", "string", nil)) r.NoError(table.Column("email", "string", nil)) r.NoError(table.PrimaryKey("id")) r.Equal(expected, table.String()) // Add composite primary key expected = `create_table("user_privileges") { t.Column("user_id", "int") t.Column("privilege_id", "int") t.Timestamps() t.PrimaryKey("user_id", "privilege_id") }` table = fizz.NewTable("user_privileges", nil) r.NoError(table.Column("user_id", "int", nil)) r.NoError(table.Column("privilege_id", "int", nil)) r.NoError(table.PrimaryKey("user_id", "privilege_id")) r.Equal(expected, table.String()) } func Test_Table_AddPrimaryKey_Errors(t *testing.T) { r := require.New(t) // Primary key on unknown column table := fizz.NewTable("users", nil) r.NoError(table.Column("id", "int", nil)) r.Error(table.PrimaryKey("id2")) // Duplicate primary key table = fizz.NewTable("users", nil) r.NoError(table.Column("id", "int", nil)) r.NoError(table.PrimaryKey("id")) r.Error(table.PrimaryKey("id")) // Duplicate primary key table = fizz.NewTable("users", nil) r.NoError(table.Column("id", "int", fizz.Options{"primary": true})) r.Error(table.PrimaryKey("id")) // Duplicate inline primary key table = fizz.NewTable("users", nil) r.NoError(table.Column("id", "int", fizz.Options{"primary": true})) r.Error(table.Column("id2", "int", fizz.Options{"primary": true})) } ================================================ FILE: test.sh ================================================ #!/bin/bash set -e # NOTE: See also docker-compose.yml and database.yml to configure database # properties. export MYSQL_PORT=3307 export COCKROACH_PORT=26258 COMPOSE=docker-compose which docker-compose || COMPOSE="docker compose" args=$@ function cleanup { echo "Cleanup resources..." $COMPOSE down docker volume prune -f find ./tmp -name *.sqlite* -delete || true } # defer cleanup, so it will be executed even after premature exit trap cleanup EXIT function test { export SODA_DIALECT=$1 echo "" echo "######################################################################" echo "### Running unit tests for $SODA_DIALECT" soda drop -e $SODA_DIALECT soda create -e $SODA_DIALECT soda migrate -e $SODA_DIALECT -p ./testdata/migrations go test -tags sqlite -count=1 $args ./... echo "" echo "######################################################################" echo "### Running e2e tests for $1" soda drop -e $SODA_DIALECT soda create -e $SODA_DIALECT pushd testdata/e2e; go test -tags sqlite,e2e -count=1 $args ./...; popd } $COMPOSE up --wait go install -tags sqlite github.com/gobuffalo/pop/v6/soda@latest test "sqlite" test "postgres" test "cockroach" test "mysql" # Does not appear to be implemented in pop: # test "sqlserver" ================================================ FILE: testdata/e2e/cockroach_test.go ================================================ package e2e_test import ( "github.com/gobuffalo/pop/v6" "github.com/stretchr/testify/suite" ) type CockroachSuite struct { suite.Suite } func (s *CockroachSuite) Test_Cockroach_MigrationSteps() { r := s.Require() c, err := pop.Connect("cockroach") r.NoError(err) r.NoError(retryOpen(c)) run(&s.Suite, c, runTestData(&s.Suite, c, true)) } ================================================ FILE: testdata/e2e/fixtures/cockroach/down/0.sql ================================================ -- # 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 ================================================ FILE: testdata/e2e/fixtures/cockroach/down/1.sql ================================================ -- # 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, 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) ); -- # 2 rows ================================================ FILE: testdata/e2e/fixtures/cockroach/down/10.sql ================================================ -- # 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) ); -- # 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_user_id_idx (user_id ASC), UNIQUE INDEX e2e_user_notes_slug_idx (slug ASC), FAMILY "primary" (id, content, user_id, slug) ); -- # 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 ================================================ FILE: testdata/e2e/fixtures/cockroach/down/11.sql ================================================ -- # 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) ); -- # 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_user_id_idx (user_id ASC), FAMILY "primary" (id, content, slug, user_id) ); -- # 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 ================================================ FILE: testdata/e2e/fixtures/cockroach/down/12.sql ================================================ -- # 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 -- ## 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_user_id_idx (user_id ASC), FAMILY "primary" (id, content, slug, user_id) ); -- # 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 ================================================ FILE: testdata/e2e/fixtures/cockroach/down/13.sql ================================================ -- # 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 -- ## 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_user_id_idx (author_id ASC), FAMILY "primary" (id, content, slug, author_id) ); -- # 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 ================================================ FILE: testdata/e2e/fixtures/cockroach/down/14.sql ================================================ -- # 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 -- ## 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 ================================================ FILE: testdata/e2e/fixtures/cockroach/down/15.sql ================================================ -- # 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 -- ## 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':::TIMESTAMP, issued_at TIMESTAMP NOT NULL DEFAULT '2000-01-01 00:00:00':::TIMESTAMP, e2e_flow_id UUID NOT NULL, 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, expires_at, issued_at, e2e_flow_id) ); -- # 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 ================================================ FILE: testdata/e2e/fixtures/cockroach/down/2.sql ================================================ -- # 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, 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) ); -- # row 3 -- ## 341 CREATE TABLE public.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_user_id_idx (user_id ASC), INDEX e2e_user_notes_title_idx (title ASC), FAMILY "primary" (id, user_id, notes, title) ); -- # 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 ================================================ FILE: testdata/e2e/fixtures/cockroach/down/3.sql ================================================ -- # 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, 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) ); -- # row 3 -- ## 240 CREATE TABLE public.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_user_id_idx (user_id ASC), FAMILY "primary" (id, user_id, notes) ); -- # 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 ================================================ FILE: testdata/e2e/fixtures/cockroach/down/4.sql ================================================ -- # 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, 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) ); -- # row 3 -- ## 324 CREATE TABLE public.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_user_id_idx (user_id ASC), UNIQUE INDEX e2e_user_notes_slug_idx (slug ASC), FAMILY "primary" (id, user_id, slug, notes) ); -- # 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 ================================================ FILE: testdata/e2e/fixtures/cockroach/down/5.sql ================================================ -- # 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, 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) ); -- # row 3 -- ## 324 CREATE TABLE public.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_user_id_idx (user_id ASC), UNIQUE INDEX e2e_user_notes_slug_idx (slug ASC), FAMILY "primary" (id, user_id, slug, notes) ); -- # 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 ================================================ FILE: testdata/e2e/fixtures/cockroach/down/6.sql ================================================ -- # 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, 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) ); -- # row 3 -- ## 324 CREATE TABLE public.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_user_id_idx (user_id ASC), UNIQUE INDEX e2e_user_notes_slug_idx (slug ASC), FAMILY "primary" (id, user_id, slug, notes) ); -- # 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 ================================================ FILE: testdata/e2e/fixtures/cockroach/down/7.sql ================================================ -- # 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, 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) ); -- # row 3 -- ## 324 CREATE TABLE public.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_user_id_idx (user_id ASC), UNIQUE INDEX e2e_user_notes_slug_idx (slug ASC), FAMILY "primary" (id, user_id, slug, notes) ); -- # 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 ================================================ FILE: testdata/e2e/fixtures/cockroach/down/8.sql ================================================ -- # 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, 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) ); -- # 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_user_id_idx (user_id ASC), UNIQUE INDEX e2e_user_notes_slug_idx (slug ASC), FAMILY "primary" (id, content, user_id, slug) ); -- # 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 ================================================ FILE: testdata/e2e/fixtures/cockroach/down/9.sql ================================================ -- # 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, 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) ); -- # 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_user_id_idx (user_id ASC), UNIQUE INDEX e2e_user_notes_slug_idx (slug ASC), FAMILY "primary" (id, content, user_id, slug) ); -- # 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 ================================================ FILE: testdata/e2e/fixtures/cockroach/up/0.sql ================================================ -- # 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, updated_at TIMESTAMP NOT NULL, CONSTRAINT "primary" PRIMARY KEY (id ASC), FAMILY "primary" (id, username, created_at, updated_at) ); -- # 2 rows ================================================ FILE: testdata/e2e/fixtures/cockroach/up/1.sql ================================================ -- # 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, updated_at TIMESTAMP NOT NULL, CONSTRAINT "primary" PRIMARY KEY (id ASC), FAMILY "primary" (id, username, created_at, updated_at) ); -- # 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_user_id_idx (user_id ASC), INDEX e2e_user_notes_title_idx (title ASC), FAMILY "primary" (id, notes, title, user_id) ); -- # 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 ================================================ FILE: testdata/e2e/fixtures/cockroach/up/10.sql ================================================ -- # 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) ); -- # 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_user_id_idx (user_id ASC), UNIQUE INDEX e2e_user_notes_slug_idx (slug ASC), FAMILY "primary" (id, user_id, content, slug) ); -- # 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 ================================================ FILE: testdata/e2e/fixtures/cockroach/up/11.sql ================================================ -- # 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 -- ## 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_user_id_idx (user_id ASC), UNIQUE INDEX e2e_user_notes_slug_idx (slug ASC), FAMILY "primary" (id, user_id, content, slug) ); -- # 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 ================================================ FILE: testdata/e2e/fixtures/cockroach/up/12.sql ================================================ -- # 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 -- ## 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_user_id_idx (author_id ASC), UNIQUE INDEX e2e_user_notes_slug_idx (slug ASC), FAMILY "primary" (id, author_id, content, slug) ); -- # 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 ================================================ FILE: testdata/e2e/fixtures/cockroach/up/13.sql ================================================ -- # 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 -- ## 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 ================================================ FILE: testdata/e2e/fixtures/cockroach/up/14.sql ================================================ -- # 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 -- ## 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), UNIQUE INDEX e2e_token_uq_idx (token ASC), INDEX e2e_token_idx (token ASC), FAMILY "primary" (id, token, e2e_flow_id, e2e_address_id) ); -- # 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 ================================================ FILE: testdata/e2e/fixtures/cockroach/up/15.sql ================================================ -- # 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, 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), UNIQUE INDEX e2e_token_uq_idx (token ASC), INDEX e2e_token_idx (token ASC), FAMILY "primary" (id, token, e2e_address_id, expires_at, issued_at, e2e_flow_id) ); -- # 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 ================================================ FILE: testdata/e2e/fixtures/cockroach/up/2.sql ================================================ -- # 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, updated_at TIMESTAMP NOT NULL, CONSTRAINT "primary" PRIMARY KEY (id ASC), FAMILY "primary" (id, username, created_at, updated_at) ); -- # 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_user_id_idx (user_id ASC), FAMILY "primary" (id, notes, user_id) ); -- # 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 ================================================ FILE: testdata/e2e/fixtures/cockroach/up/3.sql ================================================ -- # 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, updated_at TIMESTAMP NOT NULL, CONSTRAINT "primary" PRIMARY KEY (id ASC), FAMILY "primary" (id, username, created_at, updated_at) ); -- # 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_user_id_idx (user_id ASC), FAMILY "primary" (id, notes, user_id, slug) ); -- # 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 ================================================ FILE: testdata/e2e/fixtures/cockroach/up/4.sql ================================================ -- # 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, updated_at TIMESTAMP NOT NULL, CONSTRAINT "primary" PRIMARY KEY (id ASC), FAMILY "primary" (id, username, created_at, updated_at) ); -- # 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_user_id_idx (user_id ASC), FAMILY "primary" (id, notes, user_id, slug) ); -- # 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 ================================================ FILE: testdata/e2e/fixtures/cockroach/up/5.sql ================================================ -- # 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, updated_at TIMESTAMP NOT NULL, CONSTRAINT "primary" PRIMARY KEY (id ASC), FAMILY "primary" (id, username, created_at, updated_at) ); -- # 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_user_id_idx (user_id ASC), UNIQUE INDEX e2e_user_notes_slug_idx (slug ASC), FAMILY "primary" (id, notes, user_id, slug) ); -- # 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 ================================================ FILE: testdata/e2e/fixtures/cockroach/up/6.sql ================================================ -- # 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, updated_at TIMESTAMP NOT NULL, CONSTRAINT "primary" PRIMARY KEY (id ASC), FAMILY "primary" (id, username, created_at, updated_at) ); -- # 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_user_id_idx (user_id ASC), UNIQUE INDEX e2e_user_notes_slug_idx (slug ASC), FAMILY "primary" (id, notes, user_id, slug) ); -- # 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 ================================================ FILE: testdata/e2e/fixtures/cockroach/up/7.sql ================================================ -- # 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, updated_at TIMESTAMP NOT NULL, CONSTRAINT "primary" PRIMARY KEY (id ASC), FAMILY "primary" (id, username, created_at, updated_at) ); -- # 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_user_id_idx (user_id ASC), UNIQUE INDEX e2e_user_notes_slug_idx (slug ASC), FAMILY "primary" (id, user_id, slug, content) ); -- # 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 ================================================ FILE: testdata/e2e/fixtures/cockroach/up/8.sql ================================================ -- # 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, updated_at TIMESTAMP NOT NULL, CONSTRAINT "primary" PRIMARY KEY (id ASC), FAMILY "primary" (id, name, created_at, updated_at) ); -- # 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_user_id_idx (user_id ASC), UNIQUE INDEX e2e_user_notes_slug_idx (slug ASC), FAMILY "primary" (id, user_id, slug, content) ); -- # 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 ================================================ FILE: testdata/e2e/fixtures/cockroach/up/9.sql ================================================ -- # 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) ); -- # 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_user_id_idx (user_id ASC), UNIQUE INDEX e2e_user_notes_slug_idx (slug ASC), FAMILY "primary" (id, user_id, slug, content) ); -- # 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 ================================================ FILE: testdata/e2e/fixtures/mysql/down/0.sql ================================================ -- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ -- Server version 5.7.31 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `schema_migration` -- DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-09-03 11:40:22 ================================================ FILE: testdata/e2e/fixtures/mysql/down/1.sql ================================================ -- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ -- Server version 5.7.31 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `e2e_users` -- DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, `username` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `schema_migration` -- DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-09-03 11:40:22 ================================================ FILE: testdata/e2e/fixtures/mysql/down/10.sql ================================================ -- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ -- Server version 5.7.31 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `e2e_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, `user_id` char(36) NOT NULL, `slug` varchar(64) NOT NULL, `content` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`id`), 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; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `e2e_users` -- DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `schema_migration` -- DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-09-03 11:40:18 ================================================ FILE: testdata/e2e/fixtures/mysql/down/11.sql ================================================ -- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ -- Server version 5.7.31 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `e2e_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, `user_id` char(36) NOT NULL, `slug` varchar(32) NOT NULL, `content` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`id`), 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; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `e2e_users` -- DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `schema_migration` -- DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-09-03 11:40:18 ================================================ FILE: testdata/e2e/fixtures/mysql/down/12.sql ================================================ -- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ -- Server version 5.7.31 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `e2e_authors` -- DROP TABLE IF EXISTS `e2e_authors`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_authors` ( `id` char(36) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `e2e_user_posts` -- DROP TABLE IF EXISTS `e2e_user_posts`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_posts` ( `id` char(36) NOT NULL, `user_id` char(36) NOT NULL, `slug` varchar(32) NOT NULL, `content` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`id`), 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; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `schema_migration` -- DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-09-03 11:40:18 ================================================ FILE: testdata/e2e/fixtures/mysql/down/13.sql ================================================ -- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ -- Server version 5.7.31 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `e2e_authors` -- DROP TABLE IF EXISTS `e2e_authors`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_authors` ( `id` char(36) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `e2e_user_posts` -- DROP TABLE IF EXISTS `e2e_user_posts`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_posts` ( `id` char(36) NOT NULL, `author_id` char(36) NOT NULL, `slug` varchar(32) NOT NULL, `content` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`id`), UNIQUE KEY `e2e_user_notes_slug_idx` (`slug`), KEY `e2e_user_notes_user_id_idx` (`author_id`), CONSTRAINT `e2e_user_posts_ibfk_1` FOREIGN KEY (`author_id`) REFERENCES `e2e_authors` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `schema_migration` -- DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-09-03 11:40:17 ================================================ FILE: testdata/e2e/fixtures/mysql/down/14.sql ================================================ -- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ -- Server version 5.7.31 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `e2e_authors` -- DROP TABLE IF EXISTS `e2e_authors`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_authors` ( `id` char(36) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `e2e_user_posts` -- DROP TABLE IF EXISTS `e2e_user_posts`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_posts` ( `id` char(36) NOT NULL, `author_id` char(36) DEFAULT NULL, `slug` varchar(32) NOT NULL, `content` varchar(255) NOT NULL DEFAULT '', `published` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `e2e_user_notes_slug_idx` (`slug`), KEY `e2e_user_notes_user_id_idx` (`author_id`), CONSTRAINT `e2e_user_posts_ibfk_1` FOREIGN KEY (`author_id`) REFERENCES `e2e_authors` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `schema_migration` -- DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-09-03 11:40:17 ================================================ FILE: testdata/e2e/fixtures/mysql/down/15.sql ================================================ -- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ -- Server version 5.7.31 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `e2e_address` -- DROP TABLE IF EXISTS `e2e_address`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_address` ( `id` char(36) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `e2e_authors` -- DROP TABLE IF EXISTS `e2e_authors`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_authors` ( `id` char(36) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `e2e_flow` -- DROP TABLE IF EXISTS `e2e_flow`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_flow` ( `id` char(36) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `e2e_token` -- DROP TABLE IF EXISTS `e2e_token`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_token` ( `id` char(36) NOT NULL, `token` varchar(64) NOT NULL, `e2e_flow_id` char(36) NOT NULL, `e2e_address_id` char(36) NOT NULL, `expires_at` datetime NOT NULL DEFAULT '2000-01-01 00:00:00', `issued_at` datetime NOT NULL DEFAULT '2000-01-01 00:00:00', PRIMARY KEY (`id`), UNIQUE KEY `e2e_token_uq_idx` (`token`), KEY `e2e_flow_id` (`e2e_flow_id`), KEY `e2e_address_id` (`e2e_address_id`), KEY `e2e_token_idx` (`token`), CONSTRAINT `e2e_token_ibfk_1` FOREIGN KEY (`e2e_flow_id`) REFERENCES `e2e_flow` (`id`) ON DELETE CASCADE, CONSTRAINT `e2e_token_ibfk_2` FOREIGN KEY (`e2e_address_id`) REFERENCES `e2e_address` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `e2e_user_posts` -- DROP TABLE IF EXISTS `e2e_user_posts`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_posts` ( `id` char(36) NOT NULL, `author_id` char(36) DEFAULT NULL, `slug` varchar(32) NOT NULL, `content` varchar(255) NOT NULL DEFAULT '', `published` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `e2e_user_notes_slug_idx` (`slug`), KEY `e2e_user_notes_user_id_idx` (`author_id`), CONSTRAINT `e2e_user_posts_ibfk_1` FOREIGN KEY (`author_id`) REFERENCES `e2e_authors` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `schema_migration` -- DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-09-03 11:40:17 ================================================ FILE: testdata/e2e/fixtures/mysql/down/2.sql ================================================ -- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ -- Server version 5.7.31 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `e2e_user_notes` -- DROP TABLE IF EXISTS `e2e_user_notes`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_notes` ( `id` char(36) NOT NULL, `user_id` char(36) NOT NULL, `notes` varchar(255) DEFAULT NULL, `title` varchar(64) NOT NULL DEFAULT '', PRIMARY KEY (`id`), 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; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `e2e_users` -- DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, `username` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `schema_migration` -- DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-09-03 11:40:21 ================================================ FILE: testdata/e2e/fixtures/mysql/down/3.sql ================================================ -- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ -- Server version 5.7.31 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `e2e_user_notes` -- DROP TABLE IF EXISTS `e2e_user_notes`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_notes` ( `id` char(36) NOT NULL, `user_id` char(36) NOT NULL, `notes` varchar(255) DEFAULT NULL, 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; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `e2e_users` -- DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, `username` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `schema_migration` -- DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-09-03 11:40:21 ================================================ FILE: testdata/e2e/fixtures/mysql/down/4.sql ================================================ -- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ -- Server version 5.7.31 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `e2e_user_notes` -- DROP TABLE IF EXISTS `e2e_user_notes`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_notes` ( `id` char(36) NOT NULL, `user_id` char(36) NOT NULL, `slug` varchar(64) NOT NULL, `notes` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), 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; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `e2e_users` -- DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, `username` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `schema_migration` -- DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-09-03 11:40:20 ================================================ FILE: testdata/e2e/fixtures/mysql/down/5.sql ================================================ -- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ -- Server version 5.7.31 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `e2e_user_notes` -- DROP TABLE IF EXISTS `e2e_user_notes`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_notes` ( `id` char(36) NOT NULL, `user_id` char(36) NOT NULL, `slug` varchar(64) NOT NULL, `notes` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), 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; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `e2e_users` -- DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, `username` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `schema_migration` -- DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-09-03 11:40:20 ================================================ FILE: testdata/e2e/fixtures/mysql/down/6.sql ================================================ -- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ -- Server version 5.7.31 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `e2e_user_notes` -- DROP TABLE IF EXISTS `e2e_user_notes`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_notes` ( `id` char(36) NOT NULL, `user_id` char(36) NOT NULL, `slug` varchar(64) NOT NULL, `notes` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), 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; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `e2e_users` -- DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, `username` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `schema_migration` -- DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-09-03 11:40:20 ================================================ FILE: testdata/e2e/fixtures/mysql/down/7.sql ================================================ -- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ -- Server version 5.7.31 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `e2e_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, `user_id` char(36) NOT NULL, `slug` varchar(64) NOT NULL, `notes` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), 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; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `e2e_users` -- DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, `username` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `schema_migration` -- DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-09-03 11:40:19 ================================================ FILE: testdata/e2e/fixtures/mysql/down/8.sql ================================================ -- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ -- Server version 5.7.31 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `e2e_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, `user_id` char(36) NOT NULL, `slug` varchar(64) NOT NULL, `content` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`id`), 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; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `e2e_users` -- DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, `username` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `schema_migration` -- DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-09-03 11:40:19 ================================================ FILE: testdata/e2e/fixtures/mysql/down/9.sql ================================================ -- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ -- Server version 5.7.31 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `e2e_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, `user_id` char(36) NOT NULL, `slug` varchar(64) NOT NULL, `content` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`id`), 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; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `e2e_users` -- DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, `name` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `schema_migration` -- DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-09-03 11:40:19 ================================================ FILE: testdata/e2e/fixtures/mysql/up/0.sql ================================================ -- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ -- Server version 5.7.31 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `e2e_users` -- DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `username` varchar(255) DEFAULT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `schema_migration` -- DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-09-03 11:40:11 ================================================ FILE: testdata/e2e/fixtures/mysql/up/1.sql ================================================ -- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ -- Server version 5.7.31 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `e2e_user_notes` -- DROP TABLE IF EXISTS `e2e_user_notes`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_notes` ( `id` char(36) NOT NULL, `notes` varchar(255) DEFAULT NULL, `title` varchar(64) NOT NULL DEFAULT '', `user_id` char(36) NOT NULL, PRIMARY KEY (`id`), 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; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `e2e_users` -- DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `username` varchar(255) DEFAULT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `schema_migration` -- DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-09-03 11:40:11 ================================================ FILE: testdata/e2e/fixtures/mysql/up/10.sql ================================================ -- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ -- Server version 5.7.31 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `e2e_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, `user_id` char(36) NOT NULL, `slug` varchar(32) NOT NULL, `content` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`id`), 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; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `e2e_users` -- DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `schema_migration` -- DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-09-03 11:40:14 ================================================ FILE: testdata/e2e/fixtures/mysql/up/11.sql ================================================ -- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ -- Server version 5.7.31 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `e2e_authors` -- DROP TABLE IF EXISTS `e2e_authors`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_authors` ( `id` char(36) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `e2e_user_posts` -- DROP TABLE IF EXISTS `e2e_user_posts`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_posts` ( `id` char(36) NOT NULL, `user_id` char(36) NOT NULL, `slug` varchar(32) NOT NULL, `content` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`id`), 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; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `schema_migration` -- DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-09-03 11:40:14 ================================================ FILE: testdata/e2e/fixtures/mysql/up/12.sql ================================================ -- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ -- Server version 5.7.31 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `e2e_authors` -- DROP TABLE IF EXISTS `e2e_authors`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_authors` ( `id` char(36) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `e2e_user_posts` -- DROP TABLE IF EXISTS `e2e_user_posts`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_posts` ( `id` char(36) NOT NULL, `author_id` char(36) NOT NULL, `slug` varchar(32) NOT NULL, `content` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`id`), UNIQUE KEY `e2e_user_notes_slug_idx` (`slug`), KEY `e2e_user_notes_user_id_idx` (`author_id`), CONSTRAINT `e2e_user_posts_ibfk_1` FOREIGN KEY (`author_id`) REFERENCES `e2e_authors` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `schema_migration` -- DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-09-03 11:40:15 ================================================ FILE: testdata/e2e/fixtures/mysql/up/13.sql ================================================ -- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ -- Server version 5.7.31 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `e2e_authors` -- DROP TABLE IF EXISTS `e2e_authors`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_authors` ( `id` char(36) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `e2e_user_posts` -- DROP TABLE IF EXISTS `e2e_user_posts`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_posts` ( `id` char(36) NOT NULL, `author_id` char(36) DEFAULT NULL, `slug` varchar(32) NOT NULL, `content` varchar(255) NOT NULL DEFAULT '', `published` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `e2e_user_notes_slug_idx` (`slug`), KEY `e2e_user_notes_user_id_idx` (`author_id`), CONSTRAINT `e2e_user_posts_ibfk_1` FOREIGN KEY (`author_id`) REFERENCES `e2e_authors` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `schema_migration` -- DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-09-03 11:40:15 ================================================ FILE: testdata/e2e/fixtures/mysql/up/14.sql ================================================ -- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ -- Server version 5.7.31 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `e2e_address` -- DROP TABLE IF EXISTS `e2e_address`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_address` ( `id` char(36) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `e2e_authors` -- DROP TABLE IF EXISTS `e2e_authors`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_authors` ( `id` char(36) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `e2e_flow` -- DROP TABLE IF EXISTS `e2e_flow`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_flow` ( `id` char(36) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `e2e_token` -- DROP TABLE IF EXISTS `e2e_token`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_token` ( `id` char(36) NOT NULL, `token` varchar(64) NOT NULL, `e2e_flow_id` char(36) NOT NULL, `e2e_address_id` char(36) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `e2e_token_uq_idx` (`token`), KEY `e2e_flow_id` (`e2e_flow_id`), KEY `e2e_address_id` (`e2e_address_id`), KEY `e2e_token_idx` (`token`), CONSTRAINT `e2e_token_ibfk_1` FOREIGN KEY (`e2e_flow_id`) REFERENCES `e2e_flow` (`id`) ON DELETE CASCADE, CONSTRAINT `e2e_token_ibfk_2` FOREIGN KEY (`e2e_address_id`) REFERENCES `e2e_address` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `e2e_user_posts` -- DROP TABLE IF EXISTS `e2e_user_posts`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_posts` ( `id` char(36) NOT NULL, `author_id` char(36) DEFAULT NULL, `slug` varchar(32) NOT NULL, `content` varchar(255) NOT NULL DEFAULT '', `published` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `e2e_user_notes_slug_idx` (`slug`), KEY `e2e_user_notes_user_id_idx` (`author_id`), CONSTRAINT `e2e_user_posts_ibfk_1` FOREIGN KEY (`author_id`) REFERENCES `e2e_authors` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `schema_migration` -- DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-09-03 11:40:16 ================================================ FILE: testdata/e2e/fixtures/mysql/up/15.sql ================================================ -- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ -- Server version 5.7.31 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `e2e_address` -- DROP TABLE IF EXISTS `e2e_address`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_address` ( `id` char(36) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `e2e_authors` -- DROP TABLE IF EXISTS `e2e_authors`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_authors` ( `id` char(36) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `e2e_flow` -- DROP TABLE IF EXISTS `e2e_flow`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_flow` ( `id` char(36) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `e2e_token` -- DROP TABLE IF EXISTS `e2e_token`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_token` ( `id` char(36) NOT NULL, `token` varchar(64) NOT NULL, `e2e_flow_id` char(36) DEFAULT NULL, `e2e_address_id` char(36) NOT NULL, `expires_at` datetime NOT NULL DEFAULT '2000-01-01 00:00:00', `issued_at` datetime NOT NULL DEFAULT '2000-01-01 00:00:00', PRIMARY KEY (`id`), UNIQUE KEY `e2e_token_uq_idx` (`token`), KEY `e2e_flow_id` (`e2e_flow_id`), KEY `e2e_address_id` (`e2e_address_id`), KEY `e2e_token_idx` (`token`), CONSTRAINT `e2e_token_ibfk_1` FOREIGN KEY (`e2e_flow_id`) REFERENCES `e2e_flow` (`id`) ON DELETE CASCADE, CONSTRAINT `e2e_token_ibfk_2` FOREIGN KEY (`e2e_address_id`) REFERENCES `e2e_address` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `e2e_user_posts` -- DROP TABLE IF EXISTS `e2e_user_posts`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_posts` ( `id` char(36) NOT NULL, `author_id` char(36) DEFAULT NULL, `slug` varchar(32) NOT NULL, `content` varchar(255) NOT NULL DEFAULT '', `published` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `e2e_user_notes_slug_idx` (`slug`), KEY `e2e_user_notes_user_id_idx` (`author_id`), CONSTRAINT `e2e_user_posts_ibfk_1` FOREIGN KEY (`author_id`) REFERENCES `e2e_authors` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `schema_migration` -- DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-09-03 11:40:16 ================================================ FILE: testdata/e2e/fixtures/mysql/up/2.sql ================================================ -- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ -- Server version 5.7.31 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `e2e_user_notes` -- DROP TABLE IF EXISTS `e2e_user_notes`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_notes` ( `id` char(36) NOT NULL, `notes` varchar(255) DEFAULT NULL, `user_id` char(36) NOT NULL, 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; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `e2e_users` -- DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `username` varchar(255) DEFAULT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `schema_migration` -- DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-09-03 11:40:11 ================================================ FILE: testdata/e2e/fixtures/mysql/up/3.sql ================================================ -- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ -- Server version 5.7.31 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `e2e_user_notes` -- DROP TABLE IF EXISTS `e2e_user_notes`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_notes` ( `id` char(36) NOT NULL, `notes` varchar(255) DEFAULT NULL, `user_id` char(36) NOT NULL, `slug` varchar(64) DEFAULT NULL, 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; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `e2e_users` -- DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `username` varchar(255) DEFAULT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `schema_migration` -- DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-09-03 11:40:12 ================================================ FILE: testdata/e2e/fixtures/mysql/up/4.sql ================================================ -- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ -- Server version 5.7.31 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `e2e_user_notes` -- DROP TABLE IF EXISTS `e2e_user_notes`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_notes` ( `id` char(36) NOT NULL, `notes` varchar(255) DEFAULT NULL, `user_id` char(36) NOT NULL, `slug` varchar(64) DEFAULT NULL, 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; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `e2e_users` -- DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `username` varchar(255) DEFAULT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `schema_migration` -- DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-09-03 11:40:12 ================================================ FILE: testdata/e2e/fixtures/mysql/up/5.sql ================================================ -- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ -- Server version 5.7.31 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `e2e_user_notes` -- DROP TABLE IF EXISTS `e2e_user_notes`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_user_notes` ( `id` char(36) NOT NULL, `notes` varchar(255) DEFAULT NULL, `user_id` char(36) NOT NULL, `slug` varchar(64) NOT NULL, PRIMARY KEY (`id`), 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; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `e2e_users` -- DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `username` varchar(255) DEFAULT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `schema_migration` -- DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-09-03 11:40:12 ================================================ FILE: testdata/e2e/fixtures/mysql/up/6.sql ================================================ -- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ -- Server version 5.7.31 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `e2e_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, `notes` varchar(255) DEFAULT NULL, `user_id` char(36) NOT NULL, `slug` varchar(64) NOT NULL, PRIMARY KEY (`id`), 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; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `e2e_users` -- DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `username` varchar(255) DEFAULT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `schema_migration` -- DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-09-03 11:40:12 ================================================ FILE: testdata/e2e/fixtures/mysql/up/7.sql ================================================ -- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ -- Server version 5.7.31 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `e2e_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, `user_id` char(36) NOT NULL, `slug` varchar(64) NOT NULL, `content` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`id`), 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; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `e2e_users` -- DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `username` varchar(255) DEFAULT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `schema_migration` -- DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-09-03 11:40:13 ================================================ FILE: testdata/e2e/fixtures/mysql/up/8.sql ================================================ -- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ -- Server version 5.7.31 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `e2e_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, `user_id` char(36) NOT NULL, `slug` varchar(64) NOT NULL, `content` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`id`), 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; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `e2e_users` -- DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `name` varchar(255) DEFAULT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `schema_migration` -- DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-09-03 11:40:13 ================================================ FILE: testdata/e2e/fixtures/mysql/up/9.sql ================================================ -- MySQL dump 10.13 Distrib 8.0.21, for osx10.15 (x86_64) -- -- Host: 127.0.0.1 Database: pop_test -- ------------------------------------------------------ -- Server version 5.7.31 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `e2e_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, `user_id` char(36) NOT NULL, `slug` varchar(64) NOT NULL, `content` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`id`), 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; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `e2e_users` -- DROP TABLE IF EXISTS `e2e_users`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `e2e_users` ( `id` char(36) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `schema_migration` -- DROP TABLE IF EXISTS `schema_migration`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `schema_migration` ( `version` varchar(14) NOT NULL, UNIQUE KEY `schema_migration_version_idx` (`version`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2020-09-03 11:40:13 ================================================ FILE: testdata/e2e/fixtures/postgres/down/0.sql ================================================ -- -- PostgreSQL database dump -- -- Dumped from database version 9.6.19 -- Dumped by pg_dump version 12.4 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; SET row_security = off; SET default_tablespace = ''; -- -- Name: 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: schema_migration_version_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX schema_migration_version_idx ON public.schema_migration USING btree (version); -- -- PostgreSQL database dump complete -- ================================================ FILE: testdata/e2e/fixtures/postgres/down/1.sql ================================================ -- -- PostgreSQL database dump -- -- Dumped from database version 9.6.19 -- Dumped by pg_dump version 12.4 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; SET row_security = off; SET default_tablespace = ''; -- -- Name: e2e_users; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_users ( id uuid NOT NULL, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL, username character varying(255) ); ALTER TABLE public.e2e_users 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_users e2e_users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_users ADD CONSTRAINT e2e_users_pkey PRIMARY KEY (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); -- -- PostgreSQL database dump complete -- ================================================ FILE: testdata/e2e/fixtures/postgres/down/10.sql ================================================ -- -- PostgreSQL database dump -- -- Dumped from database version 9.6.19 -- Dumped by pg_dump version 12.4 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; SET row_security = off; SET default_tablespace = ''; -- -- Name: e2e_user_posts; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_user_posts ( id uuid NOT NULL, user_id uuid NOT NULL, slug character varying(64) NOT NULL, content character varying(255) DEFAULT ''::character varying NOT NULL ); ALTER TABLE public.e2e_user_posts OWNER TO postgres; -- -- Name: e2e_users; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_users ( id uuid NOT NULL, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL ); ALTER TABLE public.e2e_users OWNER TO postgres; -- -- Name: schema_migration; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.schema_migration ( version character varying(14) NOT NULL ); ALTER TABLE public.schema_migration OWNER TO postgres; -- -- Name: e2e_user_posts e2e_user_notes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_pkey PRIMARY KEY (id); -- -- Name: e2e_users e2e_users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_users ADD CONSTRAINT e2e_users_pkey PRIMARY KEY (id); -- -- Name: e2e_user_notes_slug_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX e2e_user_notes_slug_idx ON public.e2e_user_posts USING btree (slug); -- -- Name: e2e_user_notes_user_id_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX e2e_user_notes_user_id_idx ON public.e2e_user_posts USING btree (user_id); -- -- Name: schema_migration_version_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX schema_migration_version_idx ON public.schema_migration USING btree (version); -- -- Name: e2e_user_posts e2e_user_notes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.e2e_users(id) ON DELETE CASCADE; -- -- PostgreSQL database dump complete -- ================================================ FILE: testdata/e2e/fixtures/postgres/down/11.sql ================================================ -- -- PostgreSQL database dump -- -- Dumped from database version 9.6.19 -- Dumped by pg_dump version 12.4 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; SET row_security = off; SET default_tablespace = ''; -- -- Name: e2e_user_posts; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_user_posts ( id uuid NOT NULL, user_id uuid NOT NULL, slug character varying(32) NOT NULL, content character varying(255) DEFAULT ''::character varying NOT NULL ); ALTER TABLE public.e2e_user_posts OWNER TO postgres; -- -- Name: e2e_users; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_users ( id uuid NOT NULL, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL ); ALTER TABLE public.e2e_users OWNER TO postgres; -- -- Name: schema_migration; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.schema_migration ( version character varying(14) NOT NULL ); ALTER TABLE public.schema_migration OWNER TO postgres; -- -- Name: e2e_user_posts e2e_user_notes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_pkey PRIMARY KEY (id); -- -- Name: e2e_users e2e_users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_users ADD CONSTRAINT e2e_users_pkey PRIMARY KEY (id); -- -- Name: e2e_user_notes_slug_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX e2e_user_notes_slug_idx ON public.e2e_user_posts USING btree (slug); -- -- Name: e2e_user_notes_user_id_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX e2e_user_notes_user_id_idx ON public.e2e_user_posts USING btree (user_id); -- -- Name: schema_migration_version_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX schema_migration_version_idx ON public.schema_migration USING btree (version); -- -- Name: e2e_user_posts e2e_user_notes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.e2e_users(id) ON DELETE CASCADE; -- -- PostgreSQL database dump complete -- ================================================ FILE: testdata/e2e/fixtures/postgres/down/12.sql ================================================ -- -- PostgreSQL database dump -- -- Dumped from database version 9.6.19 -- Dumped by pg_dump version 12.4 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; SET row_security = off; SET default_tablespace = ''; -- -- Name: e2e_authors; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_authors ( id uuid NOT NULL, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL ); ALTER TABLE public.e2e_authors OWNER TO postgres; -- -- Name: e2e_user_posts; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_user_posts ( id uuid NOT NULL, user_id uuid NOT NULL, slug character varying(32) NOT NULL, content character varying(255) DEFAULT ''::character varying NOT NULL ); ALTER TABLE public.e2e_user_posts OWNER TO postgres; -- -- Name: schema_migration; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.schema_migration ( version character varying(14) NOT NULL ); ALTER TABLE public.schema_migration OWNER TO postgres; -- -- Name: e2e_user_posts e2e_user_notes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_pkey PRIMARY KEY (id); -- -- Name: e2e_authors e2e_users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_authors ADD CONSTRAINT e2e_users_pkey PRIMARY KEY (id); -- -- Name: e2e_user_notes_slug_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX e2e_user_notes_slug_idx ON public.e2e_user_posts USING btree (slug); -- -- Name: e2e_user_notes_user_id_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX e2e_user_notes_user_id_idx ON public.e2e_user_posts USING btree (user_id); -- -- Name: schema_migration_version_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX schema_migration_version_idx ON public.schema_migration USING btree (version); -- -- Name: e2e_user_posts e2e_user_notes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.e2e_authors(id) ON DELETE CASCADE; -- -- PostgreSQL database dump complete -- ================================================ FILE: testdata/e2e/fixtures/postgres/down/13.sql ================================================ -- -- PostgreSQL database dump -- -- Dumped from database version 9.6.19 -- Dumped by pg_dump version 12.4 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; SET row_security = off; SET default_tablespace = ''; -- -- Name: e2e_authors; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_authors ( id uuid NOT NULL, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL ); ALTER TABLE public.e2e_authors OWNER TO postgres; -- -- Name: e2e_user_posts; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_user_posts ( id uuid NOT NULL, author_id uuid NOT NULL, slug character varying(32) NOT NULL, content character varying(255) DEFAULT ''::character varying NOT NULL ); ALTER TABLE public.e2e_user_posts OWNER TO postgres; -- -- Name: schema_migration; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.schema_migration ( version character varying(14) NOT NULL ); ALTER TABLE public.schema_migration OWNER TO postgres; -- -- Name: e2e_user_posts e2e_user_notes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_pkey PRIMARY KEY (id); -- -- Name: e2e_authors e2e_users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_authors ADD CONSTRAINT e2e_users_pkey PRIMARY KEY (id); -- -- Name: e2e_user_notes_slug_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX e2e_user_notes_slug_idx ON public.e2e_user_posts USING btree (slug); -- -- Name: e2e_user_notes_user_id_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX e2e_user_notes_user_id_idx ON public.e2e_user_posts USING btree (author_id); -- -- Name: schema_migration_version_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX schema_migration_version_idx ON public.schema_migration USING btree (version); -- -- Name: e2e_user_posts e2e_user_notes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_user_id_fkey FOREIGN KEY (author_id) REFERENCES public.e2e_authors(id) ON DELETE CASCADE; -- -- PostgreSQL database dump complete -- ================================================ FILE: testdata/e2e/fixtures/postgres/down/14.sql ================================================ -- -- PostgreSQL database dump -- -- Dumped from database version 9.6.19 -- Dumped by pg_dump version 12.4 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; SET row_security = off; SET default_tablespace = ''; -- -- Name: e2e_authors; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_authors ( id uuid NOT NULL, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL ); ALTER TABLE public.e2e_authors OWNER TO postgres; -- -- Name: e2e_user_posts; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_user_posts ( id uuid NOT NULL, author_id uuid, slug character varying(32) NOT NULL, content character varying(255) DEFAULT ''::character varying NOT NULL, published boolean DEFAULT false NOT NULL ); ALTER TABLE public.e2e_user_posts OWNER TO postgres; -- -- Name: schema_migration; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.schema_migration ( version character varying(14) NOT NULL ); ALTER TABLE public.schema_migration OWNER TO postgres; -- -- Name: e2e_user_posts e2e_user_notes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_pkey PRIMARY KEY (id); -- -- Name: e2e_authors e2e_users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_authors ADD CONSTRAINT e2e_users_pkey PRIMARY KEY (id); -- -- Name: e2e_user_notes_slug_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX e2e_user_notes_slug_idx ON public.e2e_user_posts USING btree (slug); -- -- Name: e2e_user_notes_user_id_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX e2e_user_notes_user_id_idx ON public.e2e_user_posts USING btree (author_id); -- -- Name: schema_migration_version_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX schema_migration_version_idx ON public.schema_migration USING btree (version); -- -- Name: e2e_user_posts e2e_user_notes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_user_id_fkey FOREIGN KEY (author_id) REFERENCES public.e2e_authors(id) ON DELETE CASCADE; -- -- PostgreSQL database dump complete -- ================================================ FILE: testdata/e2e/fixtures/postgres/down/15.sql ================================================ -- -- PostgreSQL database dump -- -- Dumped from database version 9.6.19 -- Dumped by pg_dump version 12.4 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; SET row_security = off; SET default_tablespace = ''; -- -- Name: e2e_address; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_address ( id uuid NOT NULL ); ALTER TABLE public.e2e_address OWNER TO postgres; -- -- Name: e2e_authors; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_authors ( id uuid NOT NULL, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL ); ALTER TABLE public.e2e_authors OWNER TO postgres; -- -- Name: e2e_flow; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_flow ( id uuid NOT NULL ); ALTER TABLE public.e2e_flow OWNER TO postgres; -- -- Name: e2e_token; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_token ( id uuid NOT NULL, token character varying(64) NOT NULL, e2e_flow_id uuid NOT NULL, e2e_address_id uuid NOT NULL, expires_at timestamp without time zone DEFAULT '2000-01-01 00:00:00'::timestamp without time zone NOT NULL, issued_at timestamp without time zone DEFAULT '2000-01-01 00:00:00'::timestamp without time zone NOT NULL ); ALTER TABLE public.e2e_token OWNER TO postgres; -- -- Name: e2e_user_posts; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_user_posts ( id uuid NOT NULL, author_id uuid, slug character varying(32) NOT NULL, content character varying(255) DEFAULT ''::character varying NOT NULL, published boolean DEFAULT false NOT NULL ); ALTER TABLE public.e2e_user_posts OWNER TO postgres; -- -- Name: schema_migration; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.schema_migration ( version character varying(14) NOT NULL ); ALTER TABLE public.schema_migration OWNER TO postgres; -- -- Name: e2e_address e2e_address_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_address ADD CONSTRAINT e2e_address_pkey PRIMARY KEY (id); -- -- Name: e2e_flow e2e_flow_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_flow ADD CONSTRAINT e2e_flow_pkey PRIMARY KEY (id); -- -- Name: e2e_token e2e_token_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_token ADD CONSTRAINT e2e_token_pkey PRIMARY KEY (id); -- -- Name: e2e_user_posts e2e_user_notes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_pkey PRIMARY KEY (id); -- -- Name: e2e_authors e2e_users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_authors ADD CONSTRAINT e2e_users_pkey PRIMARY KEY (id); -- -- Name: e2e_token_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX e2e_token_idx ON public.e2e_token USING btree (token); -- -- Name: e2e_token_uq_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX e2e_token_uq_idx ON public.e2e_token USING btree (token); -- -- Name: e2e_user_notes_slug_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX e2e_user_notes_slug_idx ON public.e2e_user_posts USING btree (slug); -- -- Name: e2e_user_notes_user_id_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX e2e_user_notes_user_id_idx ON public.e2e_user_posts USING btree (author_id); -- -- Name: schema_migration_version_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX schema_migration_version_idx ON public.schema_migration USING btree (version); -- -- Name: e2e_token e2e_token_e2e_address_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_token ADD CONSTRAINT e2e_token_e2e_address_id_fkey FOREIGN KEY (e2e_address_id) REFERENCES public.e2e_address(id) ON DELETE CASCADE; -- -- Name: e2e_token e2e_token_e2e_flow_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_token ADD CONSTRAINT e2e_token_e2e_flow_id_fkey FOREIGN KEY (e2e_flow_id) REFERENCES public.e2e_flow(id) ON DELETE CASCADE; -- -- Name: e2e_user_posts e2e_user_notes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_user_id_fkey FOREIGN KEY (author_id) REFERENCES public.e2e_authors(id) ON DELETE CASCADE; -- -- PostgreSQL database dump complete -- ================================================ FILE: testdata/e2e/fixtures/postgres/down/2.sql ================================================ -- -- PostgreSQL database dump -- -- Dumped from database version 9.6.19 -- Dumped by pg_dump version 12.4 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; SET row_security = off; SET default_tablespace = ''; -- -- Name: e2e_user_notes; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_user_notes ( id uuid NOT NULL, user_id uuid NOT NULL, notes character varying(255), title character varying(64) DEFAULT ''::character varying NOT NULL ); ALTER TABLE public.e2e_user_notes OWNER TO postgres; -- -- Name: e2e_users; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_users ( id uuid NOT NULL, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL, username character varying(255) ); ALTER TABLE public.e2e_users OWNER TO postgres; -- -- Name: schema_migration; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.schema_migration ( version character varying(14) NOT NULL ); ALTER TABLE public.schema_migration OWNER TO postgres; -- -- Name: e2e_user_notes e2e_user_notes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_notes ADD CONSTRAINT e2e_user_notes_pkey PRIMARY KEY (id); -- -- Name: e2e_users e2e_users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_users ADD CONSTRAINT e2e_users_pkey PRIMARY KEY (id); -- -- Name: e2e_user_notes_title_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX e2e_user_notes_title_idx ON public.e2e_user_notes USING btree (title); -- -- 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_notes USING btree (user_id); -- -- Name: schema_migration_version_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX schema_migration_version_idx ON public.schema_migration USING btree (version); -- -- Name: e2e_user_notes e2e_user_notes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_notes ADD CONSTRAINT e2e_user_notes_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.e2e_users(id) ON DELETE CASCADE; -- -- PostgreSQL database dump complete -- ================================================ FILE: testdata/e2e/fixtures/postgres/down/3.sql ================================================ -- -- PostgreSQL database dump -- -- Dumped from database version 9.6.19 -- Dumped by pg_dump version 12.4 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; SET row_security = off; SET default_tablespace = ''; -- -- Name: e2e_user_notes; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_user_notes ( id uuid NOT NULL, user_id uuid NOT NULL, notes character varying(255) ); ALTER TABLE public.e2e_user_notes OWNER TO postgres; -- -- Name: e2e_users; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_users ( id uuid NOT NULL, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL, username character varying(255) ); ALTER TABLE public.e2e_users OWNER TO postgres; -- -- Name: schema_migration; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.schema_migration ( version character varying(14) NOT NULL ); ALTER TABLE public.schema_migration OWNER TO postgres; -- -- Name: e2e_user_notes e2e_user_notes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_notes ADD CONSTRAINT e2e_user_notes_pkey PRIMARY KEY (id); -- -- Name: e2e_users e2e_users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_users ADD CONSTRAINT e2e_users_pkey PRIMARY KEY (id); -- -- 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_notes USING btree (user_id); -- -- Name: schema_migration_version_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX schema_migration_version_idx ON public.schema_migration USING btree (version); -- -- Name: e2e_user_notes e2e_user_notes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_notes ADD CONSTRAINT e2e_user_notes_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.e2e_users(id) ON DELETE CASCADE; -- -- PostgreSQL database dump complete -- ================================================ FILE: testdata/e2e/fixtures/postgres/down/4.sql ================================================ -- -- PostgreSQL database dump -- -- Dumped from database version 9.6.19 -- Dumped by pg_dump version 12.4 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; SET row_security = off; SET default_tablespace = ''; -- -- Name: e2e_user_notes; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_user_notes ( id uuid NOT NULL, user_id uuid NOT NULL, slug character varying(64) NOT NULL, notes character varying(255) ); ALTER TABLE public.e2e_user_notes OWNER TO postgres; -- -- Name: e2e_users; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_users ( id uuid NOT NULL, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL, username character varying(255) ); ALTER TABLE public.e2e_users OWNER TO postgres; -- -- Name: schema_migration; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.schema_migration ( version character varying(14) NOT NULL ); ALTER TABLE public.schema_migration OWNER TO postgres; -- -- Name: e2e_user_notes e2e_user_notes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_notes ADD CONSTRAINT e2e_user_notes_pkey PRIMARY KEY (id); -- -- Name: e2e_users e2e_users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_users ADD CONSTRAINT e2e_users_pkey PRIMARY KEY (id); -- -- Name: e2e_user_notes_slug_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX e2e_user_notes_slug_idx ON public.e2e_user_notes 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_notes USING btree (user_id); -- -- Name: schema_migration_version_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX schema_migration_version_idx ON public.schema_migration USING btree (version); -- -- Name: e2e_user_notes e2e_user_notes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_notes ADD CONSTRAINT e2e_user_notes_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.e2e_users(id) ON DELETE CASCADE; -- -- PostgreSQL database dump complete -- ================================================ FILE: testdata/e2e/fixtures/postgres/down/5.sql ================================================ -- -- PostgreSQL database dump -- -- Dumped from database version 9.6.19 -- Dumped by pg_dump version 12.4 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; SET row_security = off; SET default_tablespace = ''; -- -- Name: e2e_user_notes; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_user_notes ( id uuid NOT NULL, user_id uuid NOT NULL, slug character varying(64) NOT NULL, notes character varying(255) ); ALTER TABLE public.e2e_user_notes OWNER TO postgres; -- -- Name: e2e_users; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_users ( id uuid NOT NULL, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL, username character varying(255) ); ALTER TABLE public.e2e_users OWNER TO postgres; -- -- Name: schema_migration; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.schema_migration ( version character varying(14) NOT NULL ); ALTER TABLE public.schema_migration OWNER TO postgres; -- -- Name: e2e_user_notes e2e_user_notes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_notes ADD CONSTRAINT e2e_user_notes_pkey PRIMARY KEY (id); -- -- Name: e2e_users e2e_users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_users ADD CONSTRAINT e2e_users_pkey PRIMARY KEY (id); -- -- Name: e2e_user_notes_slug_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX e2e_user_notes_slug_idx ON public.e2e_user_notes 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_notes USING btree (user_id); -- -- Name: schema_migration_version_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX schema_migration_version_idx ON public.schema_migration USING btree (version); -- -- Name: e2e_user_notes e2e_user_notes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_notes ADD CONSTRAINT e2e_user_notes_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.e2e_users(id) ON DELETE CASCADE; -- -- PostgreSQL database dump complete -- ================================================ FILE: testdata/e2e/fixtures/postgres/down/6.sql ================================================ -- -- PostgreSQL database dump -- -- Dumped from database version 9.6.19 -- Dumped by pg_dump version 12.4 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; SET row_security = off; SET default_tablespace = ''; -- -- Name: e2e_user_notes; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_user_notes ( id uuid NOT NULL, user_id uuid NOT NULL, slug character varying(64) NOT NULL, notes character varying(255) ); ALTER TABLE public.e2e_user_notes OWNER TO postgres; -- -- Name: e2e_users; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_users ( id uuid NOT NULL, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL, username character varying(255) ); ALTER TABLE public.e2e_users OWNER TO postgres; -- -- Name: schema_migration; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.schema_migration ( version character varying(14) NOT NULL ); ALTER TABLE public.schema_migration OWNER TO postgres; -- -- Name: e2e_user_notes e2e_user_notes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_notes ADD CONSTRAINT e2e_user_notes_pkey PRIMARY KEY (id); -- -- Name: e2e_users e2e_users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_users ADD CONSTRAINT e2e_users_pkey PRIMARY KEY (id); -- -- Name: e2e_user_notes_slug_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX e2e_user_notes_slug_idx ON public.e2e_user_notes 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_notes USING btree (user_id); -- -- Name: schema_migration_version_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX schema_migration_version_idx ON public.schema_migration USING btree (version); -- -- Name: e2e_user_notes e2e_user_notes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_notes ADD CONSTRAINT e2e_user_notes_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.e2e_users(id) ON DELETE CASCADE; -- -- PostgreSQL database dump complete -- ================================================ FILE: testdata/e2e/fixtures/postgres/down/7.sql ================================================ -- -- PostgreSQL database dump -- -- Dumped from database version 9.6.19 -- Dumped by pg_dump version 12.4 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; SET row_security = off; SET default_tablespace = ''; -- -- Name: e2e_user_posts; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_user_posts ( id uuid NOT NULL, user_id uuid NOT NULL, slug character varying(64) NOT NULL, notes character varying(255) ); ALTER TABLE public.e2e_user_posts OWNER TO postgres; -- -- Name: e2e_users; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_users ( id uuid NOT NULL, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL, username character varying(255) ); ALTER TABLE public.e2e_users OWNER TO postgres; -- -- Name: schema_migration; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.schema_migration ( version character varying(14) NOT NULL ); ALTER TABLE public.schema_migration OWNER TO postgres; -- -- Name: e2e_user_posts e2e_user_notes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_pkey PRIMARY KEY (id); -- -- Name: e2e_users e2e_users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_users ADD CONSTRAINT e2e_users_pkey PRIMARY KEY (id); -- -- Name: e2e_user_notes_slug_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX e2e_user_notes_slug_idx ON public.e2e_user_posts USING btree (slug); -- -- Name: e2e_user_notes_user_id_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX e2e_user_notes_user_id_idx ON public.e2e_user_posts USING btree (user_id); -- -- Name: schema_migration_version_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX schema_migration_version_idx ON public.schema_migration USING btree (version); -- -- Name: e2e_user_posts e2e_user_notes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.e2e_users(id) ON DELETE CASCADE; -- -- PostgreSQL database dump complete -- ================================================ FILE: testdata/e2e/fixtures/postgres/down/8.sql ================================================ -- -- PostgreSQL database dump -- -- Dumped from database version 9.6.19 -- Dumped by pg_dump version 12.4 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; SET row_security = off; SET default_tablespace = ''; -- -- Name: e2e_user_posts; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_user_posts ( id uuid NOT NULL, user_id uuid NOT NULL, slug character varying(64) NOT NULL, content character varying(255) DEFAULT ''::character varying NOT NULL ); ALTER TABLE public.e2e_user_posts OWNER TO postgres; -- -- Name: e2e_users; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_users ( id uuid NOT NULL, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL, username character varying(255) ); ALTER TABLE public.e2e_users OWNER TO postgres; -- -- Name: schema_migration; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.schema_migration ( version character varying(14) NOT NULL ); ALTER TABLE public.schema_migration OWNER TO postgres; -- -- Name: e2e_user_posts e2e_user_notes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_pkey PRIMARY KEY (id); -- -- Name: e2e_users e2e_users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_users ADD CONSTRAINT e2e_users_pkey PRIMARY KEY (id); -- -- Name: e2e_user_notes_slug_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX e2e_user_notes_slug_idx ON public.e2e_user_posts USING btree (slug); -- -- Name: e2e_user_notes_user_id_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX e2e_user_notes_user_id_idx ON public.e2e_user_posts USING btree (user_id); -- -- Name: schema_migration_version_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX schema_migration_version_idx ON public.schema_migration USING btree (version); -- -- Name: e2e_user_posts e2e_user_notes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.e2e_users(id) ON DELETE CASCADE; -- -- PostgreSQL database dump complete -- ================================================ FILE: testdata/e2e/fixtures/postgres/down/9.sql ================================================ -- -- PostgreSQL database dump -- -- Dumped from database version 9.6.19 -- Dumped by pg_dump version 12.4 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; SET row_security = off; SET default_tablespace = ''; -- -- Name: e2e_user_posts; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_user_posts ( id uuid NOT NULL, user_id uuid NOT NULL, slug character varying(64) NOT NULL, content character varying(255) DEFAULT ''::character varying NOT NULL ); ALTER TABLE public.e2e_user_posts OWNER TO postgres; -- -- Name: e2e_users; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_users ( id uuid NOT NULL, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL, name character varying(255) ); ALTER TABLE public.e2e_users OWNER TO postgres; -- -- Name: schema_migration; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.schema_migration ( version character varying(14) NOT NULL ); ALTER TABLE public.schema_migration OWNER TO postgres; -- -- Name: e2e_user_posts e2e_user_notes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_pkey PRIMARY KEY (id); -- -- Name: e2e_users e2e_users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_users ADD CONSTRAINT e2e_users_pkey PRIMARY KEY (id); -- -- Name: e2e_user_notes_slug_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX e2e_user_notes_slug_idx ON public.e2e_user_posts USING btree (slug); -- -- Name: e2e_user_notes_user_id_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX e2e_user_notes_user_id_idx ON public.e2e_user_posts USING btree (user_id); -- -- Name: schema_migration_version_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX schema_migration_version_idx ON public.schema_migration USING btree (version); -- -- Name: e2e_user_posts e2e_user_notes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.e2e_users(id) ON DELETE CASCADE; -- -- PostgreSQL database dump complete -- ================================================ FILE: testdata/e2e/fixtures/postgres/up/0.sql ================================================ -- -- PostgreSQL database dump -- -- Dumped from database version 9.6.19 -- Dumped by pg_dump version 12.4 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; SET row_security = off; SET default_tablespace = ''; -- -- Name: e2e_users; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_users ( id uuid NOT NULL, username character varying(255), created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL ); ALTER TABLE public.e2e_users 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_users e2e_users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_users ADD CONSTRAINT e2e_users_pkey PRIMARY KEY (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); -- -- PostgreSQL database dump complete -- ================================================ FILE: testdata/e2e/fixtures/postgres/up/1.sql ================================================ -- -- PostgreSQL database dump -- -- Dumped from database version 9.6.19 -- Dumped by pg_dump version 12.4 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; SET row_security = off; SET default_tablespace = ''; -- -- Name: e2e_user_notes; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_user_notes ( id uuid NOT NULL, notes character varying(255), title character varying(64) DEFAULT ''::character varying NOT NULL, user_id uuid NOT NULL ); ALTER TABLE public.e2e_user_notes OWNER TO postgres; -- -- Name: e2e_users; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_users ( id uuid NOT NULL, username character varying(255), created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL ); ALTER TABLE public.e2e_users OWNER TO postgres; -- -- Name: schema_migration; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.schema_migration ( version character varying(14) NOT NULL ); ALTER TABLE public.schema_migration OWNER TO postgres; -- -- Name: e2e_user_notes e2e_user_notes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_notes ADD CONSTRAINT e2e_user_notes_pkey PRIMARY KEY (id); -- -- Name: e2e_users e2e_users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_users ADD CONSTRAINT e2e_users_pkey PRIMARY KEY (id); -- -- Name: e2e_user_notes_title_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX e2e_user_notes_title_idx ON public.e2e_user_notes USING btree (title); -- -- 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_notes USING btree (user_id); -- -- Name: schema_migration_version_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX schema_migration_version_idx ON public.schema_migration USING btree (version); -- -- Name: e2e_user_notes e2e_user_notes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_notes ADD CONSTRAINT e2e_user_notes_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.e2e_users(id) ON DELETE CASCADE; -- -- PostgreSQL database dump complete -- ================================================ FILE: testdata/e2e/fixtures/postgres/up/10.sql ================================================ -- -- PostgreSQL database dump -- -- Dumped from database version 9.6.19 -- Dumped by pg_dump version 12.4 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; SET row_security = off; SET default_tablespace = ''; -- -- Name: e2e_user_posts; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_user_posts ( id uuid NOT NULL, user_id uuid NOT NULL, slug character varying(32) NOT NULL, content character varying(255) DEFAULT ''::character varying NOT NULL ); ALTER TABLE public.e2e_user_posts OWNER TO postgres; -- -- Name: e2e_users; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_users ( id uuid NOT NULL, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL ); ALTER TABLE public.e2e_users OWNER TO postgres; -- -- Name: schema_migration; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.schema_migration ( version character varying(14) NOT NULL ); ALTER TABLE public.schema_migration OWNER TO postgres; -- -- Name: e2e_user_posts e2e_user_notes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_pkey PRIMARY KEY (id); -- -- Name: e2e_users e2e_users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_users ADD CONSTRAINT e2e_users_pkey PRIMARY KEY (id); -- -- Name: e2e_user_notes_slug_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX e2e_user_notes_slug_idx ON public.e2e_user_posts USING btree (slug); -- -- Name: e2e_user_notes_user_id_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX e2e_user_notes_user_id_idx ON public.e2e_user_posts USING btree (user_id); -- -- Name: schema_migration_version_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX schema_migration_version_idx ON public.schema_migration USING btree (version); -- -- Name: e2e_user_posts e2e_user_notes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.e2e_users(id) ON DELETE CASCADE; -- -- PostgreSQL database dump complete -- ================================================ FILE: testdata/e2e/fixtures/postgres/up/11.sql ================================================ -- -- PostgreSQL database dump -- -- Dumped from database version 9.6.19 -- Dumped by pg_dump version 12.4 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; SET row_security = off; SET default_tablespace = ''; -- -- Name: e2e_authors; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_authors ( id uuid NOT NULL, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL ); ALTER TABLE public.e2e_authors OWNER TO postgres; -- -- Name: e2e_user_posts; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_user_posts ( id uuid NOT NULL, user_id uuid NOT NULL, slug character varying(32) NOT NULL, content character varying(255) DEFAULT ''::character varying NOT NULL ); ALTER TABLE public.e2e_user_posts OWNER TO postgres; -- -- Name: schema_migration; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.schema_migration ( version character varying(14) NOT NULL ); ALTER TABLE public.schema_migration OWNER TO postgres; -- -- Name: e2e_user_posts e2e_user_notes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_pkey PRIMARY KEY (id); -- -- Name: e2e_authors e2e_users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_authors ADD CONSTRAINT e2e_users_pkey PRIMARY KEY (id); -- -- Name: e2e_user_notes_slug_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX e2e_user_notes_slug_idx ON public.e2e_user_posts USING btree (slug); -- -- Name: e2e_user_notes_user_id_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX e2e_user_notes_user_id_idx ON public.e2e_user_posts USING btree (user_id); -- -- Name: schema_migration_version_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX schema_migration_version_idx ON public.schema_migration USING btree (version); -- -- Name: e2e_user_posts e2e_user_notes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.e2e_authors(id) ON DELETE CASCADE; -- -- PostgreSQL database dump complete -- ================================================ FILE: testdata/e2e/fixtures/postgres/up/12.sql ================================================ -- -- PostgreSQL database dump -- -- Dumped from database version 9.6.19 -- Dumped by pg_dump version 12.4 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; SET row_security = off; SET default_tablespace = ''; -- -- Name: e2e_authors; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_authors ( id uuid NOT NULL, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL ); ALTER TABLE public.e2e_authors OWNER TO postgres; -- -- Name: e2e_user_posts; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_user_posts ( id uuid NOT NULL, author_id uuid NOT NULL, slug character varying(32) NOT NULL, content character varying(255) DEFAULT ''::character varying NOT NULL ); ALTER TABLE public.e2e_user_posts OWNER TO postgres; -- -- Name: schema_migration; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.schema_migration ( version character varying(14) NOT NULL ); ALTER TABLE public.schema_migration OWNER TO postgres; -- -- Name: e2e_user_posts e2e_user_notes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_pkey PRIMARY KEY (id); -- -- Name: e2e_authors e2e_users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_authors ADD CONSTRAINT e2e_users_pkey PRIMARY KEY (id); -- -- Name: e2e_user_notes_slug_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX e2e_user_notes_slug_idx ON public.e2e_user_posts USING btree (slug); -- -- Name: e2e_user_notes_user_id_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX e2e_user_notes_user_id_idx ON public.e2e_user_posts USING btree (author_id); -- -- Name: schema_migration_version_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX schema_migration_version_idx ON public.schema_migration USING btree (version); -- -- Name: e2e_user_posts e2e_user_notes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_user_id_fkey FOREIGN KEY (author_id) REFERENCES public.e2e_authors(id) ON DELETE CASCADE; -- -- PostgreSQL database dump complete -- ================================================ FILE: testdata/e2e/fixtures/postgres/up/13.sql ================================================ -- -- PostgreSQL database dump -- -- Dumped from database version 9.6.19 -- Dumped by pg_dump version 12.4 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; SET row_security = off; SET default_tablespace = ''; -- -- Name: e2e_authors; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_authors ( id uuid NOT NULL, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL ); ALTER TABLE public.e2e_authors OWNER TO postgres; -- -- Name: e2e_user_posts; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_user_posts ( id uuid NOT NULL, author_id uuid, slug character varying(32) NOT NULL, content character varying(255) DEFAULT ''::character varying NOT NULL, published boolean DEFAULT false NOT NULL ); ALTER TABLE public.e2e_user_posts OWNER TO postgres; -- -- Name: schema_migration; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.schema_migration ( version character varying(14) NOT NULL ); ALTER TABLE public.schema_migration OWNER TO postgres; -- -- Name: e2e_user_posts e2e_user_notes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_pkey PRIMARY KEY (id); -- -- Name: e2e_authors e2e_users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_authors ADD CONSTRAINT e2e_users_pkey PRIMARY KEY (id); -- -- Name: e2e_user_notes_slug_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX e2e_user_notes_slug_idx ON public.e2e_user_posts USING btree (slug); -- -- Name: e2e_user_notes_user_id_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX e2e_user_notes_user_id_idx ON public.e2e_user_posts USING btree (author_id); -- -- Name: schema_migration_version_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX schema_migration_version_idx ON public.schema_migration USING btree (version); -- -- Name: e2e_user_posts e2e_user_notes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_user_id_fkey FOREIGN KEY (author_id) REFERENCES public.e2e_authors(id) ON DELETE CASCADE; -- -- PostgreSQL database dump complete -- ================================================ FILE: testdata/e2e/fixtures/postgres/up/14.sql ================================================ -- -- PostgreSQL database dump -- -- Dumped from database version 9.6.19 -- Dumped by pg_dump version 12.4 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; SET row_security = off; SET default_tablespace = ''; -- -- Name: e2e_address; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_address ( id uuid NOT NULL ); ALTER TABLE public.e2e_address OWNER TO postgres; -- -- Name: e2e_authors; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_authors ( id uuid NOT NULL, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL ); ALTER TABLE public.e2e_authors OWNER TO postgres; -- -- Name: e2e_flow; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_flow ( id uuid NOT NULL ); ALTER TABLE public.e2e_flow OWNER TO postgres; -- -- Name: e2e_token; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_token ( id uuid NOT NULL, token character varying(64) NOT NULL, e2e_flow_id uuid NOT NULL, e2e_address_id uuid NOT NULL ); ALTER TABLE public.e2e_token OWNER TO postgres; -- -- Name: e2e_user_posts; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_user_posts ( id uuid NOT NULL, author_id uuid, slug character varying(32) NOT NULL, content character varying(255) DEFAULT ''::character varying NOT NULL, published boolean DEFAULT false NOT NULL ); ALTER TABLE public.e2e_user_posts OWNER TO postgres; -- -- Name: schema_migration; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.schema_migration ( version character varying(14) NOT NULL ); ALTER TABLE public.schema_migration OWNER TO postgres; -- -- Name: e2e_address e2e_address_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_address ADD CONSTRAINT e2e_address_pkey PRIMARY KEY (id); -- -- Name: e2e_flow e2e_flow_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_flow ADD CONSTRAINT e2e_flow_pkey PRIMARY KEY (id); -- -- Name: e2e_token e2e_token_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_token ADD CONSTRAINT e2e_token_pkey PRIMARY KEY (id); -- -- Name: e2e_user_posts e2e_user_notes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_pkey PRIMARY KEY (id); -- -- Name: e2e_authors e2e_users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_authors ADD CONSTRAINT e2e_users_pkey PRIMARY KEY (id); -- -- Name: e2e_token_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX e2e_token_idx ON public.e2e_token USING btree (token); -- -- Name: e2e_token_uq_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX e2e_token_uq_idx ON public.e2e_token USING btree (token); -- -- Name: e2e_user_notes_slug_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX e2e_user_notes_slug_idx ON public.e2e_user_posts USING btree (slug); -- -- Name: e2e_user_notes_user_id_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX e2e_user_notes_user_id_idx ON public.e2e_user_posts USING btree (author_id); -- -- Name: schema_migration_version_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX schema_migration_version_idx ON public.schema_migration USING btree (version); -- -- Name: e2e_token e2e_token_e2e_address_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_token ADD CONSTRAINT e2e_token_e2e_address_id_fkey FOREIGN KEY (e2e_address_id) REFERENCES public.e2e_address(id) ON DELETE CASCADE; -- -- Name: e2e_token e2e_token_e2e_flow_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_token ADD CONSTRAINT e2e_token_e2e_flow_id_fkey FOREIGN KEY (e2e_flow_id) REFERENCES public.e2e_flow(id) ON DELETE CASCADE; -- -- Name: e2e_user_posts e2e_user_notes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_user_id_fkey FOREIGN KEY (author_id) REFERENCES public.e2e_authors(id) ON DELETE CASCADE; -- -- PostgreSQL database dump complete -- ================================================ FILE: testdata/e2e/fixtures/postgres/up/15.sql ================================================ -- -- PostgreSQL database dump -- -- Dumped from database version 9.6.19 -- Dumped by pg_dump version 12.4 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; SET row_security = off; SET default_tablespace = ''; -- -- Name: e2e_address; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_address ( id uuid NOT NULL ); ALTER TABLE public.e2e_address OWNER TO postgres; -- -- Name: e2e_authors; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_authors ( id uuid NOT NULL, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL ); ALTER TABLE public.e2e_authors OWNER TO postgres; -- -- Name: e2e_flow; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_flow ( id uuid NOT NULL ); ALTER TABLE public.e2e_flow OWNER TO postgres; -- -- Name: e2e_token; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_token ( id uuid NOT NULL, token character varying(64) NOT NULL, e2e_flow_id uuid, e2e_address_id uuid NOT NULL, expires_at timestamp without time zone DEFAULT '2000-01-01 00:00:00'::timestamp without time zone NOT NULL, issued_at timestamp without time zone DEFAULT '2000-01-01 00:00:00'::timestamp without time zone NOT NULL ); ALTER TABLE public.e2e_token OWNER TO postgres; -- -- Name: e2e_user_posts; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_user_posts ( id uuid NOT NULL, author_id uuid, slug character varying(32) NOT NULL, content character varying(255) DEFAULT ''::character varying NOT NULL, published boolean DEFAULT false NOT NULL ); ALTER TABLE public.e2e_user_posts OWNER TO postgres; -- -- Name: schema_migration; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.schema_migration ( version character varying(14) NOT NULL ); ALTER TABLE public.schema_migration OWNER TO postgres; -- -- Name: e2e_address e2e_address_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_address ADD CONSTRAINT e2e_address_pkey PRIMARY KEY (id); -- -- Name: e2e_flow e2e_flow_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_flow ADD CONSTRAINT e2e_flow_pkey PRIMARY KEY (id); -- -- Name: e2e_token e2e_token_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_token ADD CONSTRAINT e2e_token_pkey PRIMARY KEY (id); -- -- Name: e2e_user_posts e2e_user_notes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_pkey PRIMARY KEY (id); -- -- Name: e2e_authors e2e_users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_authors ADD CONSTRAINT e2e_users_pkey PRIMARY KEY (id); -- -- Name: e2e_token_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX e2e_token_idx ON public.e2e_token USING btree (token); -- -- Name: e2e_token_uq_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX e2e_token_uq_idx ON public.e2e_token USING btree (token); -- -- Name: e2e_user_notes_slug_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX e2e_user_notes_slug_idx ON public.e2e_user_posts USING btree (slug); -- -- Name: e2e_user_notes_user_id_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX e2e_user_notes_user_id_idx ON public.e2e_user_posts USING btree (author_id); -- -- Name: schema_migration_version_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX schema_migration_version_idx ON public.schema_migration USING btree (version); -- -- Name: e2e_token e2e_token_e2e_address_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_token ADD CONSTRAINT e2e_token_e2e_address_id_fkey FOREIGN KEY (e2e_address_id) REFERENCES public.e2e_address(id) ON DELETE CASCADE; -- -- Name: e2e_token e2e_token_e2e_flow_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_token ADD CONSTRAINT e2e_token_e2e_flow_id_fkey FOREIGN KEY (e2e_flow_id) REFERENCES public.e2e_flow(id) ON DELETE CASCADE; -- -- Name: e2e_user_posts e2e_user_notes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_user_id_fkey FOREIGN KEY (author_id) REFERENCES public.e2e_authors(id) ON DELETE CASCADE; -- -- PostgreSQL database dump complete -- ================================================ FILE: testdata/e2e/fixtures/postgres/up/2.sql ================================================ -- -- PostgreSQL database dump -- -- Dumped from database version 9.6.19 -- Dumped by pg_dump version 12.4 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; SET row_security = off; SET default_tablespace = ''; -- -- Name: e2e_user_notes; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_user_notes ( id uuid NOT NULL, notes character varying(255), user_id uuid NOT NULL ); ALTER TABLE public.e2e_user_notes OWNER TO postgres; -- -- Name: e2e_users; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_users ( id uuid NOT NULL, username character varying(255), created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL ); ALTER TABLE public.e2e_users OWNER TO postgres; -- -- Name: schema_migration; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.schema_migration ( version character varying(14) NOT NULL ); ALTER TABLE public.schema_migration OWNER TO postgres; -- -- Name: e2e_user_notes e2e_user_notes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_notes ADD CONSTRAINT e2e_user_notes_pkey PRIMARY KEY (id); -- -- Name: e2e_users e2e_users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_users ADD CONSTRAINT e2e_users_pkey PRIMARY KEY (id); -- -- 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_notes USING btree (user_id); -- -- Name: schema_migration_version_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX schema_migration_version_idx ON public.schema_migration USING btree (version); -- -- Name: e2e_user_notes e2e_user_notes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_notes ADD CONSTRAINT e2e_user_notes_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.e2e_users(id) ON DELETE CASCADE; -- -- PostgreSQL database dump complete -- ================================================ FILE: testdata/e2e/fixtures/postgres/up/3.sql ================================================ -- -- PostgreSQL database dump -- -- Dumped from database version 9.6.19 -- Dumped by pg_dump version 12.4 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; SET row_security = off; SET default_tablespace = ''; -- -- Name: e2e_user_notes; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_user_notes ( id uuid NOT NULL, notes character varying(255), user_id uuid NOT NULL, slug character varying(64) ); ALTER TABLE public.e2e_user_notes OWNER TO postgres; -- -- Name: e2e_users; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_users ( id uuid NOT NULL, username character varying(255), created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL ); ALTER TABLE public.e2e_users OWNER TO postgres; -- -- Name: schema_migration; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.schema_migration ( version character varying(14) NOT NULL ); ALTER TABLE public.schema_migration OWNER TO postgres; -- -- Name: e2e_user_notes e2e_user_notes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_notes ADD CONSTRAINT e2e_user_notes_pkey PRIMARY KEY (id); -- -- Name: e2e_users e2e_users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_users ADD CONSTRAINT e2e_users_pkey PRIMARY KEY (id); -- -- 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_notes USING btree (user_id); -- -- Name: schema_migration_version_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX schema_migration_version_idx ON public.schema_migration USING btree (version); -- -- Name: e2e_user_notes e2e_user_notes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_notes ADD CONSTRAINT e2e_user_notes_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.e2e_users(id) ON DELETE CASCADE; -- -- PostgreSQL database dump complete -- ================================================ FILE: testdata/e2e/fixtures/postgres/up/4.sql ================================================ -- -- PostgreSQL database dump -- -- Dumped from database version 9.6.19 -- Dumped by pg_dump version 12.4 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; SET row_security = off; SET default_tablespace = ''; -- -- Name: e2e_user_notes; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_user_notes ( id uuid NOT NULL, notes character varying(255), user_id uuid NOT NULL, slug character varying(64) ); ALTER TABLE public.e2e_user_notes OWNER TO postgres; -- -- Name: e2e_users; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_users ( id uuid NOT NULL, username character varying(255), created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL ); ALTER TABLE public.e2e_users OWNER TO postgres; -- -- Name: schema_migration; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.schema_migration ( version character varying(14) NOT NULL ); ALTER TABLE public.schema_migration OWNER TO postgres; -- -- Name: e2e_user_notes e2e_user_notes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_notes ADD CONSTRAINT e2e_user_notes_pkey PRIMARY KEY (id); -- -- Name: e2e_users e2e_users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_users ADD CONSTRAINT e2e_users_pkey PRIMARY KEY (id); -- -- 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_notes USING btree (user_id); -- -- Name: schema_migration_version_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX schema_migration_version_idx ON public.schema_migration USING btree (version); -- -- Name: e2e_user_notes e2e_user_notes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_notes ADD CONSTRAINT e2e_user_notes_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.e2e_users(id) ON DELETE CASCADE; -- -- PostgreSQL database dump complete -- ================================================ FILE: testdata/e2e/fixtures/postgres/up/5.sql ================================================ -- -- PostgreSQL database dump -- -- Dumped from database version 9.6.19 -- Dumped by pg_dump version 12.4 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; SET row_security = off; SET default_tablespace = ''; -- -- Name: e2e_user_notes; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_user_notes ( id uuid NOT NULL, notes character varying(255), user_id uuid NOT NULL, slug character varying(64) NOT NULL ); ALTER TABLE public.e2e_user_notes OWNER TO postgres; -- -- Name: e2e_users; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_users ( id uuid NOT NULL, username character varying(255), created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL ); ALTER TABLE public.e2e_users OWNER TO postgres; -- -- Name: schema_migration; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.schema_migration ( version character varying(14) NOT NULL ); ALTER TABLE public.schema_migration OWNER TO postgres; -- -- Name: e2e_user_notes e2e_user_notes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_notes ADD CONSTRAINT e2e_user_notes_pkey PRIMARY KEY (id); -- -- Name: e2e_users e2e_users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_users ADD CONSTRAINT e2e_users_pkey PRIMARY KEY (id); -- -- Name: e2e_user_notes_slug_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX e2e_user_notes_slug_idx ON public.e2e_user_notes 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_notes USING btree (user_id); -- -- Name: schema_migration_version_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX schema_migration_version_idx ON public.schema_migration USING btree (version); -- -- Name: e2e_user_notes e2e_user_notes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_notes ADD CONSTRAINT e2e_user_notes_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.e2e_users(id) ON DELETE CASCADE; -- -- PostgreSQL database dump complete -- ================================================ FILE: testdata/e2e/fixtures/postgres/up/6.sql ================================================ -- -- PostgreSQL database dump -- -- Dumped from database version 9.6.19 -- Dumped by pg_dump version 12.4 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; SET row_security = off; SET default_tablespace = ''; -- -- Name: e2e_user_posts; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_user_posts ( id uuid NOT NULL, notes character varying(255), user_id uuid NOT NULL, slug character varying(64) NOT NULL ); ALTER TABLE public.e2e_user_posts OWNER TO postgres; -- -- Name: e2e_users; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_users ( id uuid NOT NULL, username character varying(255), created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL ); ALTER TABLE public.e2e_users OWNER TO postgres; -- -- Name: schema_migration; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.schema_migration ( version character varying(14) NOT NULL ); ALTER TABLE public.schema_migration OWNER TO postgres; -- -- Name: e2e_user_posts e2e_user_notes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_pkey PRIMARY KEY (id); -- -- Name: e2e_users e2e_users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_users ADD CONSTRAINT e2e_users_pkey PRIMARY KEY (id); -- -- Name: e2e_user_notes_slug_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX e2e_user_notes_slug_idx ON public.e2e_user_posts USING btree (slug); -- -- Name: e2e_user_notes_user_id_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX e2e_user_notes_user_id_idx ON public.e2e_user_posts USING btree (user_id); -- -- Name: schema_migration_version_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX schema_migration_version_idx ON public.schema_migration USING btree (version); -- -- Name: e2e_user_posts e2e_user_notes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.e2e_users(id) ON DELETE CASCADE; -- -- PostgreSQL database dump complete -- ================================================ FILE: testdata/e2e/fixtures/postgres/up/7.sql ================================================ -- -- PostgreSQL database dump -- -- Dumped from database version 9.6.19 -- Dumped by pg_dump version 12.4 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; SET row_security = off; SET default_tablespace = ''; -- -- Name: e2e_user_posts; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_user_posts ( id uuid NOT NULL, user_id uuid NOT NULL, slug character varying(64) NOT NULL, content character varying(255) DEFAULT ''::character varying NOT NULL ); ALTER TABLE public.e2e_user_posts OWNER TO postgres; -- -- Name: e2e_users; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_users ( id uuid NOT NULL, username character varying(255), created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL ); ALTER TABLE public.e2e_users OWNER TO postgres; -- -- Name: schema_migration; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.schema_migration ( version character varying(14) NOT NULL ); ALTER TABLE public.schema_migration OWNER TO postgres; -- -- Name: e2e_user_posts e2e_user_notes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_pkey PRIMARY KEY (id); -- -- Name: e2e_users e2e_users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_users ADD CONSTRAINT e2e_users_pkey PRIMARY KEY (id); -- -- Name: e2e_user_notes_slug_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX e2e_user_notes_slug_idx ON public.e2e_user_posts USING btree (slug); -- -- Name: e2e_user_notes_user_id_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX e2e_user_notes_user_id_idx ON public.e2e_user_posts USING btree (user_id); -- -- Name: schema_migration_version_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX schema_migration_version_idx ON public.schema_migration USING btree (version); -- -- Name: e2e_user_posts e2e_user_notes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.e2e_users(id) ON DELETE CASCADE; -- -- PostgreSQL database dump complete -- ================================================ FILE: testdata/e2e/fixtures/postgres/up/8.sql ================================================ -- -- PostgreSQL database dump -- -- Dumped from database version 9.6.19 -- Dumped by pg_dump version 12.4 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; SET row_security = off; SET default_tablespace = ''; -- -- Name: e2e_user_posts; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_user_posts ( id uuid NOT NULL, user_id uuid NOT NULL, slug character varying(64) NOT NULL, content character varying(255) DEFAULT ''::character varying NOT NULL ); ALTER TABLE public.e2e_user_posts OWNER TO postgres; -- -- Name: e2e_users; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_users ( id uuid NOT NULL, name character varying(255), created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL ); ALTER TABLE public.e2e_users OWNER TO postgres; -- -- Name: schema_migration; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.schema_migration ( version character varying(14) NOT NULL ); ALTER TABLE public.schema_migration OWNER TO postgres; -- -- Name: e2e_user_posts e2e_user_notes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_pkey PRIMARY KEY (id); -- -- Name: e2e_users e2e_users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_users ADD CONSTRAINT e2e_users_pkey PRIMARY KEY (id); -- -- Name: e2e_user_notes_slug_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX e2e_user_notes_slug_idx ON public.e2e_user_posts USING btree (slug); -- -- Name: e2e_user_notes_user_id_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX e2e_user_notes_user_id_idx ON public.e2e_user_posts USING btree (user_id); -- -- Name: schema_migration_version_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX schema_migration_version_idx ON public.schema_migration USING btree (version); -- -- Name: e2e_user_posts e2e_user_notes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.e2e_users(id) ON DELETE CASCADE; -- -- PostgreSQL database dump complete -- ================================================ FILE: testdata/e2e/fixtures/postgres/up/9.sql ================================================ -- -- PostgreSQL database dump -- -- Dumped from database version 9.6.19 -- Dumped by pg_dump version 12.4 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET xmloption = content; SET client_min_messages = warning; SET row_security = off; SET default_tablespace = ''; -- -- Name: e2e_user_posts; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_user_posts ( id uuid NOT NULL, user_id uuid NOT NULL, slug character varying(64) NOT NULL, content character varying(255) DEFAULT ''::character varying NOT NULL ); ALTER TABLE public.e2e_user_posts OWNER TO postgres; -- -- Name: e2e_users; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.e2e_users ( id uuid NOT NULL, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL ); ALTER TABLE public.e2e_users OWNER TO postgres; -- -- Name: schema_migration; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.schema_migration ( version character varying(14) NOT NULL ); ALTER TABLE public.schema_migration OWNER TO postgres; -- -- Name: e2e_user_posts e2e_user_notes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_pkey PRIMARY KEY (id); -- -- Name: e2e_users e2e_users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_users ADD CONSTRAINT e2e_users_pkey PRIMARY KEY (id); -- -- Name: e2e_user_notes_slug_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX e2e_user_notes_slug_idx ON public.e2e_user_posts USING btree (slug); -- -- Name: e2e_user_notes_user_id_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX e2e_user_notes_user_id_idx ON public.e2e_user_posts USING btree (user_id); -- -- Name: schema_migration_version_idx; Type: INDEX; Schema: public; Owner: postgres -- CREATE UNIQUE INDEX schema_migration_version_idx ON public.schema_migration USING btree (version); -- -- Name: e2e_user_posts e2e_user_notes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- ALTER TABLE ONLY public.e2e_user_posts ADD CONSTRAINT e2e_user_notes_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.e2e_users(id) ON DELETE CASCADE; -- -- PostgreSQL database dump complete -- ================================================ FILE: testdata/e2e/fixtures/sqlite3/down/0.sql ================================================ CREATE TABLE IF NOT EXISTS "schema_migration" ( "version" TEXT NOT NULL ); CREATE UNIQUE INDEX "schema_migration_version_idx" ON "schema_migration" (version); ================================================ FILE: testdata/e2e/fixtures/sqlite3/down/1.sql ================================================ 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 , "username" TEXT); ================================================ FILE: testdata/e2e/fixtures/sqlite3/down/10.sql ================================================ 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 '', 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); ================================================ FILE: testdata/e2e/fixtures/sqlite3/down/11.sql ================================================ 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 '', 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); ================================================ FILE: testdata/e2e/fixtures/sqlite3/down/12.sql ================================================ 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, "user_id" char(36) NOT NULL, "slug" TEXT NOT NULL, "content" TEXT NOT NULL DEFAULT '', FOREIGN KEY ("user_id") REFERENCES e2e_authors (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); ================================================ FILE: testdata/e2e/fixtures/sqlite3/down/13.sql ================================================ 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) NOT NULL, "slug" TEXT NOT NULL, "content" TEXT NOT NULL DEFAULT '', 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); ================================================ FILE: testdata/e2e/fixtures/sqlite3/down/14.sql ================================================ 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); ================================================ FILE: testdata/e2e/fixtures/sqlite3/down/15.sql ================================================ CREATE TABLE IF NOT EXISTS "schema_migration" ( "version" TEXT NOT NULL ); CREATE UNIQUE INDEX "schema_migration_version_idx" ON "schema_migration" (version); CREATE TABLE IF NOT EXISTS "e2e_authors" ( "id" TEXT PRIMARY KEY, "created_at" DATETIME NOT NULL, "updated_at" DATETIME NOT NULL ); CREATE TABLE IF NOT EXISTS "e2e_user_posts" ( "id" TEXT PRIMARY KEY, "author_id" char(36), "slug" TEXT NOT NULL, "content" TEXT NOT NULL DEFAULT '', "published" bool NOT NULL DEFAULT FALSE, FOREIGN KEY (author_id) REFERENCES e2e_authors (id) ON UPDATE NO ACTION ON DELETE CASCADE ); CREATE UNIQUE INDEX "e2e_user_notes_slug_idx" ON "e2e_user_posts" (slug); CREATE INDEX "e2e_user_notes_user_id_idx" ON "e2e_user_posts" (author_id); CREATE TABLE IF NOT EXISTS "e2e_flow" ( "id" TEXT PRIMARY KEY ); CREATE TABLE IF NOT EXISTS "e2e_address" ( "id" TEXT PRIMARY KEY ); CREATE TABLE IF NOT EXISTS "e2e_token" ( "id" TEXT PRIMARY KEY, "token" TEXT NOT NULL, "e2e_flow_id" char(36) NOT NULL, "e2e_address_id" char(36) NOT NULL, "expires_at" DATETIME NOT NULL DEFAULT '2000-01-01 00:00:00', "issued_at" DATETIME NOT NULL DEFAULT '2000-01-01 00:00:00', FOREIGN KEY (e2e_flow_id) REFERENCES e2e_flow (id) ON UPDATE NO ACTION ON DELETE CASCADE, FOREIGN KEY (e2e_address_id) REFERENCES e2e_address (id) ON UPDATE NO ACTION ON DELETE CASCADE ); CREATE UNIQUE INDEX "e2e_token_uq_idx" ON "e2e_token" (token); CREATE INDEX "e2e_token_idx" ON "e2e_token" (token); ================================================ FILE: testdata/e2e/fixtures/sqlite3/down/2.sql ================================================ 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 , "username" TEXT); CREATE TABLE IF NOT EXISTS "e2e_user_notes" ( "id" TEXT PRIMARY KEY, "user_id" char(36) NOT NULL, "notes" TEXT, "title" 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_notes" (user_id); CREATE INDEX "e2e_user_notes_title_idx" ON "e2e_user_notes" (title); ================================================ FILE: testdata/e2e/fixtures/sqlite3/down/3.sql ================================================ 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 , "username" TEXT); CREATE TABLE IF NOT EXISTS "e2e_user_notes" ( "id" TEXT PRIMARY KEY, "user_id" char(36) NOT NULL, "notes" TEXT, 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); ================================================ FILE: testdata/e2e/fixtures/sqlite3/down/4.sql ================================================ 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 , "username" TEXT); CREATE TABLE IF NOT EXISTS "e2e_user_notes" ( "id" TEXT PRIMARY KEY, "user_id" char(36) NOT NULL, "slug" TEXT NOT NULL, "notes" TEXT, 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); CREATE UNIQUE INDEX "e2e_user_notes_slug_idx" ON "e2e_user_notes" (slug); ================================================ FILE: testdata/e2e/fixtures/sqlite3/down/5.sql ================================================ 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 , "username" TEXT); CREATE TABLE IF NOT EXISTS "e2e_user_notes" ( "id" TEXT PRIMARY KEY, "user_id" char(36) NOT NULL, "slug" TEXT NOT NULL, "notes" TEXT, 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); CREATE UNIQUE INDEX "e2e_user_notes_slug_idx" ON "e2e_user_notes" (slug); ================================================ FILE: testdata/e2e/fixtures/sqlite3/down/6.sql ================================================ 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 , "username" TEXT); CREATE TABLE IF NOT EXISTS "e2e_user_notes" ( "id" TEXT PRIMARY KEY, "user_id" char(36) NOT NULL, "slug" TEXT NOT NULL, "notes" TEXT, 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); CREATE UNIQUE INDEX "e2e_user_notes_slug_idx" ON "e2e_user_notes" (slug); ================================================ FILE: testdata/e2e/fixtures/sqlite3/down/7.sql ================================================ 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 , "username" TEXT); CREATE TABLE IF NOT EXISTS "e2e_user_posts" ( "id" TEXT PRIMARY KEY, "user_id" char(36) NOT NULL, "slug" TEXT NOT NULL, "notes" TEXT, 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); ================================================ FILE: testdata/e2e/fixtures/sqlite3/down/8.sql ================================================ 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 , "username" TEXT); 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 '', 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); ================================================ FILE: testdata/e2e/fixtures/sqlite3/down/9.sql ================================================ 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 , "name" TEXT); 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 '', 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); ================================================ FILE: testdata/e2e/fixtures/sqlite3/up/0.sql ================================================ 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, "username" TEXT, "created_at" DATETIME NOT NULL, "updated_at" DATETIME NOT NULL ); ================================================ FILE: testdata/e2e/fixtures/sqlite3/up/1.sql ================================================ 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, "username" TEXT, "created_at" DATETIME NOT NULL, "updated_at" DATETIME NOT NULL ); CREATE TABLE IF NOT EXISTS "e2e_user_notes" ( "id" TEXT PRIMARY KEY, "notes" TEXT, "title" TEXT NOT NULL DEFAULT '', "user_id" char(36) NOT NULL, FOREIGN KEY (user_id) REFERENCES e2e_users (id) ON DELETE cascade ); CREATE INDEX "e2e_user_notes_user_id_idx" ON "e2e_user_notes" (user_id); CREATE INDEX "e2e_user_notes_title_idx" ON "e2e_user_notes" (title); ================================================ FILE: testdata/e2e/fixtures/sqlite3/up/10.sql ================================================ 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 '', 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); ================================================ FILE: testdata/e2e/fixtures/sqlite3/up/11.sql ================================================ 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, "user_id" char(36) NOT NULL, "slug" TEXT NOT NULL, "content" TEXT NOT NULL DEFAULT '', FOREIGN KEY (user_id) REFERENCES "e2e_authors" (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); ================================================ FILE: testdata/e2e/fixtures/sqlite3/up/12.sql ================================================ 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) NOT NULL, "slug" TEXT NOT NULL, "content" TEXT NOT NULL DEFAULT '', 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); ================================================ FILE: testdata/e2e/fixtures/sqlite3/up/13.sql ================================================ 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); ================================================ FILE: testdata/e2e/fixtures/sqlite3/up/14.sql ================================================ CREATE TABLE IF NOT EXISTS "schema_migration" ( "version" TEXT NOT NULL ); CREATE UNIQUE INDEX "schema_migration_version_idx" ON "schema_migration" (version); CREATE TABLE IF NOT EXISTS "e2e_authors" ( "id" TEXT PRIMARY KEY, "created_at" DATETIME NOT NULL, "updated_at" DATETIME NOT NULL ); CREATE TABLE IF NOT EXISTS "e2e_user_posts" ( "id" TEXT PRIMARY KEY, "author_id" char(36), "slug" TEXT NOT NULL, "content" TEXT NOT NULL DEFAULT '', "published" bool NOT NULL DEFAULT FALSE, FOREIGN KEY (author_id) REFERENCES e2e_authors (id) ON UPDATE NO ACTION ON DELETE CASCADE ); CREATE UNIQUE INDEX "e2e_user_notes_slug_idx" ON "e2e_user_posts" (slug); CREATE INDEX "e2e_user_notes_user_id_idx" ON "e2e_user_posts" (author_id); CREATE TABLE IF NOT EXISTS "e2e_flow" ( "id" TEXT PRIMARY KEY ); CREATE TABLE IF NOT EXISTS "e2e_address" ( "id" TEXT PRIMARY KEY ); CREATE TABLE IF NOT EXISTS "e2e_token" ( "id" TEXT PRIMARY KEY, "token" TEXT NOT NULL, "e2e_flow_id" char(36) NOT NULL, "e2e_address_id" char(36) NOT NULL, FOREIGN KEY (e2e_flow_id) REFERENCES e2e_flow (id) ON DELETE cascade, FOREIGN KEY (e2e_address_id) REFERENCES e2e_address (id) ON DELETE cascade ); CREATE UNIQUE INDEX "e2e_token_uq_idx" ON "e2e_token" (token); CREATE INDEX "e2e_token_idx" ON "e2e_token" (token); ================================================ FILE: testdata/e2e/fixtures/sqlite3/up/15.sql ================================================ 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); ================================================ FILE: testdata/e2e/fixtures/sqlite3/up/2.sql ================================================ 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, "username" TEXT, "created_at" DATETIME NOT NULL, "updated_at" DATETIME NOT NULL ); 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 UPDATE NO ACTION ON DELETE CASCADE ); CREATE INDEX "e2e_user_notes_user_id_idx" ON "e2e_user_notes" (user_id); ================================================ FILE: testdata/e2e/fixtures/sqlite3/up/3.sql ================================================ 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, "username" TEXT, "created_at" DATETIME NOT NULL, "updated_at" DATETIME NOT NULL ); 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 UPDATE NO ACTION ON DELETE CASCADE ); CREATE INDEX "e2e_user_notes_user_id_idx" ON "e2e_user_notes" (user_id); ================================================ FILE: testdata/e2e/fixtures/sqlite3/up/4.sql ================================================ 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, "username" TEXT, "created_at" DATETIME NOT NULL, "updated_at" DATETIME NOT NULL ); 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 UPDATE NO ACTION ON DELETE CASCADE ); CREATE INDEX "e2e_user_notes_user_id_idx" ON "e2e_user_notes" (user_id); ================================================ FILE: testdata/e2e/fixtures/sqlite3/up/5.sql ================================================ 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, "username" TEXT, "created_at" DATETIME NOT NULL, "updated_at" DATETIME NOT NULL ); CREATE TABLE IF NOT EXISTS "e2e_user_notes" ( "id" TEXT PRIMARY KEY, "notes" TEXT, "user_id" char(36) NOT NULL, "slug" TEXT NOT NULL, 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); CREATE UNIQUE INDEX "e2e_user_notes_slug_idx" ON "e2e_user_notes" (slug); ================================================ FILE: testdata/e2e/fixtures/sqlite3/up/6.sql ================================================ 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, "username" TEXT, "created_at" DATETIME NOT NULL, "updated_at" DATETIME NOT NULL ); CREATE TABLE IF NOT EXISTS "e2e_user_posts" ( "id" TEXT PRIMARY KEY, "notes" TEXT, "user_id" char(36) NOT NULL, "slug" TEXT NOT NULL, 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); ================================================ FILE: testdata/e2e/fixtures/sqlite3/up/7.sql ================================================ 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, "username" TEXT, "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 '', 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); ================================================ FILE: testdata/e2e/fixtures/sqlite3/up/8.sql ================================================ 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, "name" TEXT, "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 '', 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); ================================================ FILE: testdata/e2e/fixtures/sqlite3/up/9.sql ================================================ 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_user_posts" ( "id" TEXT PRIMARY KEY, "user_id" char(36) NOT NULL, "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 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 ); ================================================ FILE: testdata/e2e/go.mod ================================================ module e2e go 1.16 require ( github.com/gobuffalo/pop/v6 v6.0.4 github.com/jackc/pgx/v4 v4.16.1 github.com/stretchr/testify v1.8.0 ) ================================================ FILE: testdata/e2e/go.sum ================================================ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Masterminds/semver/v3 v3.0.3/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= 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/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= github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= 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/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/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= 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= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= 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.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= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= 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/go.mod h1:qGdnq2RukKtBl4ASJit0OFckc5XGSyTFk98SvRpMFrQ= 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/fizz v1.14.0 h1:hicZBYSwSWITXEDUR77tqrLU1/vScXHddd02IaFkkPI= github.com/gobuffalo/fizz v1.14.0/go.mod h1:0aF1kAZYCfKqbLM/lmZ3jXFyqqWE/kY/nIOKnNdAYXQ= github.com/gobuffalo/flect v0.2.0/go.mod h1:W3K3X9ksuZfir8f/LrfVtWmCDQFfayuylOJ7sz/Fj80= github.com/gobuffalo/flect v0.2.4/go.mod h1:1ZyCLIbg0YD7sDkzvFdPoOydPtD8y9JQnrOROolUcM8= github.com/gobuffalo/flect v0.2.5 h1:H6vvsv2an0lalEaCDRThvtBfmg44W/QHXBCYUXf/6S4= github.com/gobuffalo/flect v0.2.5/go.mod h1:1ZyCLIbg0YD7sDkzvFdPoOydPtD8y9JQnrOROolUcM8= github.com/gobuffalo/genny/v2 v2.0.8/go.mod h1:R45scCyQfff2HysNJHNanjrpvPw4Qu+rM1MOMDBB5oU= github.com/gobuffalo/genny/v2 v2.0.9/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.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/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 v1.0.1/go.mod h1:PP2POP3p3RXGz7Jh6eYEf93S7vA2za6xM7QT85L4+VY= github.com/gobuffalo/plush/v4 v4.0.0/go.mod h1:ErFS3UxKqEb8fpFJT7lYErfN/Nw6vHGiDMTjxpk5bQ0= github.com/gobuffalo/plush/v4 v4.1.9/go.mod h1:9OOII9uAM5pZnhWu1OkQnboXJjaWMQ7kcTl3zNcxvTM= github.com/gobuffalo/plush/v4 v4.1.11 h1:IOLBE07W0VkiraJf36x547l3q5Ek3osP9vHzN48wAh0= github.com/gobuffalo/plush/v4 v4.1.11/go.mod h1:9OOII9uAM5pZnhWu1OkQnboXJjaWMQ7kcTl3zNcxvTM= github.com/gobuffalo/pop/v6 v6.0.0/go.mod h1:5rd3OnViLhjteR8+0i/mT9Q4CzkTzCoR7tm/9mmAic4= github.com/gobuffalo/pop/v6 v6.0.4 h1:ayJcBapz8usirToDprc7hPwB5AC66SD1ngrnr4RiWBc= github.com/gobuffalo/pop/v6 v6.0.4/go.mod h1:dFcrMNPOwk+sl1Oa0lOb/jGbmjv+JV+5CZjMWNYR3KI= 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/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= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gofrs/uuid v4.1.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gofrs/uuid v4.2.0+incompatible h1:yyYWMnhkhrKwwr8gAOcOCYxOOscHgDS9yZgBrnJfGa0= github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY= github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= 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/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/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= github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8= github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= github.com/jackc/pgconn v0.0.0-20190420214824-7e0022ef6ba3/go.mod h1:jkELnwuX+w9qN5YIfX0fl88Ehu4XC3keFuOJJk9pcnA= github.com/jackc/pgconn v0.0.0-20190824142844-760dd75542eb/go.mod h1:lLjNuW/+OfW9/pnVKPazfWOgNfH2aPem8YQ7ilXGvJE= github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsUgOEh9hBm+xYTstcNHg7UPMVJqRfQxq4s= github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= github.com/jackc/pgconn v1.10.0/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= github.com/jackc/pgconn v1.10.1/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= github.com/jackc/pgconn v1.12.1 h1:rsDFzIpRk7xT4B8FufgpCCeyjdNpKyghZeSefViE5W8= github.com/jackc/pgconn v1.12.1/go.mod h1:ZkhRC59Llhrq3oSfrikvwQ5NaxYExr6twkdkMLaKono= github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE= github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= github.com/jackc/pgmock v0.0.0-20201204152224-4fe30f7445fd/go.mod h1:hrBW0Enj2AZTNpt/7Y5rr2xe/9Mn757Wtb2xeBzPv2c= github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65 h1:DadwsjnMwFjfWc9y5Wi/+Zz7xoE5ALHsRQlOctkOiHc= github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65/go.mod h1:5R2h2EEX+qri8jOWMbJCtaPWkrrNc7OHwsp2TCqp7ak= github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= github.com/jackc/pgproto3 v1.1.0 h1:FYYE4yRw+AgI8wXIinMlNjBbp/UitDJwfj5LqqewP1A= github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78= github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA= github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg= github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= github.com/jackc/pgproto3/v2 v2.3.0 h1:brH0pCGBDkBW07HWlN/oSBXrmo3WB0UvZd1pIuDcL8Y= github.com/jackc/pgproto3/v2 v2.3.0/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b h1:C8S2+VttkHFdOOCXJe+YGfa4vHYwlt4Zx+IVXQ97jYg= github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg= github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM= github.com/jackc/pgtype v1.8.1/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= github.com/jackc/pgtype v1.11.0 h1:u4uiGPz/1hryuXzyaBhSk6dnIyyG2683olG2OV+UUgs= github.com/jackc/pgtype v1.11.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= github.com/jackc/pgx/v4 v4.13.0/go.mod h1:9P4X524sErlaxj0XSGZk7s+LD0eOyu1ZDUrrpznYDF0= github.com/jackc/pgx/v4 v4.16.1 h1:JzTglcal01DrghUqt+PmzWsZx/Yh7SC/CTQmSBMTd0Y= github.com/jackc/pgx/v4 v4.16.1/go.mod h1:SIhx0D5hoADaiXZVyv+3gSm3LCIIINTVO0PficsvWGQ= github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.2.1/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jmoiron/sqlx v1.3.4/go.mod h1:2BljVx/86SuTyjE+aPYlHCTNvZrnJXghYGpNiXLBMCQ= github.com/jmoiron/sqlx v1.3.5 h1:vFFPA71p1o5gAeqtEAwLU4dnX2napprKtHr7PYIcN3g= github.com/jmoiron/sqlx v1.3.5/go.mod h1:nRVWtLre0KfCLJvgxzCsLVMogSvQ1zNJtpYr2Ccp0mQ= 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/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= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.10.4/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.10.6 h1:jbk+ZieJ0D7EVGJYpL9QTz7/YW6UHbmdnZWYyK5cdBs= github.com/lib/pq v1.10.6/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.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/markbates/oncer v1.0.0/go.mod h1:Z59JA581E9GP6w96jai+TGqafHPW+cPfRxz2aSZ0mcI= 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= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.9 h1:sqDoxXbdeALODt0DAeJCVp38ps9ZogZEAXjus69YV3U= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/go-sqlite3 v1.14.9 h1:10HX2Td0ocZpYEjhilsuo6WWtUqttj2Kb0KtD86/KYA= github.com/mattn/go-sqlite3 v1.14.9/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= github.com/microcosm-cc/bluemonday v1.0.16 h1:kHmAq2t7WPWLjiGvzKa5o3HzSfahUKiOq7fAPUiMNIc= github.com/microcosm-cc/bluemonday v1.0.16/go.mod h1:Z0r70sCuXHig8YpBzCc5eGHAap2K7e/u082ZUpDRRqM= 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-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= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= 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/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= 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= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 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.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= 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/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/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/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= github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= 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/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= github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d h1:yKm7XZV6j9Ev6lojP2XaIshpT4ymkqhMeSghO5Ps00E= 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.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= 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= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= 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= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= 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-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-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-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= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 h1:/UOmuWzQfxxo9UtlXMwuQU8CMgg1eZXqTRwkSQJWKOI= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= 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/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-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= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f h1:OfiFi4JbukWwe3lzw+xunroH1mnC1e2Gy5cxNJApiSY= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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-20181026203630-95b1ffbd15a5/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= golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 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-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= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e h1:WUoyKPm6nCo1BnNUvPGnFG3T5DUVem42yDJZZ4CNxMA= 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/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= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= 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-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= golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 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-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= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= 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/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/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= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 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/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/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.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= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= ================================================ FILE: testdata/e2e/integration_test.go ================================================ // +build e2e package e2e_test import ( "os" "testing" "github.com/gobuffalo/pop/v6" _ "github.com/jackc/pgx/v4/stdlib" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) func TestSpecificSuites(t *testing.T) { require.NoError(t, pop.LoadConfigFile()) switch d := os.Getenv("SODA_DIALECT"); d { case "postgres": suite.Run(t, &PostgreSQLSuite{}) case "cockroach": suite.Run(t, &CockroachSuite{}) case "mysql": suite.Run(t, &MySQLSuite{}) case "sqlite": suite.Run(t, &SQLiteSuite{}) default: t.Fatalf("Got unsupported dialect: %s", d) } } ================================================ FILE: testdata/e2e/migrations/20191100000001_users.down.fizz ================================================ drop_table("e2e_users") ================================================ FILE: testdata/e2e/migrations/20191100000001_users.up.fizz ================================================ create_table("e2e_users") { t.Column("id", "uuid", {"primary": true}) t.Column("username", "string", {"null": true}) } ================================================ FILE: testdata/e2e/migrations/20191100000002_user_notes.down.fizz ================================================ drop_table("e2e_user_notes") ================================================ FILE: testdata/e2e/migrations/20191100000002_user_notes.up.fizz ================================================ create_table("e2e_user_notes") { t.Column("id", "uuid", {"primary": true}) t.Column("notes", "string", {"null": true}) t.Column("title", "string", {"size": 64, "default": ""}) t.Column("user_id", "uuid") t.ForeignKey("user_id", {"e2e_users": ["id"]}, {"on_delete": "cascade"}) t.DisableTimestamps() } add_index("e2e_user_notes", "user_id", {"name": "e2e_user_notes_user_id_idx"}) add_index("e2e_user_notes", "title", {"name": "e2e_user_notes_title_idx"}) ================================================ FILE: testdata/e2e/migrations/20191100000003_user_notes_drop_title.down.fizz ================================================ add_column("e2e_user_notes", "title", "string", { "default": "", "size": 64 }) add_index("e2e_user_notes", "title", {"name": "e2e_user_notes_title_idx"}) ================================================ FILE: testdata/e2e/migrations/20191100000003_user_notes_drop_title.up.fizz ================================================ drop_column("e2e_user_notes", "title") ================================================ FILE: testdata/e2e/migrations/20191100000004_user_notes_add_slug.down.fizz ================================================ drop_column("e2e_user_notes", "slug") ================================================ FILE: testdata/e2e/migrations/20191100000004_user_notes_add_slug.up.fizz ================================================ add_column("e2e_user_notes", "slug", "string", { "null": true, "size": 64 }) ================================================ FILE: testdata/e2e/migrations/20191100000005_user_notes_add_slug.down.fizz ================================================ ================================================ FILE: testdata/e2e/migrations/20191100000005_user_notes_add_slug.up.fizz ================================================ sql("UPDATE e2e_user_notes SET slug='';") ================================================ FILE: testdata/e2e/migrations/20191100000006_user_notes_add_slug.down.fizz ================================================ ================================================ FILE: testdata/e2e/migrations/20191100000006_user_notes_add_slug.up.fizz ================================================ change_column("e2e_user_notes", "slug", "string", { "size": 64 }) add_index("e2e_user_notes", "slug", { "unique":true, "name": "e2e_user_notes_slug_idx"}) ================================================ FILE: testdata/e2e/migrations/20191100000007_user_notes_rename.down.fizz ================================================ rename_table("e2e_user_posts","e2e_user_notes") ================================================ FILE: testdata/e2e/migrations/20191100000007_user_notes_rename.up.fizz ================================================ rename_table("e2e_user_notes", "e2e_user_posts") ================================================ FILE: testdata/e2e/migrations/20191100000008_user_notes_rename_notes.down.fizz ================================================ drop_column("e2e_user_posts", "content") add_column("e2e_user_posts", "notes", "string", {"null": true}) ================================================ FILE: testdata/e2e/migrations/20191100000008_user_notes_rename_notes.up.fizz ================================================ add_column("e2e_user_posts", "content", "string", {"default": ""}) drop_column("e2e_user_posts", "notes") ================================================ FILE: testdata/e2e/migrations/20191100000009_users_username.down.fizz ================================================ rename_column("e2e_users", "name", "username") ================================================ FILE: testdata/e2e/migrations/20191100000009_users_username.up.fizz ================================================ rename_column("e2e_users", "username", "name") ================================================ FILE: testdata/e2e/migrations/20191100000010_users_drop_name.down.fizz ================================================ add_column("e2e_users", "name", "string", {"null": true}) ================================================ FILE: testdata/e2e/migrations/20191100000010_users_drop_name.up.fizz ================================================ drop_column("e2e_users", "name") ================================================ FILE: testdata/e2e/migrations/20191100000011_user_posts_change_column.down.fizz ================================================ change_column("e2e_user_posts", "slug", "string", { "size": 64 }) ================================================ FILE: testdata/e2e/migrations/20191100000011_user_posts_change_column.up.fizz ================================================ change_column("e2e_user_posts", "slug", "string", { "size": 32 }) ================================================ FILE: testdata/e2e/migrations/20191100000012_rename_user.down.fizz ================================================ rename_table("e2e_authors", "e2e_users") ================================================ FILE: testdata/e2e/migrations/20191100000012_rename_user.up.fizz ================================================ rename_table("e2e_users", "e2e_authors") ================================================ FILE: testdata/e2e/migrations/20191100000013_rename_user_notes_user.down.fizz ================================================ rename_column("e2e_user_posts", "author_id", "user_id") ================================================ FILE: testdata/e2e/migrations/20191100000013_rename_user_notes_user.up.fizz ================================================ rename_column("e2e_user_posts", "user_id", "author_id") ================================================ FILE: testdata/e2e/migrations/20191100000014_rename_user_add_published.down.fizz ================================================ drop_column("e2e_user_posts", "published") change_column("e2e_user_posts", "author_id", "uuid") ================================================ FILE: testdata/e2e/migrations/20191100000014_rename_user_add_published.up.fizz ================================================ add_column("e2e_user_posts", "published", "bool", {"default_raw": "FALSE"}) change_column("e2e_user_posts", "author_id", "uuid", {"null": true}) ================================================ FILE: testdata/e2e/migrations/20191100000015_auto_fk.down.fizz ================================================ drop_table("e2e_token") drop_table("e2e_flow") drop_table("e2e_address") ================================================ FILE: testdata/e2e/migrations/20191100000015_auto_fk.up.fizz ================================================ create_table("e2e_flow") { t.DisableTimestamps() t.Column("id", "uuid", {"primary": true}) } create_table("e2e_address") { t.DisableTimestamps() t.Column("id", "uuid", {"primary": true}) } create_table("e2e_token") { t.DisableTimestamps() t.Column("id", "uuid", {"primary": true}) t.Column("token", "string", {"size": 64}) t.Column("e2e_flow_id", "uuid") t.ForeignKey("e2e_flow_id", {"e2e_flow": ["id"]}, {"on_delete": "cascade"}) t.Column("e2e_address_id", "uuid") t.ForeignKey("e2e_address_id", {"e2e_address": ["id"]}, {"on_delete": "cascade"}) } add_index("e2e_token", ["token"], { "unique": true, "name": "e2e_token_uq_idx" }) add_index("e2e_token", ["token"], { "name": "e2e_token_idx" }) ================================================ FILE: testdata/e2e/migrations/20191100000016_rename_auto_fk.down.fizz ================================================ change_column("e2e_token", "e2e_flow_id", "uuid") ================================================ FILE: testdata/e2e/migrations/20191100000016_rename_auto_fk.up.fizz ================================================ add_column("e2e_token", "expires_at", "timestamp", { "default": "2000-01-01 00:00:00" }) add_column("e2e_token", "issued_at", "timestamp", { "default": "2000-01-01 00:00:00" }) change_column("e2e_token", "e2e_flow_id", "uuid", {"null": true}) ================================================ FILE: testdata/e2e/migrator_test.go ================================================ package e2e_test import ( "fmt" "io/ioutil" "os" "path/filepath" "regexp" "strconv" "strings" "time" "github.com/gobuffalo/pop/v6" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) func run(s *suite.Suite, c *pop.Connection, checkSchema func()) { r := s.Require() dest, err := ioutil.TempDir(os.TempDir(), "fizz-up-integration") r.NoError(err) m, err := pop.NewFileMigrator("./migrations", c) r.NoError(err) m.SchemaPath = dest refreshFixtures, _ := strconv.ParseBool(os.Getenv("REFRESH_FIXTURES")) actualFilePath := filepath.Join(dest, "schema.sql") // k is be the number of migrations that should run s.Run("direction=up", func() { for k := 0; k < len(m.UpMigrations.Migrations); k++ { r := s.Require() _, err := m.UpTo(1) r.NoError(err) r.NoError(m.DumpMigrationSchema()) expectedFilePath := filepath.Join("fixtures", c.Dialect.Name(), "up", fmt.Sprintf("%d.sql", k)) if refreshFixtures { content, err := ioutil.ReadFile(actualFilePath) r.NoError(err) r.NoError(ioutil.WriteFile(expectedFilePath, content, 0666)) } else { _ = expectEqualFiles(s, expectedFilePath, actualFilePath) } } }) s.Run("check=schema", checkSchema) s.Run("direction=down", func() { for k := len(m.DownMigrations.Migrations) - 1; k >= 0; k-- { r := s.Require() r.NoError(m.Down(1)) r.NoError(m.DumpMigrationSchema()) expectedFilePath := filepath.Join("fixtures", c.Dialect.Name(), "down", fmt.Sprintf("%d.sql", k)) if refreshFixtures { content, err := ioutil.ReadFile(actualFilePath) r.NoError(err) r.NoError(ioutil.WriteFile(expectedFilePath, content, 0666)) } else { _ = expectEqualFiles(s, expectedFilePath, actualFilePath) } } }) } func expectEqualFiles(s *suite.Suite, expected, actual string) bool { A := s.Assert() ac, err := ioutil.ReadFile(actual) A.NoError(err) ec, err := ioutil.ReadFile(expected) A.NoError(err) A.EqualValues( normalizeDump(string(ec)), normalizeDump(string(ac)), ` expected file: %s actual file: %s actual SQL dump: %s `, expected, actual, ac) return normalizeDump(string(ec)) == normalizeDump(string(ac)) } var spaces = regexp.MustCompile(`\s+`) var comments = regexp.MustCompile("(?m)^-(.*)$") func normalizeDump(in string) string { in = comments.ReplaceAllString(in, "") spaces.ReplaceAllString(in, " ") return in } func retryOpen(c *pop.Connection) (err error) { for i := 0; i <= 60; i++ { time.Sleep(time.Second) err = c.Open() if err != nil { continue } err = c.RawQuery("SELECT 1").Exec() if err == nil { return nil } } return err } func runTestData(s *suite.Suite, c *pop.Connection, supportsUUID bool) func() { return func() { r := s.Require() if supportsUUID { r.Error(c.RawQuery("INSERT INTO e2e_authors (id, created_at, updated_at) VALUES (?, ?, ?)", "78dba9f7-dd20a39f64cb", time.Now(), time.Now()).Exec(), "should fail because uuid format is not correct") } runInsertUUID(c, r) runForeignKeyChecks(c, r) runUniqueKeyChecks(c, r) runNotNullChecks(c, r) } } func runInsertUUID(c *pop.Connection, r *require.Assertions) { r.NoError(c.RawQuery("INSERT INTO e2e_authors (id, created_at, updated_at) VALUES (?, ?, ?)", "78dba9f7-81af-415e-aa2b-dd20a39f64cb", time.Now(), time.Now()).Exec()) r.Error(c.RawQuery("INSERT INTO e2e_authors (id, created_at, updated_at) VALUES (?, ?, ?)", "78dba9f7-81af-415e-aa2b-dd20a39f64cb", time.Now(), time.Now()).Exec(), "should fail because it is a duplicate primary key") } func runForeignKeyChecks(c *pop.Connection, r *require.Assertions) { err := c.RawQuery("INSERT INTO e2e_user_posts (id, author_id, slug, published) VALUES (?,?,?, false)", "acd6abe3-38fa-4c3c-a676-933e1b06fa42", "cc1debdc-5d5a-41f3-a36b-48b1f3a03089", "slug-1").Exec() r.Error(err, "should fail because foreign key constraint fails") r.Contains(strings.ToLower(err.Error()), "foreign") r.NoError(c.RawQuery("INSERT INTO e2e_user_posts (id, author_id, slug, published) VALUES (?,?,?, false)", "03c6c800-54c6-40cd-89f1-7dff731f9b54", "78dba9f7-81af-415e-aa2b-dd20a39f64cb", "slug-1").Exec()) r.NoError(c.RawQuery("INSERT INTO e2e_address (id) VALUES (?)", "d8b79b1d-e510-4763-92b3-828244b54893").Exec()) r.NoError(c.RawQuery("INSERT INTO e2e_flow (id) VALUES (?)", "96a8b5f8-6b1b-4936-9b88-397cf0886235").Exec()) r.NoError(c.RawQuery("INSERT INTO e2e_token (id, token, e2e_flow_id, e2e_address_id) VALUES (?, ?, ?, ?)", "5ba7f9c5-c469-439a-a07c-859f7b7b3448", "1539b471f990", "96a8b5f8-6b1b-4936-9b88-397cf0886235", "d8b79b1d-e510-4763-92b3-828244b54893").Exec()) } func runUniqueKeyChecks(c *pop.Connection, r *require.Assertions) { r.NoError(c.RawQuery("INSERT INTO e2e_user_posts (id, author_id, slug) VALUES (?,?,?)", "ccbf7278-092d-4c6f-a627-84cf45233c6a", "78dba9f7-81af-415e-aa2b-dd20a39f64cb", "dupe-slug").Exec()) err := c.RawQuery("INSERT INTO e2e_user_posts (id, author_id, slug) VALUES (?,?,?)", "ff7eb268-1640-48d3-b295-57d9a20faf3f", "78dba9f7-81af-415e-aa2b-dd20a39f64cb", "dupe-slug").Exec() r.Error(err, "should fail because UNIQUE constraint fails") message := strings.ToLower(err.Error()) r.True( strings.Contains(message, "duplicate") || strings.Contains(message, "unique")) } func runNotNullChecks(c *pop.Connection, r *require.Assertions) { err := c.RawQuery("INSERT INTO e2e_user_posts (id, author_id) VALUES (?,?)", "a23e6e72-08f9-412f-afb8-01f6af234eb9", "78dba9f7-81af-415e-aa2b-dd20a39f64cb").Exec() r.Error(err, "should fail because NOT NULL fails") message := strings.ToLower(err.Error()) r.True( strings.Contains(message, "null") || strings.Contains(message, "default")) } ================================================ FILE: testdata/e2e/mysql_test.go ================================================ package e2e_test import ( "github.com/gobuffalo/pop/v6" "github.com/stretchr/testify/suite" ) type MySQLSuite struct { suite.Suite } func (s *MySQLSuite) Test_MySQL_MigrationSteps() { r := s.Require() c, err := pop.Connect("mysql") r.NoError(err) r.NoError(retryOpen(c)) run(&s.Suite, c, runTestData(&s.Suite, c, false)) } ================================================ FILE: testdata/e2e/postgres_test.go ================================================ package e2e_test import ( "github.com/gobuffalo/pop/v6" "github.com/stretchr/testify/suite" ) type PostgreSQLSuite struct { suite.Suite } func (s *PostgreSQLSuite) Test_PostgreSQL_MigrationSteps() { r := s.Require() c, err := pop.Connect("postgres") r.NoError(err) r.NoError(retryOpen(c)) run(&s.Suite, c, runTestData(&s.Suite, c, true)) } ================================================ FILE: testdata/e2e/sqlite3_test.go ================================================ package e2e_test import ( "io/ioutil" "github.com/gobuffalo/pop/v6" "github.com/stretchr/testify/suite" ) type SQLiteSuite struct { suite.Suite } func (s *SQLiteSuite) Test_SQLite_MigrationSteps() { r := s.Require() td, err := ioutil.TempDir("", "pop-e2e-sqlite") r.NoError(err) c, err := pop.NewConnection(&pop.ConnectionDetails{URL: "sqlite3://" + td + "db.sql?mode=rwc&_fk=true"}) r.NoError(err) r.NoError(c.Open(), "%s", c.URL()) r.NoError(c.RawQuery("SELECT 1").Exec(), "%s", c.URL()) run(&s.Suite, c, runTestData(&s.Suite, c, false)) } ================================================ FILE: testdata/migrations/.gitignore ================================================ schema.sql ================================================ FILE: testdata/migrations/20160808213308_setup_tests.down.fizz ================================================ drop_table("users") drop_table("good_friends") drop_table("validatable_cars") drop_table("not_validatable_cars") drop_table("callbacks_users") drop_table("books") drop_table("cars") ================================================ FILE: testdata/migrations/20160808213308_setup_tests.up.fizz ================================================ create_table("users") { t.Column("name", "string") t.Column("alive", "boolean", {null: true}) t.Column("birth_date", "timestamp", {null: true}) t.Column("bio", "text", {null: true}) t.Column("price", "numeric", {null: true, default: "1.00"}) t.Column("email", "string", {default: "foo@example.com", size: 50}) } create_table("good_friends") { t.Column("first_name", "string") t.Column("last_name", "string") t.DisableTimestamps() } create_table("validatable_cars") { t.Column("name", "string") } create_table("not_validatable_cars") { t.Column("name", "string") } create_table("callbacks_users") { t.Column("before_s", "string") t.Column("before_c", "string") t.Column("before_u", "string") t.Column("before_d", "string") t.Column("after_s", "string") t.Column("after_c", "string") t.Column("after_u", "string") t.Column("after_d", "string") t.Column("after_f", "string") } create_table("books") { t.Column("title", "string") t.Column("user_id", "int", {null: true}) t.Column("isbn", "string", {size: 50}) } create_table("taxis") { t.Column("model", "string") t.Column("user_id", "int", {null: true}) } ================================================ FILE: testdata/migrations/20160808213310_setup_tests2.down.fizz ================================================ drop_table("songs") drop_table("course_codes") drop_table("courses") {{ if eq .Dialect "postgres" }} drop_table("cakes") {{ end }} ================================================ FILE: testdata/migrations/20160808213310_setup_tests2.up.fizz ================================================ create_table("songs") { t.Column("id", "uuid", {primary: true}) t.Column("u_id", "int", {null: true}) t.Column("title", "string") t.Column("composed_by_id", "int", {null: true}) } create_table("composers") { t.Column("name", "string") } create_table("writers") { t.Column("name", "string") t.Column("book_id", "int") } create_table("addresses") { t.Column("street", "string") t.Column("house_number", "int") } create_table("users_addresses") { t.Column("user_id", "int") t.Column("address_id", "int") } create_table("courses") { t.Column("id", "uuid", {primary: true}) } create_table("course_codes") { t.Column("id", "uuid", {primary: true}) t.Column("course_id", "uuid") } if (dialect == "postgres") { create_table("cakes") { t.Column("int_slice", "int[]", {null: true}) t.Column("float_slice", "numeric[]", {null: true}) t.Column("string_slice", "varchar[]", {null: true}) } } add_column("books", "description", "string", {default: ""}) change_column("books", "description", "string", {default: "test", "size": 100}) add_index("books","description") rename_index("books","books_description_idx","books_description_index") ================================================ FILE: testdata/migrations/multiple/20180413210602_create_users.mysql.up.sql ================================================ ================================================ FILE: testdata/migrations/multiple/20180413210602_create_users.postgres.up.sql ================================================ ================================================ FILE: testdata/migrations/multiple/20180413210602_create_users.sqlite3.up.sql ================================================ ================================================ FILE: testdata/migrations/multiple/20180413210602_create_users.up.sql ================================================ ================================================ FILE: translator.go ================================================ package fizz // Translator describes the common interface to define a fizz // to SQL translator. type Translator interface { CreateTable(Table) (string, error) DropTable(Table) (string, error) RenameTable([]Table) (string, error) AddColumn(Table) (string, error) ChangeColumn(Table) (string, error) DropColumn(Table) (string, error) RenameColumn(Table) (string, error) AddIndex(Table) (string, error) DropIndex(Table) (string, error) RenameIndex(Table) (string, error) AddForeignKey(Table) (string, error) DropForeignKey(Table) (string, error) } ================================================ FILE: translators/cockroach.go ================================================ package translators import ( "fmt" "strings" "github.com/gobuffalo/fizz" ) type Cockroach struct { Schema SchemaQuery } func NewCockroach(url string, name string) *Cockroach { schema := &cockroachSchema{ Schema{ URL: url, Name: name, schema: map[string]*fizz.Table{}, }, } schema.Builder = schema return &Cockroach{Schema: schema} } func (Cockroach) Name() string { return "cockroach" } func (p *Cockroach) CreateTable(t fizz.Table) (string, error) { p.Schema.SetTable(&t) sql := []string{} cols := []string{} var s string for _, c := range t.Columns { if c.Primary { switch c.ColType { case "string", "uuid": case "integer", "INT", "int": c.ColType = "SERIAL" default: return "", fmt.Errorf("can not use %s as a primary key", c.ColType) } } cols = append(cols, p.buildAddColumn(c)) if c.Primary { cols = append(cols, fmt.Sprintf(`PRIMARY KEY("%s")`, c.Name)) } } for _, fk := range t.ForeignKeys { cols = append(cols, p.buildForeignKey(t, fk, true)) } primaryKeys := t.PrimaryKeys() if len(primaryKeys) > 1 { pks := make([]string, len(primaryKeys)) for i, pk := range primaryKeys { pks[i] = fmt.Sprintf("\"%s\"", pk) } cols = append(cols, fmt.Sprintf("PRIMARY KEY(%s)", strings.Join(pks, ", "))) } s = fmt.Sprintf("CREATE TABLE \"%s\" (\n%s\n);COMMIT TRANSACTION;BEGIN TRANSACTION;", t.Name, strings.Join(cols, ",\n")) sql = append(sql, s) for _, i := range t.Indexes { s, err := p.AddIndex(fizz.Table{ Name: t.Name, Indexes: []fizz.Index{i}, }) if err != nil { return "", err } sql = append(sql, s) } return strings.Join(sql, "\n"), nil } func (p *Cockroach) DropTable(t fizz.Table) (string, error) { p.Schema.Delete(t.Name) return fmt.Sprintf("DROP TABLE \"%s\";COMMIT TRANSACTION;BEGIN TRANSACTION;", t.Name), nil } func (p *Cockroach) RenameTable(t []fizz.Table) (string, error) { if len(t) < 2 { return "", fmt.Errorf("not enough table names supplied") } oldName := t[0].Name newName := t[1].Name tableInfo, err := p.Schema.TableInfo(oldName) if err != nil { return "", err } tableInfo.Name = newName return fmt.Sprintf("ALTER TABLE \"%s\" RENAME TO \"%s\";COMMIT TRANSACTION;BEGIN TRANSACTION;", oldName, newName), nil } func (p *Cockroach) ChangeColumn(t fizz.Table) (string, error) { if len(t.Columns) == 0 { return "", fmt.Errorf("not enough columns supplied") } c := t.Columns[0] tableInfo, err := p.Schema.TableInfo(t.Name) if err != nil { return "", err } for i := range tableInfo.Columns { if tableInfo.Columns[i].Name == t.Columns[0].Name { tableInfo.Columns[i] = c break } } sql := []string{} s, err := p.withTempColumn(t.Name, c.Name, func(table fizz.Table, origCol fizz.Column, tempCol string) (string, error) { var notNullWorkaround bool if c.Options["default_raw"] == nil && c.Options["default"] == nil && c.Options["null"] == nil { // This happens when the original column has "NOT NULL" and the changed column also has "NOT NULL" and no "DEFAULT". // In those cases, if the table has data already, CockroachDB will fail with an error mandating that a column can not // be added to the table unless it is either "NULL" or has a "DEFAULT". By first using NULL and then setting the // "NOT NULL" constraint, this problem is worked around. notNullWorkaround = true } newCol := p.buildChangeColumn(origCol, c) err1 := p.Schema.ReplaceColumn(table.Name, origCol.Name, newCol) if err1 != nil { return "", err1 } if notNullWorkaround { newCol.Options["null"] = true } createColumnSQL := fmt.Sprintf(`ALTER TABLE "%s" ADD COLUMN %s;COMMIT TRANSACTION;BEGIN TRANSACTION;`, table.Name, p.buildAddColumn(newCol)) ins := fmt.Sprintf(`UPDATE "%s" SET "%s" = "%s";COMMIT TRANSACTION;BEGIN TRANSACTION;`, t.Name, c.Name, tempCol) sql := []string{createColumnSQL, ins} if notNullWorkaround { newCol.Options["null"] = nil sql = append(sql, fmt.Sprintf(`ALTER TABLE "%s" ALTER COLUMN "%s" SET NOT NULL;COMMIT TRANSACTION;BEGIN TRANSACTION;`, t.Name, newCol.Name)) } return strings.Join(sql, "\n"), nil }) if err != nil { return "", err } sql = append(sql, s) return strings.Join(sql, "\n"), nil } func (p *Cockroach) AddColumn(t fizz.Table) (string, error) { if len(t.Columns) == 0 { 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)) // Update schema cache if we can tableInfo, err := p.Schema.TableInfo(t.Name) if err == nil { found := false for i := range tableInfo.Columns { if tableInfo.Columns[i].Name == c.Name { tableInfo.Columns[i] = c found = true break } } if !found { tableInfo.Columns = append(tableInfo.Columns, c) } } return s, nil } func (p *Cockroach) DropColumn(t fizz.Table) (string, error) { if len(t.Columns) == 0 { return "", fmt.Errorf("not enough columns supplied") } c := t.Columns[0] p.Schema.DeleteColumn(t.Name, c.Name) return fmt.Sprintf("ALTER TABLE \"%s\" DROP COLUMN \"%s\";COMMIT TRANSACTION;BEGIN TRANSACTION;", t.Name, c.Name), nil } func (p *Cockroach) RenameColumn(t fizz.Table) (string, error) { if len(t.Columns) < 2 { return "", fmt.Errorf("not enough columns supplied") } oc := t.Columns[0] nc := t.Columns[1] tableInfo, err := p.Schema.TableInfo(t.Name) if err != nil { return "", err } for ic, c := range tableInfo.Columns { if c.Name == oc.Name { tableInfo.Columns[ic].Name = nc.Name } } s := fmt.Sprintf("ALTER TABLE \"%s\" RENAME COLUMN \"%s\" TO \"%s\";COMMIT TRANSACTION;BEGIN TRANSACTION;", t.Name, oc.Name, nc.Name) return s, nil } func (p *Cockroach) AddIndex(t fizz.Table) (string, error) { if len(t.Indexes) == 0 { return "", fmt.Errorf("Not enough indexes supplied") } i := t.Indexes[0] s := fmt.Sprintf("CREATE INDEX \"%s\" ON \"%s\" (%s);COMMIT TRANSACTION;BEGIN TRANSACTION;", i.Name, t.Name, strings.Join(i.Columns, ", ")) if i.Unique { s = strings.Replace(s, "CREATE", "CREATE UNIQUE", 1) } tableInfo, err := p.Schema.TableInfo(t.Name) if err != nil { return "", err } tableInfo.Indexes = append(tableInfo.Indexes, i) return s, nil } func (p *Cockroach) DropIndex(t fizz.Table) (string, error) { if len(t.Indexes) == 0 { return "", fmt.Errorf("not enough indexes supplied") } i := t.Indexes[0] tableInfo, err := p.Schema.TableInfo(t.Name) if err != nil { return "", err } newIndexes := []fizz.Index{} for _, c := range tableInfo.Indexes { if c.Name != i.Name { newIndexes = append(newIndexes, c) } } tableInfo.Indexes = newIndexes return fmt.Sprintf("DROP INDEX IF EXISTS \"%s\";COMMIT TRANSACTION;BEGIN TRANSACTION;", i.Name), nil } func (p *Cockroach) RenameIndex(t fizz.Table) (string, error) { ix := t.Indexes if len(ix) < 2 { return "", fmt.Errorf("not enough indexes supplied") } oi := ix[0] ni := ix[1] tableInfo, err := p.Schema.TableInfo(t.Name) if err != nil { return "", err } for _, c := range tableInfo.Indexes { if c.Name == oi.Name { c.Name = ni.Name } } return fmt.Sprintf("ALTER INDEX \"%s\"@\"%s\" RENAME TO \"%s\";COMMIT TRANSACTION;BEGIN TRANSACTION;", t.Name, oi.Name, ni.Name), nil } func (p *Cockroach) AddForeignKey(t fizz.Table) (string, error) { if len(t.ForeignKeys) == 0 { return "", fmt.Errorf("not enough foreign keys supplied") } tableInfo, err := p.Schema.TableInfo(t.Name) if err != nil { return "", err } tableInfo.ForeignKeys = append(tableInfo.ForeignKeys, t.ForeignKeys[0]) return p.buildForeignKey(t, t.ForeignKeys[0], false), nil } func (p *Cockroach) DropForeignKey(t fizz.Table) (string, error) { if len(t.ForeignKeys) == 0 { return "", fmt.Errorf("not enough foreign keys supplied") } fk := t.ForeignKeys[0] tableInfo, err := p.Schema.TableInfo(t.Name) if err != nil { return "", err } newFKs := []fizz.ForeignKey{} for _, key := range tableInfo.ForeignKeys { if key.Name != fk.Name { newFKs = append(newFKs, key) } } tableInfo.ForeignKeys = newFKs var ifExists string if v, ok := fk.Options["if_exists"]; ok && v.(bool) { ifExists = "IF EXISTS " } s := fmt.Sprintf("ALTER TABLE %s DROP CONSTRAINT %s\"%s\";COMMIT TRANSACTION;BEGIN TRANSACTION;", p.escapeIdentifier(t.Name), ifExists, fk.Name) return s, nil } func (p *Cockroach) buildAddColumn(c fizz.Column) string { s := fmt.Sprintf("\"%s\" %s", c.Name, p.colType(c)) if c.Options["null"] == nil || c.Primary { 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 } func (p *Cockroach) buildChangeColumn(oldCol fizz.Column, c fizz.Column) fizz.Column { newCol := fizz.Column{ Name: c.Name, ColType: oldCol.ColType, Options: oldCol.Options, Primary: oldCol.Primary, } if c.Options["default"] != nil { newCol.Options["default"] = c.Options["default"] } if c.Options["null"] != nil { newCol.Options["null"] = c.Options["null"] } if c.Options["default_raw"] != nil { newCol.Options["default_raw"] = c.Options["default_raw"] } return newCol } func (p *Cockroach) withTempTable(table string, fn func(fizz.Table) (string, error)) (string, error) { tempTable := fizz.Table{Name: fmt.Sprintf("_%s_tmp", table)} sql := []string{fmt.Sprintf("ALTER TABLE \"%s\" RENAME TO \"%s\";COMMIT TRANSACTION;BEGIN TRANSACTION;", table, tempTable.Name)} s, err := fn(tempTable) if err != nil { return "", err } sql = append(sql, s, fmt.Sprintf("DROP TABLE \"%s\";COMMIT TRANSACTION;BEGIN TRANSACTION;", tempTable.Name)) return strings.Join(sql, "\n"), nil } func (p *Cockroach) withTempColumn(tableName string, column string, fn func(fizz.Table, fizz.Column, string) (string, error)) (string, error) { table, err := p.Schema.TableInfo(tableName) if err != nil { return "", err } col, err1 := p.Schema.ColumnInfo(tableName, column) if err1 != nil { return "", err1 } var sql []string var recreateForeignKeys []fizz.ForeignKey for _, i := range table.ForeignKeys { if i.Column == column { s, err := p.DropForeignKey(fizz.Table{ Name: table.Name, ForeignKeys: []fizz.ForeignKey{i}, }) if err != nil { return "", err } sql = append(sql, s) recreateForeignKeys = append(recreateForeignKeys, i) } } var recreateIndexes []fizz.Index for _, i := range table.Indexes { var found bool for _, ic := range i.Columns { if ic == column { found = true break } } if found { s, err := p.DropIndex(fizz.Table{ Name: table.Name, Indexes: []fizz.Index{i}, }) if err != nil { return "", err } sql = append(sql, s) recreateIndexes = append(recreateIndexes, i) } } tempCol := fmt.Sprintf("_%s_tmp", column) sql = append(sql, fmt.Sprintf("ALTER TABLE \"%s\" RENAME COLUMN \"%s\" TO \"%s\";COMMIT TRANSACTION;BEGIN TRANSACTION;", tableName, column, tempCol)) s, err := fn(*table, *col, tempCol) if err != nil { return "", err } sql = append(sql, s, fmt.Sprintf("ALTER TABLE \"%s\" DROP COLUMN \"%s\";COMMIT TRANSACTION;BEGIN TRANSACTION;", tableName, tempCol)) for _, i := range recreateIndexes { s, err := p.AddIndex(fizz.Table{ Name: table.Name, Indexes: []fizz.Index{i}, }) if err != nil { return "", err } sql = append(sql, s) } for _, i := range recreateForeignKeys { s, err := p.AddForeignKey(fizz.Table{ Name: table.Name, ForeignKeys: []fizz.ForeignKey{i}, }) if err != nil { return "", err } sql = append(sql, s) } return strings.Join(sql, "\n"), nil } func (p *Cockroach) colType(c fizz.Column) string { switch c.ColType { case "string": s := "255" if c.Options["size"] != nil { s = fmt.Sprintf("%d", c.Options["size"]) } return fmt.Sprintf("VARCHAR (%s)", s) case "uuid": return "UUID" case "time", "datetime": return "timestamp" case "blob": return "BYTES" case "float", "decimal": if c.Options["precision"] != nil { precision := c.Options["precision"] if c.Options["scale"] != nil { scale := c.Options["scale"] return fmt.Sprintf("DECIMAL(%d,%d)", precision, scale) } return fmt.Sprintf("DECIMAL(%d)", precision) } return "DECIMAL" default: return c.ColType } } func (p *Cockroach) buildForeignKey(t fizz.Table, fk fizz.ForeignKey, onCreate bool) string { rcols := []string{} for _, c := range fk.References.Columns { rcols = append(rcols, fmt.Sprintf("\"%s\"", c)) } refs := fmt.Sprintf("%s (%s)", p.escapeIdentifier(fk.References.Table), strings.Join(rcols, ", ")) s := fmt.Sprintf("CONSTRAINT \"%s\" FOREIGN KEY (\"%s\") REFERENCES %s", fk.Name, fk.Column, refs) if onUpdate, ok := fk.Options["on_update"]; ok { s += fmt.Sprintf(" ON UPDATE %s", onUpdate) } if onDelete, ok := fk.Options["on_delete"]; ok { s += fmt.Sprintf(" ON DELETE %s", onDelete) } if !onCreate { s = fmt.Sprintf("ALTER TABLE %s ADD %s;COMMIT TRANSACTION;BEGIN TRANSACTION;", p.escapeIdentifier(t.Name), s) } return s } func (Cockroach) escapeIdentifier(s string) string { if !strings.ContainsRune(s, '.') { return fmt.Sprintf("\"%s\"", s) } parts := strings.Split(s, ".") for _, p := range parts { p = fmt.Sprintf("\"%s\"", p) } return strings.Join(parts, ".") } ================================================ FILE: translators/cockroach_meta.go ================================================ package translators import ( "database/sql" "fmt" "github.com/gobuffalo/fizz" ) type cockroachForeignKeyListInfo struct { Name string `db:"name"` Column string `db:"column_name"` TableRef string `db:"referenced_table_name"` ColumnRef string `db:"referenced_column_name"` OnUpdate string `db:"on_update"` OnDelete string `db:"on_delete"` Match string `db:"match"` } type cockroachIndexListInfo struct { Name string `db:"name"` NonUnique bool `db:"non_unique"` } type cockroachIndexInfo struct { Name string `db:"name"` Direction string `db:"direction"` } type cockroachTableInfo struct { Name string `db:"column_name"` Type string `db:"data_type"` NotNull bool `db:"not_null"` Default interface{} `db:"column_default"` PK bool `db:"pk"` } func (t cockroachTableInfo) ToColumn() fizz.Column { c := fizz.Column{ Name: t.Name, ColType: t.Type, Primary: t.PK, Options: fizz.Options{}, } if !t.NotNull { c.Options["null"] = true } if t.Default != nil { c.Options["default_raw"] = fmt.Sprint(t.Default) // strings.TrimSuffix(strings.TrimPrefix(fmt.Sprintf("%s", t.Default), "'"), "'") } return c } type cockroachSchema struct { Schema } func (p *cockroachSchema) Build() error { var err error db, err := sql.Open("pgx", p.URL) if err != nil { return err } defer db.Close() res, err := db.Query("SELECT table_name as name FROM information_schema.tables;") if err != nil { return err } for res.Next() { table := &fizz.Table{ Columns: []fizz.Column{}, Indexes: []fizz.Index{}, } err = res.Scan(&table.Name) if err != nil { return err } if table.Name != "cockroach_sequence" { err = p.buildTableData(table, db) if err != nil { return err } } } return nil } func (p *cockroachSchema) buildTableData(table *fizz.Table, db *sql.DB) error { prag := fmt.Sprintf(`SELECT c.column_name, c.data_type, (c.is_nullable = 'NO') as "not_null", c.column_default, (tc.table_schema IS NOT NULL)::bool AS "pk" FROM information_schema.columns AS c LEFT JOIN information_schema.key_column_usage as kcu ON ((c.table_schema = kcu.table_schema) AND (c.table_name = kcu.table_name) AND (c.column_name = kcu.column_name)) LEFT JOIN information_schema.table_constraints AS tc ON ((tc.table_schema = kcu.table_schema) AND (tc.table_name = kcu.table_name) AND (tc.constraint_name = kcu.constraint_name)) AND (tc.constraint_name = 'primary') WHERE c.table_name = '%s';`, table.Name) res, err := db.Query(prag) if err != nil { return err } defer res.Close() for res.Next() { ti := cockroachTableInfo{} err = res.Scan(&ti.Name, &ti.Type, &ti.NotNull, &ti.Default, &ti.PK) if err != nil { return err } table.Columns = append(table.Columns, ti.ToColumn()) } err = p.buildTableIndexes(table, db) if err != nil { return err } err = p.buildForeignKeyIndexes(table, db) if err != nil { return err } p.schema[table.Name] = table return nil } func (p *cockroachSchema) buildTableIndexes(t *fizz.Table, db *sql.DB) error { prag := fmt.Sprintf(` SELECT DISTINCT index_name AS name, (non_unique = 'YES') AS non_unique FROM information_schema.statistics WHERE table_name = '%s'; `, t.Name) res, err := db.Query(prag) if err != nil { return err } defer res.Close() for res.Next() { li := cockroachIndexListInfo{} err = res.Scan(&li.Name, &li.NonUnique) if err != nil { return err } i := fizz.Index{ Name: li.Name, Unique: !li.NonUnique, Columns: []string{}, } prag = fmt.Sprintf("SELECT column_name as name, direction FROM information_schema.statistics where index_name = '%s' and implicit = 'NO';", i.Name) iires, err := db.Query(prag) if err != nil { return err } for iires.Next() { ii := cockroachIndexInfo{} err = iires.Scan(&ii.Name, &ii.Direction) if err != nil { return err } i.Columns = append(i.Columns, ii.Name) } t.Indexes = append(t.Indexes, i) } return nil } func (p *cockroachSchema) buildForeignKeyIndexes(t *fizz.Table, db *sql.DB) error { prag := fmt.Sprintf(` SELECT fk.constraint_name, fk.referenced_table_name, col.column_name, fk.update_rule, fk.delete_rule, fk.match_option FROM information_schema.referential_constraints as fk INNER JOIN information_schema.key_column_usage as col ON col.constraint_name = fk.constraint_name WHERE fk.table_name = '%s' ;`, t.Name) res, err := db.Query(prag) if err != nil { return err } defer res.Close() for res.Next() { li := cockroachForeignKeyListInfo{} err = res.Scan( &li.Name, &li.TableRef, &li.Column, &li.OnUpdate, &li.OnDelete, &li.Match) if err != nil { return err } options := map[string]interface{}{} if li.OnDelete != "" { options["on_delete"] = li.OnDelete } if li.OnUpdate != "" { options["on_update"] = li.OnUpdate } if li.Match != "" { options["match"] = li.Match } ref := fizz.ForeignKeyRef{ Table: li.TableRef, Columns: []string{}, } prag = fmt.Sprintf(` SELECT column_name as referenced_column_name FROM information_schema.constraint_column_usage as ref WHERE constraint_name = '%s' ;`, li.Name) iires, err := db.Query(prag) if err != nil { return err } for iires.Next() { ii := cockroachForeignKeyListInfo{} err = iires.Scan(&ii.ColumnRef) if err != nil { return err } ref.Columns = append(ref.Columns, ii.ColumnRef) } i := fizz.ForeignKey{ Name: li.Name, Column: li.Column, References: ref, Options: options, } t.ForeignKeys = append(t.ForeignKeys, i) } return nil } ================================================ FILE: translators/cockroach_test.go ================================================ package translators_test import ( "github.com/gobuffalo/fizz" "github.com/gobuffalo/fizz/translators" ) var _ fizz.Translator = (*translators.Cockroach)(nil) func (p *CockroachSuite) crdbt() *translators.Cockroach { ret := translators.NewCockroach("", "pop_test") schema := map[string]*fizz.Table{} ta := &fizz.Table{Name: "users"} ta.Column("testColumn", "type", nil) ta.Indexes = append(ta.Indexes, fizz.Index{Name: "testIndex"}) schema["users"] = ta ta = &fizz.Table{Name: "table_name"} ta.Column("old_column", "type", nil) schema["table_name"] = ta ta = &fizz.Table{Name: "mytable"} ta.Column("mycolumn", "type", nil) schema["mytable"] = ta ta = &fizz.Table{Name: "table"} ta.Indexes = []fizz.Index{{Name: "old_ix"}} schema["table"] = ta ta = &fizz.Table{Name: "profiles"} schema["profiles"] = ta ret.Schema.ReplaceSchema(schema) return ret } func (p *CockroachSuite) Test_Cockroach_CreateTable() { r := p.Require() ddl := `CREATE TABLE "users" ( "id" SERIAL NOT NULL, PRIMARY KEY("id"), "first_name" VARCHAR (255) NOT NULL, "last_name" VARCHAR (255) NOT NULL, "email" VARCHAR (20) NOT NULL, "permissions" jsonb, "age" integer DEFAULT '40', "raw" BYTES NOT NULL, "float" DECIMAL(5) NOT NULL, "company_id" UUID NOT NULL DEFAULT uuid_generate_v1(), "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL );COMMIT TRANSACTION;BEGIN TRANSACTION;` res, _ := fizz.AString(` create_table("users") { t.Column("id", "integer", {"primary": true}) t.Column("first_name", "string", {}) t.Column("last_name", "string", {}) t.Column("email", "string", {"size":20}) t.Column("permissions", "jsonb", {"null": true}) t.Column("age", "integer", {"null": true, "default": 40}) t.Column("raw", "blob", {}) t.Column("float", "float", {"precision": 5}) t.Column("company_id", "uuid", {"default_raw": "uuid_generate_v1()"}) } `, p.crdbt()) r.Equal(ddl, res) } func (p *CockroachSuite) Test_Cockroach_CreateTable_UUID() { r := p.Require() ddl := `CREATE TABLE "users" ( "first_name" VARCHAR (255) NOT NULL, "last_name" VARCHAR (255) NOT NULL, "email" VARCHAR (20) NOT NULL, "permissions" jsonb, "age" integer DEFAULT '40', "uuid" UUID NOT NULL, PRIMARY KEY("uuid"), "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL );COMMIT TRANSACTION;BEGIN TRANSACTION;` res, _ := fizz.AString(` create_table("users") { t.Column("first_name", "string", {}) t.Column("last_name", "string", {}) t.Column("email", "string", {"size":20}) t.Column("permissions", "jsonb", {"null": true}) t.Column("age", "integer", {"null": true, "default": 40}) t.Column("uuid", "uuid", {"primary": true}) } `, p.crdbt()) r.Equal(ddl, res) } func (p *CockroachSuite) Test_Cockroach_CreateTables_WithForeignKeys() { r := p.Require() ddl := `CREATE TABLE "users" ( "id" SERIAL NOT NULL, PRIMARY KEY("id"), "email" VARCHAR (20) NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL );COMMIT TRANSACTION;BEGIN TRANSACTION; CREATE TABLE "profiles" ( "id" SERIAL NOT NULL, PRIMARY KEY("id"), "user_id" INT NOT NULL, "first_name" VARCHAR (255) NOT NULL, "last_name" VARCHAR (255) NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, CONSTRAINT "profiles_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "users" ("id") ON UPDATE CASCADE ON DELETE SET NULL );COMMIT TRANSACTION;BEGIN TRANSACTION;` res, _ := fizz.AString(` create_table("users") { t.Column("id", "INT", {"primary": true}) t.Column("email", "string", {"size":20}) } create_table("profiles") { t.Column("id", "INT", {"primary": true}) t.Column("user_id", "INT", {}) t.Column("first_name", "string", {}) t.Column("last_name", "string", {}) t.ForeignKey("user_id", {"users": ["id"]}, {"on_delete": "SET NULL", "on_update":"CASCADE"}) } `, p.crdbt()) r.Equal(ddl, res) } func (p *CockroachSuite) Test_Cockroach_CreateTables_WithCompositePrimaryKey() { r := p.Require() ddl := `CREATE TABLE "user_profiles" ( "user_id" INT NOT NULL, "profile_id" INT NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, PRIMARY KEY("user_id", "profile_id") );COMMIT TRANSACTION;BEGIN TRANSACTION;` res, _ := fizz.AString(` create_table("user_profiles") { t.Column("user_id", "INT") t.Column("profile_id", "INT") t.PrimaryKey("user_id", "profile_id") } `, p.crdbt()) r.Equal(ddl, res) } func (p *CockroachSuite) Test_Cockroach_DropTable() { r := p.Require() ddl := `DROP TABLE "users";COMMIT TRANSACTION;BEGIN TRANSACTION;` res, _ := fizz.AString(`drop_table("users")`, p.crdbt()) r.Equal(ddl, res) } func (p *CockroachSuite) Test_Cockroach_RenameTable() { r := p.Require() ddl := `ALTER TABLE "users" RENAME TO "people";COMMIT TRANSACTION;BEGIN TRANSACTION;` res, _ := fizz.AString(`rename_table("users", "people")`, p.crdbt()) r.Equal(ddl, res) } func (p *CockroachSuite) Test_Cockroach_RenameTable_NotEnoughValues() { r := p.Require() _, err := p.crdbt().RenameTable([]fizz.Table{}) r.Error(err) } func (p *CockroachSuite) Test_Cockroach_ChangeColumn() { r := p.Require() ddl := `ALTER TABLE "mytable" RENAME COLUMN "mycolumn" TO "_mycolumn_tmp";COMMIT TRANSACTION;BEGIN TRANSACTION; ALTER TABLE "mytable" ADD COLUMN "mycolumn" VARCHAR (50) NOT NULL DEFAULT 'foo';COMMIT TRANSACTION;BEGIN TRANSACTION; UPDATE "mytable" SET "mycolumn" = "_mycolumn_tmp";COMMIT TRANSACTION;BEGIN TRANSACTION; ALTER TABLE "mytable" DROP COLUMN "_mycolumn_tmp";COMMIT TRANSACTION;BEGIN TRANSACTION;` res, _ := fizz.AString(`change_column("mytable", "mycolumn", "string", {"default": "foo", "size": 50})`, p.crdbt()) r.Equal(ddl, res) } func (p *CockroachSuite) Test_Cockroach_AddColumn() { r := p.Require() ddl := `ALTER TABLE "mytable" ADD COLUMN "mycolumn" VARCHAR (50) NOT NULL DEFAULT 'foo';COMMIT TRANSACTION;BEGIN TRANSACTION;` res, _ := fizz.AString(`add_column("mytable", "mycolumn", "string", {"default": "foo", "size": 50})`, 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;` res, _ := fizz.AString(`drop_column("table_name", "column_name")`, p.crdbt()) r.Equal(ddl, res) } func (p *CockroachSuite) Test_Cockroach_RenameColumn() { r := p.Require() ddl := `ALTER TABLE "table_name" RENAME COLUMN "old_column" TO "new_column";COMMIT TRANSACTION;BEGIN TRANSACTION;` res, _ := fizz.AString(`rename_column("table_name", "old_column", "new_column")`, p.crdbt()) r.Equal(ddl, res) } func (p *CockroachSuite) Test_Cockroach_AddIndex() { r := p.Require() ddl := `CREATE INDEX "table_name_column_name_idx" ON "table_name" (column_name);COMMIT TRANSACTION;BEGIN TRANSACTION;` res, _ := fizz.AString(`add_index("table_name", "column_name", {})`, p.crdbt()) r.Equal(ddl, res) } func (p *CockroachSuite) Test_Cockroach_AddIndex_Unique() { r := p.Require() ddl := `CREATE UNIQUE INDEX "table_name_column_name_idx" ON "table_name" (column_name);COMMIT TRANSACTION;BEGIN TRANSACTION;` res, _ := fizz.AString(`add_index("table_name", "column_name", {"unique": true})`, p.crdbt()) r.Equal(ddl, res) } func (p *CockroachSuite) Test_Cockroach_AddIndex_MultiColumn() { r := p.Require() ddl := `CREATE INDEX "table_name_col1_col2_col3_idx" ON "table_name" (col1, col2, col3);COMMIT TRANSACTION;BEGIN TRANSACTION;` res, _ := fizz.AString(`add_index("table_name", ["col1", "col2", "col3"], {})`, p.crdbt()) r.Equal(ddl, res) } func (p *CockroachSuite) Test_Cockroach_AddIndex_CustomName() { r := p.Require() ddl := `CREATE INDEX "custom_name" ON "table_name" (column_name);COMMIT TRANSACTION;BEGIN TRANSACTION;` res, _ := fizz.AString(`add_index("table_name", "column_name", {"name": "custom_name"})`, p.crdbt()) r.Equal(ddl, res) } func (p *CockroachSuite) Test_Cockroach_DropIndex() { r := p.Require() ddl := `DROP INDEX IF EXISTS "my_idx";COMMIT TRANSACTION;BEGIN TRANSACTION;` res, _ := fizz.AString(`drop_index("users", "my_idx")`, p.crdbt()) r.Equal(ddl, res) } func (p *CockroachSuite) Test_Cockroach_RenameIndex() { r := p.Require() ddl := `ALTER INDEX "table"@"old_ix" RENAME TO "new_ix";COMMIT TRANSACTION;BEGIN TRANSACTION;` res, _ := fizz.AString(`rename_index("table", "old_ix", "new_ix")`, p.crdbt()) r.Equal(ddl, res) } func (p *CockroachSuite) buildSchema() translators.Schema { schema := map[string]*fizz.Table{} ta := &fizz.Table{Name: "testTable"} ta.Column("testColumn", "type", nil) ta.Indexes = append(ta.Indexes, fizz.Index{Name: "testIndex"}) schema["testTable"] = ta return translators.CreateSchema("name", "url", schema) } func (p *CockroachSuite) Test_Cockroach_AddForeignKey() { r := p.Require() ddl := `ALTER TABLE "profiles" ADD CONSTRAINT "profiles_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "users" ("id");COMMIT TRANSACTION;BEGIN TRANSACTION;` res, _ := fizz.AString(`add_foreign_key("profiles", "user_id", {"users": ["id"]}, {})`, p.crdbt()) r.Equal(ddl, res) } func (p *CockroachSuite) Test_Cockroach_DropForeignKey() { r := p.Require() ddl := `ALTER TABLE "profiles" DROP CONSTRAINT "profiles_users_id_fk";COMMIT TRANSACTION;BEGIN TRANSACTION;` res, _ := fizz.AString(`drop_foreign_key("profiles", "profiles_users_id_fk", {})`, p.crdbt()) r.Equal(ddl, res) } func (p *CockroachSuite) Test_Cockroach_CreateTable_With_DefaultRaw_Value_In_Primary_Field() { r := p.Require() ddl := `CREATE TABLE "test_cockroach_createtable_with_default_value_in_primary_field" ( "primary_field" UUID NOT NULL DEFAULT gen_random_uuid(), PRIMARY KEY("primary_field"), "normal_field" UUID NOT NULL DEFAULT gen_random_uuid(), "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL );COMMIT TRANSACTION;BEGIN TRANSACTION;` res, _ := fizz.AString(` create_table("test_cockroach_createtable_with_default_value_in_primary_field") { t.Column("primary_field", "uuid", {"primary": true, default_raw: "gen_random_uuid()"}) t.Column("normal_field", "uuid", {default_raw: "gen_random_uuid()"}) } `, p.crdbt()) r.Equal(ddl, res) } ================================================ FILE: translators/mariadb.go ================================================ package translators // MariaDB is a MariaDB-specific translator. type MariaDB struct { *MySQL } // NewMariaDB constructs a new MariaDB translator. func NewMariaDB(url, name string) *MariaDB { md := NewMySQL(url, name) md.strDefaultSize = 191 return &MariaDB{ MySQL: md, } } func (MariaDB) Name() string { return "mariadb" } ================================================ FILE: translators/mariadb_test.go ================================================ package translators_test import ( "fmt" "github.com/gobuffalo/fizz" "github.com/gobuffalo/fizz/translators" ) var _ fizz.Translator = (*translators.MariaDB)(nil) var mat = translators.NewMariaDB("", "") func init() { u := "%s:%s@(%s:%s)/%s?parseTime=true&multiStatements=true&readTimeout=1s&collation=%s" u = fmt.Sprintf(u, getEnv("MYSQL_USER", "root"), getEnv("MYSQL_PASSWORD", ""), getEnv("MYSQL_HOST", "127.0.0.1"), getEnv("MYSQL_PORT", "3306"), "pop_test", "utf8mb4_general_ci") mat = translators.NewMariaDB(u, "pop_test") } func (p *MariaDBSuite) Test_MySQL_SchemaMigration() { r := p.Require() ddl := `CREATE TABLE ` + "`schema_migrations`" + ` ( ` + "`version`" + ` VARCHAR (191) NOT NULL ) ENGINE=InnoDB; CREATE UNIQUE INDEX ` + "`version_idx`" + ` ON ` + "`schema_migrations`" + ` (` + "`version`" + `);` res, err := mat.CreateTable(fizz.Table{ Name: "schema_migrations", Columns: []fizz.Column{ {Name: "version", ColType: "string"}, }, Indexes: []fizz.Index{ {Name: "version_idx", Columns: []string{"version"}, Unique: true}, }, }) r.NoError(err) r.Equal(ddl, res) } ================================================ FILE: translators/mssqlserver.go ================================================ package translators import ( "fmt" "strings" "github.com/gobuffalo/fizz" ) // MsSqlServer is a MS SqlServer-specific translator. type MsSqlServer struct{} // NewMsSqlServer constructs a new MsSqlServer translator. func NewMsSqlServer() *MsSqlServer { return &MsSqlServer{} } func (MsSqlServer) Name() string { return "mssqlserver" } func (p *MsSqlServer) CreateTable(t fizz.Table) (string, error) { sql := []string{} cols := []string{} var s string for _, c := range t.Columns { if c.Primary { s = fmt.Sprintf("%s %s PRIMARY KEY", c.Name, p.colType(c)) if c.Primary && ((c.ColType == "integer" || strings.ToLower(c.ColType) == "int") || (strings.ToLower(c.ColType) == "bigint")) { s = fmt.Sprintf("%s IDENTITY(1,1)", s) } } else { s = p.buildAddColumn(t.Name, c) } cols = append(cols, s) } primaryKeys := t.PrimaryKeys() if len(primaryKeys) > 1 { pks := make([]string, len(primaryKeys)) for i, pk := range primaryKeys { pks[i] = fmt.Sprintf("[%s]", pk) } cols = append(cols, fmt.Sprintf("PRIMARY KEY(%s)", strings.Join(pks, ", "))) } s = fmt.Sprintf("CREATE TABLE %s (\n%s\n);", t.Name, strings.Join(cols, ",\n")) sql = append(sql, s) for _, i := range t.Indexes { s, err := p.AddIndex(fizz.Table{ Name: t.Name, Indexes: []fizz.Index{i}, }) if err != nil { return "", err } sql = append(sql, s) } for _, fk := range t.ForeignKeys { sql = append(sql, p.buildForeignKey(t, fk)) } return strings.Join(sql, "\n"), nil } func (p *MsSqlServer) DropTable(t fizz.Table) (string, error) { return fmt.Sprintf("DROP TABLE %s;", t.Name), nil } func (p *MsSqlServer) RenameTable(t []fizz.Table) (string, error) { if len(t) < 2 { return "", fmt.Errorf("Not enough table names supplied") } return fmt.Sprintf("EXEC sp_rename '%s', '%s';", t[0].Name, t[1].Name), nil } func (p *MsSqlServer) ChangeColumn(t fizz.Table) (string, error) { if len(t.Columns) == 0 { return "", fmt.Errorf("Not enough columns supplied") } c := t.Columns[0] cmds := make([]string, 0) s := fmt.Sprintf("ALTER TABLE %s ALTER COLUMN %s %s", t.Name, c.Name, p.colType(c)) if c.Options["null"] == nil { s = fmt.Sprintf("%s NOT NULL", s) } else { s = fmt.Sprintf("%s NULL", s) } cmds = append(cmds, s) setDefault := c.Options["default"] != nil || c.Options["default_raw"] != nil if setDefault { dfConstraintName := fmt.Sprintf("DF_%s_%s", t.Name, c.Name) cmds = append(cmds, fmt.Sprintf("ALTER TABLE %s DROP CONSTRAINT IF EXISTS %s;", t.Name, dfConstraintName)) s := fmt.Sprintf("ALTER TABLE %s ADD CONSTRAINT %s DEFAULT", t.Name, dfConstraintName) if c.Options["default"] != nil { cmds = append(cmds, fmt.Sprintf("%s '%v' FOR %s;", s, c.Options["default"], c.Name)) } if c.Options["default_raw"] != nil { cmds = append(cmds, fmt.Sprintf("%s %s FOR %s;", s, c.Options["default_raw"], c.Name)) } } if len(cmds) > 0 { return strings.Join(cmds, "\n"), nil } return "", nil } func (p *MsSqlServer) AddColumn(t fizz.Table) (string, error) { if len(t.Columns) == 0 { return "", fmt.Errorf("not enough columns supplied") } //if _, ok := t.Columns[0].Options["first"]; ok { // return "", fmt.Errorf("T-SQL does not support adding column at a specific position.") //} // //if _, ok := t.Columns[0].Options["after"]; ok { // return "", fmt.Errorf("T-SQL does not support adding column at a specific position.") //} c := t.Columns[0] s := fmt.Sprintf("ALTER TABLE %s ADD %s;", t.Name, p.buildAddColumn(t.Name, c)) return s, nil } func (p *MsSqlServer) DropColumn(t fizz.Table) (string, error) { if len(t.Columns) == 0 { return "", fmt.Errorf("not enough columns supplied") } c := t.Columns[0] return fmt.Sprintf("ALTER TABLE %s DROP COLUMN %s;", t.Name, c.Name), nil } func (p *MsSqlServer) RenameColumn(t fizz.Table) (string, error) { if len(t.Columns) < 2 { return "", fmt.Errorf("not enough columns supplied") } oc := t.Columns[0] nc := t.Columns[1] s := fmt.Sprintf("EXEC sp_rename '%s.%s', '%s', 'COLUMN';", t.Name, oc.Name, nc.Name) return s, nil } func (p *MsSqlServer) AddIndex(t fizz.Table) (string, error) { if len(t.Indexes) == 0 { return "", fmt.Errorf("not enough indexes supplied") } i := t.Indexes[0] s := fmt.Sprintf("CREATE INDEX %s ON %s (%s);", i.Name, t.Name, strings.Join(i.Columns, ", ")) if i.Unique { s = strings.Replace(s, "CREATE", "CREATE UNIQUE", 1) } return s, nil } func (p *MsSqlServer) DropIndex(t fizz.Table) (string, error) { if len(t.Indexes) == 0 { return "", fmt.Errorf("not enough indexes supplied") } i := t.Indexes[0] return fmt.Sprintf("DROP INDEX %s ON %s;", i.Name, t.Name), nil } func (p *MsSqlServer) RenameIndex(t fizz.Table) (string, error) { ix := t.Indexes if len(ix) < 2 { return "", fmt.Errorf("not enough indexes supplied") } oi := ix[0] ni := ix[1] return fmt.Sprintf("EXEC sp_rename '%s.%s', '%s', 'INDEX';", t.Name, oi.Name, ni.Name), nil } func (p *MsSqlServer) AddForeignKey(t fizz.Table) (string, error) { if len(t.ForeignKeys) == 0 { return "", fmt.Errorf("not enough foreign keys supplied") } return p.buildForeignKey(t, t.ForeignKeys[0]), nil } func (p *MsSqlServer) DropForeignKey(t fizz.Table) (string, error) { if len(t.ForeignKeys) == 0 { return "", fmt.Errorf("not enough foreign keys supplied") } fk := t.ForeignKeys[0] var ifExists string if v, ok := fk.Options["if_exists"]; ok && v.(bool) { ifExists = "IF EXISTS" } s := fmt.Sprintf("ALTER TABLE %s DROP CONSTRAINT %s %s;", t.Name, ifExists, fk.Name) return s, nil } func (p *MsSqlServer) buildAddColumn(tableName string, c fizz.Column) string { s := fmt.Sprintf("%s %s", c.Name, p.colType(c)) 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) if c.Options["default"] != nil { s = fmt.Sprintf("%s CONSTRAINT %s DEFAULT '%v'", s, dfConstraintName, c.Options["default"]) } if c.Options["default_raw"] != nil { s = fmt.Sprintf("%s CONSTRAINT %s DEFAULT %s", s, dfConstraintName, c.Options["default_raw"]) } } return s } func (p *MsSqlServer) colType(c fizz.Column) string { switch c.ColType { case "integer": return "INT" case "string": s := "255" if c.Options["size"] != nil { s = fmt.Sprintf("%d", c.Options["size"]) } return fmt.Sprintf("NVARCHAR (%s)", s) case "uuid": return "uniqueidentifier" case "blob": return "VARBINARY(MAX)" case "float", "decimal": if c.Options["precision"] != nil { precision := c.Options["precision"] if c.Options["scale"] != nil { scale := c.Options["scale"] return fmt.Sprintf("DECIMAL(%d,%d)", precision, scale) } return fmt.Sprintf("DECIMAL(%d)", precision) } return "DECIMAL" case "timestamp": return "DATETIME" case "boolean": return "BIT" default: return c.ColType } } func (p *MsSqlServer) buildForeignKey(t fizz.Table, fk fizz.ForeignKey) string { refs := fmt.Sprintf("%s (%s)", fk.References.Table, strings.Join(fk.References.Columns, ", ")) s := fmt.Sprintf("FOREIGN KEY (%s) REFERENCES %s", fk.Column, refs) s = fmt.Sprintf("ALTER TABLE %s ADD CONSTRAINT %s %s;", t.Name, fk.Name, s) return s } ================================================ FILE: translators/mssqlserver_test.go ================================================ package translators_test import ( "github.com/gobuffalo/fizz" "github.com/gobuffalo/fizz/translators" ) var _ fizz.Translator = (*translators.MsSqlServer)(nil) var sqlsrv = translators.NewMsSqlServer() func (p *MsSqlServerSQLSuite) Test_MsSqlServer_SchemaMigration() { r := p.Require() ddl := `CREATE TABLE schema_migrations ( version NVARCHAR (255) NOT NULL ); CREATE UNIQUE INDEX version_idx ON schema_migrations (version);` res, err := sqlsrv.CreateTable(fizz.Table{ Name: "schema_migrations", Columns: []fizz.Column{ {Name: "version", ColType: "string"}, }, Indexes: []fizz.Index{ {Name: "version_idx", Columns: []string{"version"}, Unique: true}, }, }) r.NoError(err) r.Equal(ddl, res) } func (p *MsSqlServerSQLSuite) Test_MsSqlServer_CreateTable() { r := p.Require() ddl := `CREATE TABLE users ( id INT PRIMARY KEY IDENTITY(1,1), first_name NVARCHAR (255) NOT NULL, last_name NVARCHAR (255) NOT NULL, email NVARCHAR (20) NOT NULL, permissions text, age INT CONSTRAINT DF_users_age DEFAULT '40', raw VARBINARY(MAX) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL );` res, _ := fizz.AString(` create_table("users") { t.Column("first_name", "string", {}) t.Column("last_name", "string", {}) t.Column("email", "string", {"size":20}) t.Column("permissions", "text", {"null": true}) t.Column("age", "integer", {"null": true, "default": 40}) t.Column("raw", "blob", {}) } `, sqlsrv) r.Equal(ddl, res) } func (p *MsSqlServerSQLSuite) Test_MsSqlServer_CreateTable_UUID() { r := p.Require() ddl := `CREATE TABLE users ( first_name NVARCHAR (255) NOT NULL, last_name NVARCHAR (255) NOT NULL, email NVARCHAR (20) NOT NULL, permissions text, age INT CONSTRAINT DF_users_age DEFAULT '40', uuid uniqueidentifier PRIMARY KEY, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL );` res, _ := fizz.AString(` create_table("users") { t.Column("first_name", "string", {}) t.Column("last_name", "string", {}) t.Column("email", "string", {"size":20}) t.Column("permissions", "text", {"null": true}) t.Column("age", "integer", {"null": true, "default": 40}) t.Column("uuid", "uuid", {"primary": true}) } `, sqlsrv) r.Equal(ddl, res) } func (p *MsSqlServerSQLSuite) Test_MsSqlServer_CreateTables_WithForeignKeys() { r := p.Require() ddl := `CREATE TABLE users ( id INT PRIMARY KEY IDENTITY(1,1), email NVARCHAR (20) NOT NULL, created_at DATETIME NOT NULL, 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, last_name NVARCHAR (255) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL ); ALTER TABLE profiles ADD CONSTRAINT profiles_users_id_fk FOREIGN KEY (user_id) REFERENCES users (id);` res, _ := fizz.AString(` create_table("users") { t.Column("id", "INT", {"primary": true}) t.Column("email", "string", {"size":20}) } create_table("profiles") { t.Column("id", "INT", {"primary": true}) t.Column("user_id", "INT", {}) t.Column("first_name", "string", {}) t.Column("last_name", "string", {}) t.ForeignKey("user_id", {"users": ["id"]}, {}) } `, sqlsrv) r.Equal(ddl, res) } func (p *MsSqlServerSQLSuite) Test_MsSqlServer_CreateTables_WithCompositePrimaryKey() { r := p.Require() ddl := `CREATE TABLE user_profiles ( user_id INT NOT NULL, profile_id INT NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL PRIMARY KEY([user_id], [profile_id]) );` res, _ := fizz.AString(` create_table("user_profiles") { t.Column("user_id", "INT") t.Column("profile_id", "INT") t.PrimaryKey("user_id", "profile_id") } `, sqlsrv) r.Equal(ddl, res) } func (p *MsSqlServerSQLSuite) Test_MsSqlServer_DropTable() { r := p.Require() ddl := `DROP TABLE users;` res, _ := fizz.AString(`drop_table("users")`, sqlsrv) r.Equal(ddl, res) } func (p *MsSqlServerSQLSuite) Test_MsSqlServer_RenameTable() { r := p.Require() ddl := `EXEC sp_rename 'users', 'people';` res, _ := fizz.AString(`rename_table("users", "people")`, sqlsrv) r.Equal(ddl, res) } func (p *MsSqlServerSQLSuite) Test_MsSqlServer_RenameTable_NotEnoughValues() { r := p.Require() _, err := sqlsrv.RenameTable([]fizz.Table{}) r.Error(err) } func (p *MsSqlServerSQLSuite) Test_MsSqlServer_ChangeColumn() { r := p.Require() ddl := `ALTER TABLE users ALTER COLUMN mycolumn NVARCHAR (50) NOT NULL ALTER TABLE users DROP CONSTRAINT IF EXISTS DF_users_mycolumn; ALTER TABLE users ADD CONSTRAINT DF_users_mycolumn DEFAULT 'foo' FOR mycolumn;` res, _ := fizz.AString(`change_column("users", "mycolumn", "string", {"default": "foo", "size": 50})`, sqlsrv) r.Equal(ddl, res) } func (p *MsSqlServerSQLSuite) Test_MsSqlServer_AddColumn() { r := p.Require() ddl := `ALTER TABLE users ADD mycolumn NVARCHAR (50) NOT NULL CONSTRAINT DF_users_mycolumn DEFAULT 'foo';` res, _ := fizz.AString(`add_column("users", "mycolumn", "string", {"default": "foo", "size": 50})`, sqlsrv) r.Equal(ddl, res) } func (p *MsSqlServerSQLSuite) Test_MsSqlServer_DropColumn() { r := p.Require() ddl := `ALTER TABLE users DROP COLUMN mycolumn;` res, _ := fizz.AString(`drop_column("users", "mycolumn")`, sqlsrv) r.Equal(ddl, res) } func (p *MsSqlServerSQLSuite) Test_MsSqlServer_RenameColumn() { r := p.Require() ddl := `EXEC sp_rename 'users.email', 'email_address', 'COLUMN';` res, _ := fizz.AString(`rename_column("users", "email", "email_address")`, sqlsrv) r.Equal(ddl, res) } func (p *MsSqlServerSQLSuite) Test_MsSqlServer_AddIndex() { r := p.Require() ddl := `CREATE INDEX users_email_idx ON users (email);` res, _ := fizz.AString(`add_index("users", "email", {})`, sqlsrv) r.Equal(ddl, res) } func (p *MsSqlServerSQLSuite) Test_MsSqlServer_AddIndex_Unique() { r := p.Require() ddl := `CREATE UNIQUE INDEX users_email_idx ON users (email);` res, _ := fizz.AString(`add_index("users", "email", {"unique": true})`, sqlsrv) r.Equal(ddl, res) } func (p *MsSqlServerSQLSuite) Test_MsSqlServer_AddIndex_MultiColumn() { r := p.Require() ddl := `CREATE INDEX users_id_email_idx ON users (id, email);` res, _ := fizz.AString(`add_index("users", ["id", "email"], {})`, sqlsrv) r.Equal(ddl, res) } func (p *MsSqlServerSQLSuite) Test_MsSqlServer_AddIndex_CustomName() { r := p.Require() ddl := `CREATE INDEX email_index ON users (email);` res, _ := fizz.AString(`add_index("users", "email", {"name": "email_index"})`, sqlsrv) r.Equal(ddl, res) } func (p *MsSqlServerSQLSuite) Test_MsSqlServer_DropIndex() { r := p.Require() ddl := `DROP INDEX email_idx ON users;` res, _ := fizz.AString(`drop_index("users", "email_idx")`, sqlsrv) r.Equal(ddl, res) } func (p *MsSqlServerSQLSuite) Test_MsSqlServer_RenameIndex() { r := p.Require() ddl := `EXEC sp_rename 'users.email_idx', 'email_address_ix', 'INDEX';` res, _ := fizz.AString(`rename_index("users", "email_idx", "email_address_ix")`, sqlsrv) r.Equal(ddl, res) } func (p *MsSqlServerSQLSuite) Test_MsSqlServer_AddForeignKey() { r := p.Require() ddl := `ALTER TABLE profiles ADD CONSTRAINT profiles_users_id_fk FOREIGN KEY (user_id) REFERENCES users (id);` res, _ := fizz.AString(`add_foreign_key("profiles", "user_id", {"users": ["id"]}, {})`, sqlsrv) r.Equal(ddl, res) } func (p *MsSqlServerSQLSuite) Test_MsSqlServer_DropForeignKey() { r := p.Require() ddl := `ALTER TABLE profiles DROP CONSTRAINT profiles_users_id_fk;` res, _ := fizz.AString(`drop_foreign_key("profiles", "profiles_users_id_fk", {})`, sqlsrv) r.Equal(ddl, res) } ================================================ FILE: translators/mysql.go ================================================ package translators import ( "fmt" "regexp" "strings" "github.com/gobuffalo/fizz" ) // MySQL is a MySQL-specific translator. type MySQL struct { Schema SchemaQuery strDefaultSize int } // NewMySQL constructs a new MySQL translator. func NewMySQL(url, name string) *MySQL { schema := &mysqlSchema{Schema{URL: url, Name: name, schema: map[string]*fizz.Table{}}} schema.Builder = schema return &MySQL{ Schema: schema, strDefaultSize: 255, } } func (MySQL) Name() string { return "mysql" } // CreateTable translates a fizz Table to its MySQL SQL definition. func (p *MySQL) CreateTable(t fizz.Table) (string, error) { sql := []string{} cols := []string{} for _, c := range t.Columns { cols = append(cols, p.buildColumn(c)) if c.Primary { cols = append(cols, fmt.Sprintf("PRIMARY KEY(`%s`)", c.Name)) } } for _, fk := range t.ForeignKeys { cols = append(cols, p.buildForeignKey(t, fk, true)) } primaryKeys := t.PrimaryKeys() if len(primaryKeys) > 1 { pks := make([]string, len(primaryKeys)) for i, pk := range primaryKeys { pks[i] = fmt.Sprintf("`%s`", pk) } cols = append(cols, fmt.Sprintf("PRIMARY KEY(%s)", strings.Join(pks, ", "))) } s := fmt.Sprintf("CREATE TABLE %s (\n%s\n) ENGINE=InnoDB;", p.escapeIdentifier(t.Name), strings.Join(cols, ",\n")) sql = append(sql, s) for _, i := range t.Indexes { s, err := p.AddIndex(fizz.Table{ Name: t.Name, Indexes: []fizz.Index{i}, }) if err != nil { return "", err } sql = append(sql, s) } return strings.Join(sql, "\n"), nil } func (p *MySQL) DropTable(t fizz.Table) (string, error) { return fmt.Sprintf("DROP TABLE %s;", p.escapeIdentifier(t.Name)), nil } func (p *MySQL) RenameTable(t []fizz.Table) (string, error) { if len(t) < 2 { return "", fmt.Errorf("not enough table names supplied") } return fmt.Sprintf("ALTER TABLE %s RENAME TO %s;", p.escapeIdentifier(t[0].Name), p.escapeIdentifier(t[1].Name)), nil } func (p *MySQL) ChangeColumn(t fizz.Table) (string, error) { if len(t.Columns) == 0 { return "", fmt.Errorf("not enough columns supplied") } c := t.Columns[0] s := fmt.Sprintf("ALTER TABLE %s MODIFY %s;", p.escapeIdentifier(t.Name), p.buildColumn(c)) return s, nil } func (p *MySQL) AddColumn(t fizz.Table) (string, error) { if len(t.Columns) == 0 { return "", fmt.Errorf("not enough columns supplied") } if _, ok := t.Columns[0].Options["first"]; ok { c := t.Columns[0] s := fmt.Sprintf("ALTER TABLE %s ADD COLUMN %s FIRST;", p.escapeIdentifier(t.Name), p.buildColumn(c)) return s, nil } if val, ok := t.Columns[0].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) return s, nil } c := t.Columns[0] s := fmt.Sprintf("ALTER TABLE %s ADD COLUMN %s;", p.escapeIdentifier(t.Name), p.buildColumn(c)) return s, nil } func (p *MySQL) DropColumn(t fizz.Table) (string, error) { if len(t.Columns) == 0 { return "", fmt.Errorf("not enough columns supplied") } c := t.Columns[0] return fmt.Sprintf("ALTER TABLE %s DROP COLUMN `%s`;", p.escapeIdentifier(t.Name), c.Name), nil } func (p *MySQL) RenameColumn(t fizz.Table) (string, error) { if len(t.Columns) < 2 { return "", fmt.Errorf("not enough columns supplied") } oc := t.Columns[0] nc := t.Columns[1] ti, err := p.Schema.TableInfo(t.Name) if err != nil { return "", err } var c fizz.Column for _, c = range ti.Columns { if c.Name == oc.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) return s, nil } func (p *MySQL) AddIndex(t fizz.Table) (string, error) { if len(t.Indexes) == 0 { return "", fmt.Errorf("not enough indexes supplied") } i := t.Indexes[0] cols := []string{} for _, c := range i.Columns { cols = append(cols, fmt.Sprintf("`%s`", c)) } s := fmt.Sprintf("CREATE INDEX `%s` ON %s (%s);", i.Name, p.escapeIdentifier(t.Name), strings.Join(cols, ", ")) if i.Unique { s = strings.Replace(s, "CREATE", "CREATE UNIQUE", 1) } return s, nil } func (p *MySQL) DropIndex(t fizz.Table) (string, error) { if len(t.Indexes) == 0 { return "", fmt.Errorf("not enough indexes supplied") } i := t.Indexes[0] return fmt.Sprintf("DROP INDEX `%s` ON %s;", i.Name, p.escapeIdentifier(t.Name)), nil } func (p *MySQL) RenameIndex(t fizz.Table) (string, error) { schema := p.Schema.(*mysqlSchema) version, err := schema.Version() if err != nil { return "", err } if version.LessThan(mysql57Version) { return "", fmt.Errorf("renaming indexes on MySQL versions less than 5.7 is not supported by fizz; use raw SQL instead") } ix := t.Indexes if len(ix) < 2 { return "", fmt.Errorf("not enough indexes supplied") } oi := ix[0] ni := ix[1] return fmt.Sprintf("ALTER TABLE %s RENAME INDEX `%s` TO `%s`;", p.escapeIdentifier(t.Name), oi.Name, ni.Name), nil } func (p *MySQL) AddForeignKey(t fizz.Table) (string, error) { if len(t.ForeignKeys) == 0 { return "", fmt.Errorf("not enough foreign keys supplied") } return p.buildForeignKey(t, t.ForeignKeys[0], false), nil } func (p *MySQL) DropForeignKey(t fizz.Table) (string, error) { if len(t.ForeignKeys) == 0 { return "", fmt.Errorf("not enough foreign keys supplied") } fk := t.ForeignKeys[0] var ifExists string if v, ok := fk.Options["if_exists"]; ok && v.(bool) { ifExists = "IF EXISTS " } s := fmt.Sprintf("ALTER TABLE %s DROP FOREIGN KEY %s`%s`;", p.escapeIdentifier(t.Name), ifExists, fk.Name) return s, nil } func (p *MySQL) buildColumn(c fizz.Column) string { s := fmt.Sprintf("`%s` %s", c.Name, p.colType(c)) if c.Options["null"] == nil || c.Options["null"] == "false" || c.Primary { s = fmt.Sprintf("%s NOT NULL", s) } if c.Options["default"] != nil { d := fmt.Sprintf("%#v", c.Options["default"]) re := regexp.MustCompile("^(\")(.+)(\")$") d = re.ReplaceAllString(d, "'$2'") s = fmt.Sprintf("%s DEFAULT %s", s, d) } if c.Options["default_raw"] != nil { d := fmt.Sprintf("%s", c.Options["default_raw"]) s = fmt.Sprintf("%s DEFAULT %s", s, d) } // there are also tinyint, smallint, mediumint, and bigint if c.Primary && (c.ColType == "integer" || strings.HasSuffix(strings.ToLower(c.ColType), "int")) { s = fmt.Sprintf("%s AUTO_INCREMENT", s) } return s } func (p *MySQL) colType(c fizz.Column) string { switch strings.ToLower(c.ColType) { case "string": s := fmt.Sprintf("%d", p.strDefaultSize) if c.Options["size"] != nil { s = fmt.Sprintf("%d", c.Options["size"]) } return fmt.Sprintf("VARCHAR (%s)", s) case "uuid": return "char(36)" case "timestamp", "time", "datetime": return "DATETIME" case "blob", "[]byte": return "BLOB" case "int", "integer": return "INTEGER" case "float", "double", "decimal", "numeric": colType := strings.ToUpper(c.ColType) if c.Options["precision"] != nil { precision := c.Options["precision"] if c.Options["scale"] != nil { scale := c.Options["scale"] return fmt.Sprintf("%s(%d,%d)", colType, precision, scale) } return fmt.Sprintf("%s(%d)", colType, precision) } return colType case "json": return "JSON" default: return c.ColType } } func (p *MySQL) buildForeignKey(t fizz.Table, fk fizz.ForeignKey, onCreate bool) string { rcols := []string{} for _, c := range fk.References.Columns { rcols = append(rcols, fmt.Sprintf("`%s`", c)) } refs := fmt.Sprintf("%s (%s)", p.escapeIdentifier(fk.References.Table), strings.Join(rcols, ", ")) s := fmt.Sprintf("FOREIGN KEY (`%s`) REFERENCES %s", fk.Column, refs) if onUpdate, ok := fk.Options["on_update"]; ok { s += fmt.Sprintf(" ON UPDATE %s", onUpdate) } if onDelete, ok := fk.Options["on_delete"]; ok { s += fmt.Sprintf(" ON DELETE %s", onDelete) } if !onCreate { s = fmt.Sprintf("ALTER TABLE %s ADD CONSTRAINT `%s` %s;", p.escapeIdentifier(t.Name), fk.Name, s) } return s } func (MySQL) escapeIdentifier(s string) string { if !strings.ContainsRune(s, '.') { return fmt.Sprintf("`%s`", s) } parts := strings.Split(s, ".") for _, p := range parts { p = fmt.Sprintf("`%s`", p) } return strings.Join(parts, ".") } ================================================ FILE: translators/mysql_meta.go ================================================ package translators import ( "database/sql" "fmt" "strings" "github.com/Masterminds/semver/v3" "github.com/gobuffalo/fizz" ) var mysql57Version = semver.MustParse("5.7.0") type mysqlTableInfo struct { Field string `db:"Field"` Type string `db:"Type"` Null string `db:"Null"` Key string `db:"Key"` Default interface{} `db:"Default"` Extra string `db:"Extra"` } func (ti mysqlTableInfo) ToColumn() fizz.Column { c := fizz.Column{ Name: ti.Field, ColType: ti.Type, Primary: ti.Key == "PRI", Options: map[string]interface{}{}, } if strings.ToLower(ti.Null) == "yes" { c.Options["null"] = true } if ti.Default != nil { d := fmt.Sprintf("%s", ti.Default) c.Options["default"] = d } return c } type mysqlSchema struct { Schema } func (p *mysqlSchema) Version() (*semver.Version, error) { var err error db, err := sql.Open("mysql", p.URL) if err != nil { return nil, err } defer db.Close() res, err := db.Query("SELECT VERSION()") if err != nil { return nil, err } defer res.Close() var rawVersion string for res.Next() { err = res.Scan(&rawVersion) if err != nil { return nil, err } return semver.NewVersion(rawVersion) } return nil, fmt.Errorf("could not fetch MySQL version") } func (p *mysqlSchema) Build() error { db, err := sql.Open("mysql", p.URL) if err != nil { return err } defer db.Close() res, err := db.Query(fmt.Sprintf("select TABLE_NAME as name from information_schema.TABLES where TABLE_SCHEMA = '%s'", p.Name)) if err != nil { return err } defer res.Close() for res.Next() { table := &fizz.Table{ Columns: []fizz.Column{}, Indexes: []fizz.Index{}, } err = res.Scan(&table.Name) if err != nil { return err } err = p.buildTableData(table, db) if err != nil { return err } } return nil } func (p *mysqlSchema) buildTableData(table *fizz.Table, db *sql.DB) error { prag := fmt.Sprintf("SELECT COLUMN_NAME AS `Field`, COLUMN_TYPE AS `Type`, IS_NULLABLE AS `Null`, COLUMN_KEY AS `Key`, COLUMN_DEFAULT AS `Default`, EXTRA AS `Extra` FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = '%s';", table.Name) res, err := db.Query(prag) if err != nil { return err } defer res.Close() for res.Next() { ti := mysqlTableInfo{} err = res.Scan(&ti.Field, &ti.Type, &ti.Null, &ti.Key, &ti.Default, &ti.Extra) if err != nil { return err } table.Columns = append(table.Columns, ti.ToColumn()) } p.schema[table.Name] = table return nil } ================================================ FILE: translators/mysql_test.go ================================================ package translators_test import ( "fmt" _ "github.com/go-sql-driver/mysql" // Load MySQL Go driver "github.com/gobuffalo/fizz" "github.com/gobuffalo/fizz/translators" ) var _ fizz.Translator = (*translators.MySQL)(nil) var myt = translators.NewMySQL("", "") func init() { u := "%s:%s@(%s:%s)/%s?parseTime=true&multiStatements=true&readTimeout=1s&collation=%s" u = fmt.Sprintf(u, getEnv("MYSQL_USER", "root"), getEnv("MYSQL_PASSWORD", "root"), getEnv("MYSQL_HOST", "127.0.0.1"), getEnv("MYSQL_PORT", "3306"), "pop_test", "utf8_general_ci") myt = translators.NewMySQL(u, "pop_test") } func (p *MySQLSuite) Test_MySQL_SchemaMigration() { r := p.Require() ddl := `CREATE TABLE ` + "`schema_migrations`" + ` ( ` + "`version`" + ` VARCHAR (255) NOT NULL ) ENGINE=InnoDB; CREATE UNIQUE INDEX ` + "`version_idx`" + ` ON ` + "`schema_migrations`" + ` (` + "`version`" + `);` res, err := myt.CreateTable(fizz.Table{ Name: "schema_migrations", Columns: []fizz.Column{ {Name: "version", ColType: "string"}, }, Indexes: []fizz.Index{ {Name: "version_idx", Columns: []string{"version"}, Unique: true}, }, }) r.NoError(err) r.Equal(ddl, res) } func (p *MySQLSuite) Test_MySQL_CreateTable() { r := p.Require() ddl := `CREATE TABLE ` + "`users`" + ` ( ` + "`id`" + ` INTEGER NOT NULL AUTO_INCREMENT, PRIMARY KEY(` + "`id`" + `), ` + "`first_name`" + ` VARCHAR (255) NOT NULL, ` + "`last_name`" + ` VARCHAR (255) NOT NULL, ` + "`email`" + ` VARCHAR (20) NOT NULL, ` + "`permissions`" + ` text, ` + "`age`" + ` INTEGER DEFAULT 40, ` + "`raw`" + ` BLOB NOT NULL, ` + "`json`" + ` JSON NOT NULL, ` + "`float`" + ` FLOAT NOT NULL, ` + "`float_noscale`" + ` FLOAT(5) NOT NULL, ` + "`float_scale`" + ` FLOAT(5,2) NOT NULL, ` + "`decimal`" + ` DECIMAL(6,2) NOT NULL, ` + "`numeric`" + ` NUMERIC(7,2) NOT NULL, ` + "`double`" + ` DOUBLE(8,2) NOT NULL, ` + "`integer`" + ` INTEGER NOT NULL, ` + "`bytes`" + ` BLOB NOT NULL, ` + "`created_at`" + ` DATETIME NOT NULL, ` + "`updated_at`" + ` DATETIME NOT NULL ) ENGINE=InnoDB;` res, err := fizz.AString(` create_table("users") { t.Column("id", "integer", {"primary": true}) t.Column("first_name", "string", {}) t.Column("last_name", "string", {}) t.Column("email", "string", {"size":20}) t.Column("permissions", "text", {"null": true}) t.Column("age", "integer", {"null": true, "default": 40}) t.Column("raw", "blob", {}) t.Column("json", "json", {}) t.Column("float", "float") t.Column("float_noscale", "float", {"precision": 5}) t.Column("float_scale", "float", {"precision": 5,"scale":2}) t.Column("decimal", "decimal", {"precision": 6,"scale":2}) t.Column("numeric", "numeric", {"precision": 7,"scale":2}) t.Column("double", "double", {"precision": 8,"scale":2}) t.Column("integer", "integer", {}) t.Column("bytes", "[]byte", {}) } `, myt) r.NoError(err) r.Equal(ddl, res) } func (p *MySQLSuite) Test_MySQL_CreateTable_UUID() { r := p.Require() ddl := `CREATE TABLE ` + "`users`" + ` ( ` + "`first_name`" + ` VARCHAR (255) NOT NULL, ` + "`last_name`" + ` VARCHAR (255) NOT NULL, ` + "`email`" + ` VARCHAR (20) NOT NULL, ` + "`permissions`" + ` text, ` + "`age`" + ` INTEGER DEFAULT 40, ` + "`company_id`" + ` char(36) NOT NULL DEFAULT 'test', ` + "`uuid`" + ` char(36) NOT NULL, PRIMARY KEY(` + "`uuid`" + `), ` + "`created_at`" + ` DATETIME NOT NULL, ` + "`updated_at`" + ` DATETIME NOT NULL ) ENGINE=InnoDB;` res, err := fizz.AString(` create_table("users") { t.Column("first_name", "string", {}) t.Column("last_name", "string", {}) t.Column("email", "string", {"size":20}) t.Column("permissions", "text", {"null": true}) t.Column("age", "integer", {"null": true, "default": 40}) t.Column("company_id", "uuid", {"default_raw": "'test'"}) t.Column("uuid", "uuid", {"primary": true}) } `, myt) r.NoError(err) r.Equal(ddl, res) } func (p *MySQLSuite) Test_MySQL_CreateTables_WithForeignKeys() { r := p.Require() ddl := `CREATE TABLE ` + "`users`" + ` ( ` + "`id`" + ` INTEGER NOT NULL AUTO_INCREMENT, PRIMARY KEY(` + "`id`" + `), ` + "`email`" + ` VARCHAR (20) NOT NULL, ` + "`created_at`" + ` DATETIME NOT NULL, ` + "`updated_at`" + ` DATETIME NOT NULL ) ENGINE=InnoDB; CREATE TABLE ` + "`profiles`" + ` ( ` + "`id`" + ` INTEGER NOT NULL AUTO_INCREMENT, PRIMARY KEY(` + "`id`" + `), ` + "`user_id`" + ` INTEGER NOT NULL, ` + "`first_name`" + ` VARCHAR (255) NOT NULL, ` + "`last_name`" + ` VARCHAR (255) NOT NULL, ` + "`created_at`" + ` DATETIME NOT NULL, ` + "`updated_at`" + ` DATETIME NOT NULL, FOREIGN KEY (` + "`user_id`" + `) REFERENCES ` + "`users`" + ` (` + "`id`" + `) ) ENGINE=InnoDB;` res, err := fizz.AString(` create_table("users") { t.Column("id", "INT", {"primary": true}) t.Column("email", "string", {"size":20}) } create_table("profiles") { t.Column("id", "INT", {"primary": true}) t.Column("user_id", "INT", {}) t.Column("first_name", "string", {}) t.Column("last_name", "string", {}) t.ForeignKey("user_id", {"users": ["id"]}, {}) } `, myt) r.NoError(err) r.Equal(ddl, res) } func (p *MySQLSuite) Test_MySQL_CreateTables_WithVariousInt() { r := p.Require() ddl := `CREATE TABLE ` + "`manyusers`" + ` ( ` + "`id`" + ` bigint NOT NULL AUTO_INCREMENT, ` + `PRIMARY KEY(` + "`id`" + `), ` + "`created_at`" + ` DATETIME NOT NULL, ` + "`updated_at`" + ` DATETIME NOT NULL ) ENGINE=InnoDB; ` + `CREATE TABLE ` + "`someusers`" + ` ( ` + "`id`" + ` smallint NOT NULL AUTO_INCREMENT, ` + `PRIMARY KEY(` + "`id`" + `), ` + "`created_at`" + ` DATETIME NOT NULL, ` + "`updated_at`" + ` DATETIME NOT NULL ) ENGINE=InnoDB;` res, err := fizz.AString(` create_table("manyusers") { t.Column("id", "bigint", {"primary": true}) } create_table("someusers") { t.Column("id", "smallint", {"primary": true}) } `, myt) r.NoError(err) r.Equal(ddl, res) } func (p *MySQLSuite) Test_MySQL_CreateTables_WithCompositePrimaryKey() { r := p.Require() ddl := `CREATE TABLE ` + "`user_profiles`" + ` ( ` + "`user_id`" + ` INTEGER NOT NULL, ` + "`profile_id`" + ` INTEGER NOT NULL, ` + "`created_at`" + ` DATETIME NOT NULL, ` + "`updated_at`" + ` DATETIME NOT NULL, PRIMARY KEY(` + "`user_id`" + `, ` + "`profile_id`" + `) ) ENGINE=InnoDB;` res, _ := fizz.AString(` create_table("user_profiles") { t.Column("user_id", "INT") t.Column("profile_id", "INT") t.PrimaryKey("user_id", "profile_id") } `, myt) r.Equal(ddl, res) } func (p *MySQLSuite) Test_MySQL_DropTable() { r := p.Require() ddl := `DROP TABLE ` + "`users`" + `;` res, err := fizz.AString(`drop_table("users")`, myt) r.NoError(err) r.Equal(ddl, res) } func (p *MySQLSuite) Test_MySQL_RenameTable() { r := p.Require() ddl := `ALTER TABLE ` + "`users`" + ` RENAME TO ` + "`people`" + `;` res, err := fizz.AString(`rename_table("users", "people")`, myt) r.NoError(err) r.Equal(ddl, res) } func (p *MySQLSuite) Test_MySQL_RenameTable_NotEnoughValues() { r := p.Require() _, err := myt.RenameTable([]fizz.Table{}) r.Error(err) } func (p *MySQLSuite) Test_MySQL_ChangeColumn() { r := p.Require() ddl := `ALTER TABLE ` + "`users`" + ` MODIFY ` + "`mycolumn`" + ` VARCHAR (50) NOT NULL DEFAULT 'foo';` res, err := fizz.AString(`change_column("users", "mycolumn", "string", {"default": "foo", "size": 50})`, myt) r.NoError(err) r.Equal(ddl, res) } func (p *MySQLSuite) Test_MySQL_AddColumn() { r := p.Require() ddl := `ALTER TABLE ` + "`users`" + ` ADD COLUMN ` + "`mycolumn`" + ` VARCHAR (50) NOT NULL DEFAULT 'foo';` res, err := fizz.AString(`add_column("users", "mycolumn", "string", {"default": "foo", "size": 50})`, myt) r.NoError(err) r.Equal(ddl, res) } func (p *MySQLSuite) Test_MySQL_AddColumnAfter() { r := p.Require() ddl := `ALTER TABLE ` + "`users`" + ` ADD COLUMN ` + "`mycolumn`" + ` VARCHAR (50) NOT NULL DEFAULT 'foo' AFTER ` + "`created_at`" + `;` res, err := fizz.AString(`add_column("users", "mycolumn", "string", {"default": "foo", "size": 50, "after":"created_at"})`, myt) r.NoError(err) 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;` res, err := fizz.AString(`add_column("users", "mycolumn", "string", {"default": "foo", "size": 50, "first":true})`, myt) r.NoError(err) r.Equal(ddl, res) } func (p *MySQLSuite) Test_MySQL_DropColumn() { r := p.Require() ddl := `ALTER TABLE ` + "`users`" + ` DROP COLUMN ` + "`mycolumn`" + `;` res, err := fizz.AString(`drop_column("users", "mycolumn")`, myt) r.NoError(err) r.Equal(ddl, res) } 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';` res, err := fizz.AString(`rename_column("users", "email", "email_address")`, myt) r.NoError(err) r.Equal(ddl, res) } func (p *MySQLSuite) Test_MySQL_AddIndex() { r := p.Require() ddl := `CREATE INDEX ` + "`users_email_idx`" + ` ON ` + "`users`" + ` (` + "`email`" + `);` res, err := fizz.AString(`add_index("users", "email", {})`, myt) r.NoError(err) r.Equal(ddl, res) } func (p *MySQLSuite) Test_MySQL_AddIndex_Unique() { r := p.Require() ddl := `CREATE UNIQUE INDEX ` + "`users_email_idx`" + ` ON ` + "`users`" + ` (` + "`email`" + `);` res, err := fizz.AString(`add_index("users", "email", {"unique": true})`, myt) r.NoError(err) r.Equal(ddl, res) } func (p *MySQLSuite) Test_MySQL_AddIndex_MultiColumn() { r := p.Require() ddl := `CREATE INDEX ` + "`users_id_email_idx`" + ` ON ` + "`users`" + ` (` + "`id`" + `, ` + "`email`" + `);` res, err := fizz.AString(`add_index("users", ["id", "email"], {})`, myt) r.NoError(err) r.Equal(ddl, res) } func (p *MySQLSuite) Test_MySQL_AddIndex_CustomName() { r := p.Require() ddl := `CREATE INDEX ` + "`email_index`" + ` ON ` + "`users`" + ` (` + "`email`" + `);` res, err := fizz.AString(`add_index("users", "email", {"name": "email_index"})`, myt) r.NoError(err) r.Equal(ddl, res) } func (p *MySQLSuite) Test_MySQL_DropIndex() { r := p.Require() ddl := `DROP INDEX ` + "`email_idx`" + ` ON ` + "`users`" + `;` res, err := fizz.AString(`drop_index("users", "email_idx")`, myt) r.NoError(err) r.Equal(ddl, res) } func (p *MySQLSuite) Test_MySQL_RenameIndex() { r := p.Require() ddl := `ALTER TABLE ` + "`users`" + ` RENAME INDEX ` + "`email_idx`" + ` TO ` + "`email_address_idx`" + `;` res, err := fizz.AString(`rename_index("users", "email_idx", "email_address_idx")`, myt) r.NoError(err) r.Equal(ddl, res) } func (p *MySQLSuite) Test_MySQL_AddForeignKey() { r := p.Require() ddl := `ALTER TABLE ` + "`profiles`" + ` ADD CONSTRAINT ` + "`profiles_users_id_fk`" + ` FOREIGN KEY (` + "`user_id`" + `) REFERENCES ` + "`users`" + ` (` + "`id`" + `);` res, err := fizz.AString(`add_foreign_key("profiles", "user_id", {"users": ["id"]}, {})`, myt) r.NoError(err) r.Equal(ddl, res) } func (p *MySQLSuite) Test_MySQL_DropForeignKey() { r := p.Require() ddl := `ALTER TABLE ` + "`profiles`" + ` DROP FOREIGN KEY ` + "`profiles_users_id_fk`" + `;` res, err := fizz.AString(`drop_foreign_key("profiles", "profiles_users_id_fk", {})`, myt) r.NoError(err) r.Equal(ddl, res) } ================================================ FILE: translators/postgres.go ================================================ package translators import ( "fmt" "strings" "github.com/gobuffalo/fizz" ) type Postgres struct { } func NewPostgres() *Postgres { return &Postgres{} } func (Postgres) Name() string { return "postgres" } func (p *Postgres) CreateTable(t fizz.Table) (string, error) { sql := []string{} cols := []string{} var s string for _, c := range t.Columns { if c.Primary { switch c.ColType { case "string", "uuid": // make sure that we don't fall into default case "integer", "INT", "int": c.ColType = "SERIAL" case "bigint", "BIGINT": c.ColType = "BIGSERIAL" default: return "", fmt.Errorf("can not use %s as a primary key", c.ColType) } } cols = append(cols, p.buildAddColumn(c)) if c.Primary { cols = append(cols, fmt.Sprintf(`PRIMARY KEY("%s")`, c.Name)) } } for _, fk := range t.ForeignKeys { cols = append(cols, p.buildForeignKey(t, fk, true)) } primaryKeys := t.PrimaryKeys() if len(primaryKeys) > 1 { pks := make([]string, len(primaryKeys)) for i, pk := range primaryKeys { pks[i] = fmt.Sprintf("\"%s\"", pk) } cols = append(cols, fmt.Sprintf("PRIMARY KEY(%s)", strings.Join(pks, ", "))) } s = fmt.Sprintf("CREATE TABLE \"%s\" (\n%s\n);", t.Name, strings.Join(cols, ",\n")) sql = append(sql, s) for _, i := range t.Indexes { s, err := p.AddIndex(fizz.Table{ Name: t.Name, Indexes: []fizz.Index{i}, }) if err != nil { return "", err } sql = append(sql, s) } return strings.Join(sql, "\n"), nil } func (p *Postgres) DropTable(t fizz.Table) (string, error) { return fmt.Sprintf("DROP TABLE \"%s\";", t.Name), nil } func (p *Postgres) RenameTable(t []fizz.Table) (string, error) { if len(t) < 2 { return "", fmt.Errorf("not enough table names supplied") } return fmt.Sprintf("ALTER TABLE \"%s\" RENAME TO \"%s\";", t[0].Name, t[1].Name), nil } func (p *Postgres) ChangeColumn(t fizz.Table) (string, error) { if len(t.Columns) == 0 { return "", fmt.Errorf("not enough columns supplied") } c := t.Columns[0] s := fmt.Sprintf("ALTER TABLE \"%s\" ALTER COLUMN %s;", t.Name, p.buildChangeColumn(c)) return s, nil } func (p *Postgres) AddColumn(t fizz.Table) (string, error) { if len(t.Columns) == 0 { 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)) return s, nil } func (p *Postgres) DropColumn(t fizz.Table) (string, error) { if len(t.Columns) == 0 { return "", fmt.Errorf("not enough columns supplied") } c := t.Columns[0] return fmt.Sprintf("ALTER TABLE \"%s\" DROP COLUMN \"%s\";", t.Name, c.Name), nil } func (p *Postgres) RenameColumn(t fizz.Table) (string, error) { if len(t.Columns) < 2 { return "", fmt.Errorf("not enough columns supplied") } oc := t.Columns[0] nc := t.Columns[1] s := fmt.Sprintf("ALTER TABLE \"%s\" RENAME COLUMN \"%s\" TO \"%s\";", t.Name, oc.Name, nc.Name) return s, nil } func (p *Postgres) AddIndex(t fizz.Table) (string, error) { if len(t.Indexes) == 0 { return "", fmt.Errorf("not enough indexes supplied") } i := t.Indexes[0] s := fmt.Sprintf("CREATE INDEX \"%s\" ON \"%s\" (%s);", i.Name, t.Name, strings.Join(i.Columns, ", ")) if i.Unique { s = strings.Replace(s, "CREATE", "CREATE UNIQUE", 1) } return s, nil } func (p *Postgres) DropIndex(t fizz.Table) (string, error) { if len(t.Indexes) == 0 { return "", fmt.Errorf("not enough indexes supplied") } i := t.Indexes[0] return fmt.Sprintf("DROP INDEX \"%s\";", i.Name), nil } func (p *Postgres) RenameIndex(t fizz.Table) (string, error) { ix := t.Indexes if len(ix) < 2 { return "", fmt.Errorf("not enough indexes supplied") } oi := ix[0] ni := ix[1] return fmt.Sprintf("ALTER INDEX \"%s\" RENAME TO \"%s\";", oi.Name, ni.Name), nil } func (p *Postgres) AddForeignKey(t fizz.Table) (string, error) { if len(t.ForeignKeys) == 0 { return "", fmt.Errorf("not enough foreign keys supplied") } return p.buildForeignKey(t, t.ForeignKeys[0], false), nil } func (p *Postgres) DropForeignKey(t fizz.Table) (string, error) { if len(t.ForeignKeys) == 0 { return "", fmt.Errorf("not enough foreign keys supplied") } fk := t.ForeignKeys[0] var ifExists string if v, ok := fk.Options["if_exists"]; ok && v.(bool) { ifExists = "IF EXISTS " } s := fmt.Sprintf("ALTER TABLE %s DROP CONSTRAINT %s\"%s\";", p.escapeIdentifier(t.Name), ifExists, fk.Name) return s, nil } func (p *Postgres) buildAddColumn(c fizz.Column) string { s := fmt.Sprintf("\"%s\" %s", c.Name, p.colType(c)) if c.Options["null"] == nil || c.Primary { 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 } func (p *Postgres) buildChangeColumn(c fizz.Column) string { s := fmt.Sprintf("\"%s\" TYPE %s", c.Name, p.colType(c)) var sets []string if c.Options["null"] == nil { sets = append(sets, fmt.Sprintf("ALTER COLUMN \"%s\" SET NOT NULL", c.Name)) } else { sets = append(sets, fmt.Sprintf("ALTER COLUMN \"%s\" DROP NOT NULL", c.Name)) } if c.Options["default"] != nil { sets = append(sets, fmt.Sprintf("ALTER COLUMN \"%s\" SET DEFAULT '%v'", c.Name, c.Options["default"])) } if c.Options["default_raw"] != nil { sets = append(sets, fmt.Sprintf("ALTER COLUMN \"%s\" SET DEFAULT %s", c.Name, c.Options["default_raw"])) } if len(sets) > 0 { s += ", " + strings.Join(sets, ", ") } return s } func (p *Postgres) colType(c fizz.Column) string { switch c.ColType { case "string": s := "255" if c.Options["size"] != nil { s = fmt.Sprintf("%d", c.Options["size"]) } return fmt.Sprintf("VARCHAR (%s)", s) case "uuid": return "UUID" case "time", "datetime": return "timestamptz" case "blob", "[]byte": return "bytea" case "float", "decimal": if c.Options["precision"] != nil { precision := c.Options["precision"] if c.Options["scale"] != nil { scale := c.Options["scale"] return fmt.Sprintf("DECIMAL(%d,%d)", precision, scale) } return fmt.Sprintf("DECIMAL(%d)", precision) } return "DECIMAL" case "[]string": return "varchar[]" case "[]float": return "decimal[]" case "[]int": return "integer[]" case "json": return "jsonb" default: return c.ColType } } func (p *Postgres) buildForeignKey(t fizz.Table, fk fizz.ForeignKey, onCreate bool) string { rcols := []string{} for _, c := range fk.References.Columns { rcols = append(rcols, fmt.Sprintf("\"%s\"", c)) } refs := fmt.Sprintf("%s (%s)", p.escapeIdentifier(fk.References.Table), strings.Join(rcols, ", ")) s := fmt.Sprintf("FOREIGN KEY (\"%s\") REFERENCES %s", fk.Column, refs) if onUpdate, ok := fk.Options["on_update"]; ok { s += fmt.Sprintf(" ON UPDATE %s", onUpdate) } if onDelete, ok := fk.Options["on_delete"]; ok { s += fmt.Sprintf(" ON DELETE %s", onDelete) } if !onCreate { s = fmt.Sprintf("ALTER TABLE %s ADD CONSTRAINT \"%s\" %s;", p.escapeIdentifier(t.Name), fk.Name, s) } return s } func (Postgres) escapeIdentifier(s string) string { if !strings.ContainsRune(s, '.') { return fmt.Sprintf("\"%s\"", s) } parts := strings.Split(s, ".") for _, p := range parts { p = fmt.Sprintf("\"%s\"", p) } return strings.Join(parts, ".") } ================================================ FILE: translators/postgres_test.go ================================================ package translators_test import ( "github.com/gobuffalo/fizz" "github.com/gobuffalo/fizz/translators" ) var _ fizz.Translator = (*translators.Postgres)(nil) var pgt = translators.NewPostgres() func (p *PostgreSQLSuite) Test_Postgres_CreateTable() { r := p.Require() ddl := `CREATE TABLE "users" ( "id" SERIAL NOT NULL, PRIMARY KEY("id"), "first_name" VARCHAR (255) NOT NULL, "last_name" VARCHAR (255) NOT NULL, "email" VARCHAR (20) NOT NULL, "permissions" jsonb, "age" integer DEFAULT '40', "raw" bytea NOT NULL, "company_id" UUID NOT NULL DEFAULT uuid_generate_v1(), "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL );` res, _ := fizz.AString(` create_table("users") { t.Column("id", "integer", {"primary": true}) t.Column("first_name", "string", {}) t.Column("last_name", "string", {}) t.Column("email", "string", {"size":20}) t.Column("permissions", "jsonb", {"null": true}) t.Column("age", "integer", {"null": true, "default": 40}) t.Column("raw", "blob", {}) t.Column("company_id", "uuid", {"default_raw": "uuid_generate_v1()"}) } `, pgt) r.Equal(ddl, res) } func (p *PostgreSQLSuite) Test_Postgres_CreateTable_UUID() { r := p.Require() ddl := `CREATE TABLE "users" ( "first_name" VARCHAR (255) NOT NULL, "last_name" VARCHAR (255) NOT NULL, "email" VARCHAR (20) NOT NULL, "permissions" jsonb, "age" integer DEFAULT '40', "integer" integer NOT NULL, "float" DECIMAL NOT NULL, "bytes" bytea NOT NULL, "strings" varchar[] NOT NULL, "floats" decimal[] NOT NULL, "ints" integer[] NOT NULL, "jason" jsonb NOT NULL, "mydecimal" DECIMAL NOT NULL, "mydecimal2" DECIMAL(5,2) NOT NULL, "uuid" UUID NOT NULL, PRIMARY KEY("uuid"), "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL );` res, _ := fizz.AString(` create_table("users") { t.Column("first_name", "string", {}) t.Column("last_name", "string", {}) t.Column("email", "string", {"size":20}) t.Column("permissions", "jsonb", {"null": true}) t.Column("age", "integer", {"null": true, "default": 40}) t.Column("integer", "integer", {}) t.Column("float", "float", {}) t.Column("bytes", "[]byte", {}) t.Column("strings", "[]string", {}) t.Column("floats", "[]float", {}) t.Column("ints", "[]int", {}) t.Column("jason", "json", {}) t.Column("mydecimal", "decimal", {}) t.Column("mydecimal2", "decimal", {"precision": 5, "scale": 2}) t.Column("uuid", "uuid", {"primary": true}) } `, pgt) r.Equal(ddl, res) } func (p *PostgreSQLSuite) Test_Postgres_CreateTable_UUID_With_Default() { r := p.Require() ddl := `CREATE TABLE "users" ( "uuid" UUID NOT NULL DEFAULT uuid_generate_v4(), PRIMARY KEY("uuid") );` res, _ := fizz.AString(` create_table("users") { t.Column("uuid", "uuid", {"primary": true, "default_raw": "uuid_generate_v4()"}) t.DisableTimestamps() } `, pgt) r.Equal(ddl, res) } func (p *PostgreSQLSuite) Test_Postgres_CreateTable_Cant_Set_PK_To_Nullable() { r := p.Require() ddl := `CREATE TABLE "users" ( "uuid" UUID NOT NULL, PRIMARY KEY("uuid") );` res, _ := fizz.AString(` create_table("users") { t.Column("uuid", "uuid", {"primary": true, "null": true}) t.DisableTimestamps() } `, pgt) r.Equal(ddl, res) } func (p *PostgreSQLSuite) Test_Postgres_CreateTables_WithForeignKeys() { r := p.Require() ddl := `CREATE TABLE "users" ( "id" SERIAL NOT NULL, PRIMARY KEY("id"), "email" VARCHAR (20) NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL ); CREATE TABLE "profiles" ( "id" SERIAL NOT NULL, PRIMARY KEY("id"), "user_id" INT NOT NULL, "first_name" VARCHAR (255) NOT NULL, "last_name" VARCHAR (255) NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, FOREIGN KEY ("user_id") REFERENCES "users" ("id") );` res, err := fizz.AString(` create_table("users") { t.Column("id", "INT", {"primary": true}) t.Column("email", "string", {"size":20}) } create_table("profiles") { t.Column("id", "INT", {"primary": true}) t.Column("user_id", "INT", {}) t.Column("first_name", "string", {}) t.Column("last_name", "string", {}) t.ForeignKey("user_id", {"users": ["id"]}, {}) } `, pgt) r.NoError(err) r.Equal(ddl, res) } func (p *PostgreSQLSuite) Test_Postgres_CreateTables_WithCompositePrimaryKey() { r := p.Require() ddl := `CREATE TABLE "user_profiles" ( "user_id" INT NOT NULL, "profile_id" INT NOT NULL, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL, PRIMARY KEY("user_id", "profile_id") );` res, _ := fizz.AString(` create_table("user_profiles") { t.Column("user_id", "INT") t.Column("profile_id", "INT") t.PrimaryKey("user_id", "profile_id") } `, pgt) r.Equal(ddl, res) } func (p *PostgreSQLSuite) Test_Postgres_DropTable() { r := p.Require() ddl := `DROP TABLE "users";` res, _ := fizz.AString(`drop_table("users")`, pgt) r.Equal(ddl, res) } func (p *PostgreSQLSuite) Test_Postgres_RenameTable() { r := p.Require() ddl := `ALTER TABLE "users" RENAME TO "people";` res, _ := fizz.AString(`rename_table("users", "people")`, pgt) r.Equal(ddl, res) } func (p *PostgreSQLSuite) Test_Postgres_RenameTable_NotEnoughValues() { r := p.Require() _, err := pgt.RenameTable([]fizz.Table{}) r.Error(err) } func (p *PostgreSQLSuite) Test_Postgres_ChangeColumn() { r := p.Require() ddl := `ALTER TABLE "mytable" ALTER COLUMN "mycolumn" TYPE VARCHAR (50), ALTER COLUMN "mycolumn" SET NOT NULL, ALTER COLUMN "mycolumn" SET DEFAULT 'foo';` res, _ := fizz.AString(`change_column("mytable", "mycolumn", "string", {"default": "foo", "size": 50})`, pgt) r.Equal(ddl, res) } func (p *PostgreSQLSuite) Test_Postgres_AddColumn() { r := p.Require() ddl := `ALTER TABLE "mytable" ADD COLUMN "mycolumn" VARCHAR (50) NOT NULL DEFAULT 'foo';` res, _ := fizz.AString(`add_column("mytable", "mycolumn", "string", {"default": "foo", "size": 50})`, pgt) r.Equal(ddl, res) } func (p *PostgreSQLSuite) Test_Postgres_DropColumn() { r := p.Require() ddl := `ALTER TABLE "table_name" DROP COLUMN "column_name";` res, _ := fizz.AString(`drop_column("table_name", "column_name")`, pgt) r.Equal(ddl, res) } func (p *PostgreSQLSuite) Test_Postgres_RenameColumn() { r := p.Require() ddl := `ALTER TABLE "table_name" RENAME COLUMN "old_column" TO "new_column";` res, _ := fizz.AString(`rename_column("table_name", "old_column", "new_column")`, pgt) r.Equal(ddl, res) } func (p *PostgreSQLSuite) Test_Postgres_AddIndex() { r := p.Require() ddl := `CREATE INDEX "table_name_column_name_idx" ON "table_name" (column_name);` res, _ := fizz.AString(`add_index("table_name", "column_name", {})`, pgt) r.Equal(ddl, res) } func (p *PostgreSQLSuite) Test_Postgres_AddIndex_Unique() { r := p.Require() ddl := `CREATE UNIQUE INDEX "table_name_column_name_idx" ON "table_name" (column_name);` res, _ := fizz.AString(`add_index("table_name", "column_name", {"unique": true})`, pgt) r.Equal(ddl, res) } func (p *PostgreSQLSuite) Test_Postgres_AddIndex_MultiColumn() { r := p.Require() ddl := `CREATE INDEX "table_name_col1_col2_col3_idx" ON "table_name" (col1, col2, col3);` res, _ := fizz.AString(`add_index("table_name", ["col1", "col2", "col3"], {})`, pgt) r.Equal(ddl, res) } func (p *PostgreSQLSuite) Test_Postgres_AddIndex_CustomName() { r := p.Require() ddl := `CREATE INDEX "custom_name" ON "table_name" (column_name);` res, _ := fizz.AString(`add_index("table_name", "column_name", {"name": "custom_name"})`, pgt) r.Equal(ddl, res) } func (p *PostgreSQLSuite) Test_Postgres_DropIndex() { r := p.Require() ddl := `DROP INDEX "my_idx";` res, _ := fizz.AString(`drop_index("users", "my_idx")`, pgt) r.Equal(ddl, res) } func (p *PostgreSQLSuite) Test_Postgres_RenameIndex() { r := p.Require() ddl := `ALTER INDEX "old_ix" RENAME TO "new_ix";` res, _ := fizz.AString(`rename_index("table", "old_ix", "new_ix")`, pgt) r.Equal(ddl, res) } func (p *PostgreSQLSuite) Test_Postgres_AddForeignKey() { r := p.Require() ddl := `ALTER TABLE "profiles" ADD CONSTRAINT "profiles_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "users" ("id");` res, _ := fizz.AString(`add_foreign_key("profiles", "user_id", {"users": ["id"]}, {})`, pgt) r.Equal(ddl, res) } func (p *PostgreSQLSuite) Test_Postgres_DropForeignKey() { r := p.Require() ddl := `ALTER TABLE "profiles" DROP CONSTRAINT "profiles_users_id_fk";` res, _ := fizz.AString(`drop_foreign_key("profiles", "profiles_users_id_fk", {})`, pgt) r.Equal(ddl, res) } ================================================ FILE: translators/schema.go ================================================ package translators import ( "fmt" "strings" "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 Schema struct { schema map[string]*fizz.Table Builder SchemaQuery Name string URL string } func CreateSchema(name string, url string, schema map[string]*fizz.Table) Schema { return Schema{ Name: name, URL: url, schema: schema, } } func (s *Schema) ReplaceSchema(newSchema map[string]*fizz.Table) { s.schema = newSchema } func (s *Schema) Build() error { return fmt.Errorf("build not implemented for this translator") } func (s *Schema) TableInfo(table string) (*fizz.Table, error) { if ti, ok := s.schema[table]; ok { return ti, nil } if s.Builder != nil { err := s.Builder.Build() if err != nil { return nil, err } } else { err := s.Build() if err != nil { return nil, err } } if ti, ok := s.schema[table]; ok { return ti, nil } return nil, fmt.Errorf("could not find table data for %s", table) } func (s *Schema) ReplaceColumn(table string, oldColumn string, newColumn fizz.Column) error { tableInfo, err := s.TableInfo(table) if err != nil { return err } for i, col := range tableInfo.Columns { if strings.ToLower(strings.TrimSpace(col.Name)) == strings.ToLower(strings.TrimSpace(oldColumn)) { tableInfo.Columns[i] = newColumn return nil } } return fmt.Errorf("could not find column(%s) in table(%s)", oldColumn, table) } func (s *Schema) ColumnInfo(table string, column string) (*fizz.Column, error) { ti, err := s.TableInfo(table) if err != nil { return nil, err } if ci, ok := s.findColumnInfo(ti, column); ok { return ci, nil } return nil, fmt.Errorf("could not find column data for %s in table %s", column, table) } func (s *Schema) IndexInfo(table string, idx string) (*fizz.Index, error) { ti, err := s.TableInfo(table) if err != nil { return nil, err } if i, ok := s.findIndexInfo(ti, idx); ok { return i, nil } return nil, fmt.Errorf("could not find index data for %s in table %s", idx, table) } func (s *Schema) Delete(table string) { delete(s.schema, table) } func (s *Schema) SetTable(table *fizz.Table) { s.schema[table.Name] = table } func (s *Schema) DeleteColumn(table string, column string) { tableInfo, err := s.TableInfo(table) if err != nil { return } for i, col := range tableInfo.Columns { if strings.ToLower(strings.TrimSpace(col.Name)) == strings.ToLower(strings.TrimSpace(column)) { tableInfo.Columns = append(tableInfo.Columns[:i], tableInfo.Columns[i+1:]...) return } } } func (s *Schema) findColumnInfo(tableInfo *fizz.Table, column string) (*fizz.Column, bool) { for _, col := range tableInfo.Columns { if strings.ToLower(strings.TrimSpace(col.Name)) == strings.ToLower(strings.TrimSpace(column)) { return &col, true } } return nil, false } func (s *Schema) findIndexInfo(tableInfo *fizz.Table, index string) (*fizz.Index, bool) { for _, ind := range tableInfo.Indexes { if strings.ToLower(strings.TrimSpace(ind.Name)) == strings.ToLower(strings.TrimSpace(index)) { return &ind, true } } return nil, false } ================================================ FILE: translators/schema_test.go ================================================ package translators_test import ( "github.com/gobuffalo/fizz" "github.com/gobuffalo/fizz/translators" ) func (s *SchemaSuite) buildSchema() translators.Schema { schema := map[string]*fizz.Table{} ta := fizz.NewTable("testTable", nil) ta.Column("testColumn", "type", nil) ta.Indexes = append(ta.Indexes, fizz.Index{Name: "testIndex"}) schema["testTable"] = &ta return translators.CreateSchema("name", "url", schema) } func (s *SchemaSuite) Test_Schema_TableInfo() { r := s.Require() ts := s.buildSchema() t, err := ts.TableInfo("testTable") r.NoError(err) r.Equal("testTable", t.Name) } func (s *SchemaSuite) Test_Schema_ColumnInfo() { r := s.Require() ts := s.buildSchema() c, err := ts.ColumnInfo("testTable", "testCOLUMN") r.NoError(err) r.Equal("testColumn", c.Name) } func (s *SchemaSuite) Test_Schema_IndexInfo() { r := s.Require() ts := s.buildSchema() c, err := ts.IndexInfo("testTable", "testindEX") r.NoError(err) r.Equal("testIndex", c.Name) } ================================================ FILE: translators/sqlite.go ================================================ package translators import ( "fmt" "strings" "github.com/gobuffalo/fizz" ) type SQLite struct { Schema SchemaQuery } func NewSQLite(url string) *SQLite { schema := &sqliteSchema{ Schema{ URL: url, schema: map[string]*fizz.Table{}, }, } schema.Builder = schema return &SQLite{ Schema: schema, } } func (SQLite) Name() string { return "sqlite3" } func (p *SQLite) CreateTable(t fizz.Table) (string, error) { p.Schema.SetTable(&t) sql := []string{} cols := []string{} var s string for _, c := range t.Columns { if c.Primary { switch strings.ToLower(c.ColType) { case "integer", "int": s = fmt.Sprintf("\"%s\" INTEGER PRIMARY KEY AUTOINCREMENT", c.Name) case "string", "text", "uuid": s = fmt.Sprintf("\"%s\" TEXT PRIMARY KEY", c.Name) default: return "", fmt.Errorf("can not use %s as a primary key", c.ColType) } } else { s = p.buildColumn(c) } cols = append(cols, s) } for _, fk := range t.ForeignKeys { cols = append(cols, p.buildForeignKey(t, fk, true)) } primaryKeys := t.PrimaryKeys() if len(primaryKeys) > 1 { pks := make([]string, len(primaryKeys)) for i, pk := range primaryKeys { pks[i] = fmt.Sprintf("\"%s\"", pk) } cols = append(cols, fmt.Sprintf("PRIMARY KEY(%s)", strings.Join(pks, ", "))) } s = fmt.Sprintf("CREATE TABLE \"%s\" (\n%s\n);", t.Name, strings.Join(cols, ",\n")) sql = append(sql, s) for _, i := range t.Indexes { s, err := p.AddIndex(fizz.Table{ Name: t.Name, Indexes: []fizz.Index{i}, }) if err != nil { return "", err } sql = append(sql, s) } return strings.Join(sql, "\n"), nil } func (p *SQLite) DropTable(t fizz.Table) (string, error) { p.Schema.Delete(t.Name) s := fmt.Sprintf("DROP TABLE \"%s\";", t.Name) return s, nil } func (p *SQLite) RenameTable(t []fizz.Table) (string, error) { if len(t) < 2 { return "", fmt.Errorf("not enough table names supplied") } oldName := t[0].Name newName := t[1].Name tableInfo, err := p.Schema.TableInfo(oldName) if err != nil { return "", err } tableInfo.Name = newName s := fmt.Sprintf("ALTER TABLE \"%s\" RENAME TO \"%s\";", oldName, newName) return s, nil } func (p *SQLite) ChangeColumn(t fizz.Table) (string, error) { tableInfo, err := p.Schema.TableInfo(t.Name) if err != nil { return "", err } for i := range tableInfo.Columns { if tableInfo.Columns[i].Name == t.Columns[0].Name { tableInfo.Columns[i] = t.Columns[0] break } } sql := []string{} var copyIndexes = make([]fizz.Index, len(tableInfo.Indexes)) for k, i := range tableInfo.Indexes { s, err := p.DropIndex(fizz.Table{ Name: tableInfo.Name, Indexes: []fizz.Index{i}, }) if err != nil { return "", err } sql = append(sql, s) copyIndexes[k] = i } tableInfo.Indexes = copyIndexes // We need to recreate those // 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 }) if err != nil { return "", err } sql = append(sql, s) return strings.Join(sql, "\n"), nil } func (p *SQLite) AddColumn(t fizz.Table) (string, error) { if len(t.Columns) == 0 { return "", fmt.Errorf("not enough columns supplied") } c := t.Columns[0] tableInfo, err := p.Schema.TableInfo(t.Name) if err != nil { return "", err } tableInfo.Columns = append(tableInfo.Columns, c) s := fmt.Sprintf("ALTER TABLE \"%s\" ADD COLUMN %s;", t.Name, p.buildColumn(c)) return s, nil } func (p *SQLite) DropColumn(t fizz.Table) (string, error) { if len(t.Columns) < 1 { return "", fmt.Errorf("not enough columns supplied") } tableInfo, err := p.Schema.TableInfo(t.Name) if err != nil { return "", err } sql := []string{} droppedColumn := t.Columns[0] newColumns := []fizz.Column{} for _, c := range tableInfo.Columns { if c.Name != droppedColumn.Name { newColumns = append(newColumns, c) } } tableInfo.Columns = newColumns newIndexes := []fizz.Index{} for _, i := range tableInfo.Indexes { s, err := p.DropIndex(fizz.Table{ Name: tableInfo.Name, Indexes: []fizz.Index{i}, }) if err != nil { return "", err } sql = append(sql, s) if tableInfo.HasColumns(i.Columns...) { newIndexes = append(newIndexes, i) } } tableInfo.Indexes = newIndexes newForeignKeys := []fizz.ForeignKey{} for _, i := range tableInfo.ForeignKeys { if tableInfo.HasColumns(i.Column) { newForeignKeys = append(newForeignKeys, i) } } tableInfo.ForeignKeys = newForeignKeys 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 } func (p *SQLite) RenameColumn(t fizz.Table) (string, error) { if len(t.Columns) < 2 { return "", fmt.Errorf("not enough columns supplied") } oc := t.Columns[0] nc := t.Columns[1] s := fmt.Sprintf("ALTER TABLE \"%s\" RENAME COLUMN \"%s\" TO \"%s\";", t.Name, oc.Name, nc.Name) return s, nil } func (p *SQLite) AddIndex(t fizz.Table) (string, error) { if len(t.Indexes) == 0 { return "", fmt.Errorf("not enough indexes supplied") } i := t.Indexes[0] s := fmt.Sprintf("CREATE INDEX \"%s\" ON \"%s\" (%s);", i.Name, t.Name, strings.Join(i.Columns, ", ")) if i.Unique { s = strings.Replace(s, "CREATE", "CREATE UNIQUE", 1) } tableInfo, err := p.Schema.TableInfo(t.Name) if err != nil { return "", err } tableInfo.Indexes = append(tableInfo.Indexes, i) return s, nil } func (p *SQLite) DropIndex(t fizz.Table) (string, error) { if len(t.Indexes) == 0 { return "", fmt.Errorf("not enough indexes supplied") } i := t.Indexes[0] s := fmt.Sprintf("DROP INDEX IF EXISTS \"%s\";", i.Name) tableInfo, err := p.Schema.TableInfo(t.Name) if err != nil { return "", err } newIndexes := []fizz.Index{} for _, c := range tableInfo.Indexes { if c.Name != i.Name { newIndexes = append(newIndexes, c) } } tableInfo.Indexes = newIndexes return s, nil } func (p *SQLite) RenameIndex(t fizz.Table) (string, error) { if len(t.Indexes) < 2 { return "", fmt.Errorf("not enough indexes supplied") } tableInfo, err := p.Schema.TableInfo(t.Name) if err != nil { return "", err } sql := []string{} oldIndex := t.Indexes[0] newIndex := t.Indexes[1] for _, ti := range tableInfo.Indexes { if ti.Name == oldIndex.Name { ti.Name = newIndex.Name newIndex = ti break } } s, err := p.DropIndex(fizz.Table{ Name: tableInfo.Name, Indexes: []fizz.Index{oldIndex}, }) if err != nil { return "", err } sql = append(sql, s) s, err = p.AddIndex(fizz.Table{ Name: t.Name, Indexes: []fizz.Index{newIndex}, }) if err != nil { return "", err } sql = append(sql, s) return strings.Join(sql, "\n"), nil } func (p *SQLite) AddForeignKey(t fizz.Table) (string, error) { return "", fmt.Errorf("SQLite does not support this feature") } func (p *SQLite) DropForeignKey(t fizz.Table) (string, error) { return "", fmt.Errorf("SQLite does not support this feature") } func (p *SQLite) withTempTable(table string, fn func(fizz.Table) (string, error)) (string, error) { tempTable := fizz.Table{Name: fmt.Sprintf("_%s_tmp", table)} s, err := fn(tempTable) if err != nil { return "", err } sql := []string{ fmt.Sprintf("ALTER TABLE \"%s\" RENAME TO \"%s\";", table, tempTable.Name), } sql = append(sql, s, fmt.Sprintf("DROP TABLE \"%s\";", tempTable.Name)) return strings.Join(sql, "\n"), nil } // withForeignKeyPreservingTempTable create a new temporary table, copies all the contents from the old table over to the new // table, removes the old table, and then renames the temporary table to the original table name. This // preserves foreign key constraint because because SQLite does not drop foreign keys when their reference table // is deleted. It only removes any columns referencing data in the deleted table. [1] // // [1] https://sqlite.org/lang_droptable.html func (p *SQLite) withForeignKeyPreservingTempTable(newTable fizz.Table, tableName string, fn func(newTable fizz.Table, tableName string) (string, error)) (string, error) { var sql []string newTable.Name = fmt.Sprintf("_%s_tmp", tableName) defer func() { newTable.Name = tableName }() createTableSQL, err := p.CreateTable(newTable) if err != nil { return "", err } callbackSQL, err := fn(newTable, tableName) if err != nil { return "", err } return strings.Join(append(sql, createTableSQL, callbackSQL, fmt.Sprintf("DROP TABLE \"%s\";", tableName), fmt.Sprintf("ALTER TABLE \"%s\" RENAME TO \"%s\";", newTable.Name, tableName), ), "\n"), nil } func (p *SQLite) buildColumn(c fizz.Column) string { s := fmt.Sprintf("\"%s\" %s", c.Name, p.colType(c)) if c.Options["null"] == nil { 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 } func (p *SQLite) colType(c fizz.Column) string { switch strings.ToLower(c.ColType) { case "uuid": return "char(36)" case "timestamp", "time", "datetime": return "DATETIME" case "boolean", "date": return "NUMERIC" case "string", "text": return "TEXT" case "int", "integer": return "INTEGER" case "float": // precision and scale not supported here return "REAL" case "json": return "TEXT" case "blob", "[]byte": return "BLOB" default: return c.ColType } } func (p *SQLite) buildForeignKey(t fizz.Table, fk fizz.ForeignKey, onCreate bool) string { refs := fmt.Sprintf("%s (%s)", fk.References.Table, strings.Join(fk.References.Columns, ", ")) s := fmt.Sprintf("FOREIGN KEY (%s) REFERENCES %s", fk.Column, refs) if onUpdate, ok := fk.Options["on_update"]; ok { s += fmt.Sprintf(" ON UPDATE %s", onUpdate) } if onDelete, ok := fk.Options["on_delete"]; ok { s += fmt.Sprintf(" ON DELETE %s", onDelete) } if !onCreate { s = fmt.Sprintf("ALTER TABLE %s ADD CONSTRAINT %s %s", t.Name, fk.Name, s) } return s } ================================================ FILE: translators/sqlite_meta.go ================================================ package translators import ( "database/sql" "fmt" "regexp" "strings" "github.com/gobuffalo/fizz" ) type sqliteIndexListInfo struct { Seq int `db:"seq"` Name string `db:"name"` Unique bool `db:"unique"` Origin string `db:"origin"` Partial string `db:"partial"` } type sqliteForeignKeyListInfo struct { ID int `db:"id"` Seq int `db:"seq"` From string `db:"from"` To string `db:"to"` Table string `db:"table"` OnUpdate string `db:"on_update"` OnDelete string `db:"on_delete"` Match string `db:"match"` } type sqliteIndexInfo struct { Seq int `db:"seqno"` CID int `db:"cid"` Name string `db:"name"` } type sqliteTableInfo struct { CID int `db:"cid"` Name string `db:"name"` Type string `db:"type"` NotNull bool `db:"notnull"` Default interface{} `db:"dflt_value"` PK bool `db:"pk"` } func (t sqliteTableInfo) ToColumn() fizz.Column { c := fizz.Column{ Name: t.Name, ColType: t.Type, Primary: t.PK, Options: fizz.Options{}, } if !t.NotNull { c.Options["null"] = true } if t.Default != nil { c.Options["default"] = strings.TrimSuffix(strings.TrimPrefix(fmt.Sprintf("%s", t.Default), "'"), "'") } return c } type sqliteSchema struct { Schema } func (p *sqliteSchema) Build() error { var err error db, err := sql.Open("sqlite3", p.URL) if err != nil { return err } defer db.Close() res, err := db.Query("SELECT name FROM sqlite_master WHERE type='table';") if err != nil { return err } defer res.Close() for res.Next() { table := &fizz.Table{ Columns: []fizz.Column{}, Indexes: []fizz.Index{}, } err = res.Scan(&table.Name) if err != nil { return err } if table.Name != "sqlite_sequence" { err = p.buildTableData(table, db) if err != nil { return err } } } return nil } func (p *sqliteSchema) buildTableData(table *fizz.Table, db *sql.DB) error { prag := fmt.Sprintf(`SELECT "cid", "name", "type", "notnull", "dflt_value", "pk" FROM pragma_table_info('%s')`, table.Name) res, err := db.Query(prag) if err != nil { return err } defer res.Close() for res.Next() { ti := sqliteTableInfo{} err = res.Scan(&ti.CID, &ti.Name, &ti.Type, &ti.NotNull, &ti.Default, &ti.PK) if err != nil { return err } table.Columns = append(table.Columns, ti.ToColumn()) } err = p.buildTableIndexes(table, db) if err != nil { return err } err = p.buildTableForeignKeyIndexes(table, db) if err != nil { return err } p.schema[table.Name] = table return nil } func (p *sqliteSchema) buildTableIndexes(t *fizz.Table, db *sql.DB) error { // This ignores all internal SQLite keys which are prefixed with `sqlite_` as explained here: // https://www.sqlite.org/fileformat2.html#intschema prag := fmt.Sprintf(`SELECT "seq", "name", "unique", "origin", "partial" FROM pragma_index_list('%s') WHERE "name" NOT LIKE 'sqlite_%%'`, t.Name) res, err := db.Query(prag) if err != nil { return err } defer res.Close() for res.Next() { li := sqliteIndexListInfo{} err = res.Scan(&li.Seq, &li.Name, &li.Unique, &li.Origin, &li.Partial) if err != nil { return err } i := fizz.Index{ Name: li.Name, Unique: li.Unique, Columns: []string{}, } prag = fmt.Sprintf(`SELECT "seqno", "cid", "name" FROM pragma_index_info('%s');`, i.Name) iires, err := db.Query(prag) if err != nil { return err } defer iires.Close() for iires.Next() { ii := sqliteIndexInfo{} err = iires.Scan(&ii.Seq, &ii.CID, &ii.Name) if err != nil { return err } i.Columns = append(i.Columns, ii.Name) } t.Indexes = append(t.Indexes, i) } return nil } var tmpTable = regexp.MustCompile("^_(.*)_tmp$") func canonicalizeSQLiteTable(table string) string { matches := tmpTable.FindAllStringSubmatch(table, 1) if len(matches) == 1 && len(matches[0]) == 2 { return matches[0][1] } return table } func (p *sqliteSchema) buildTableForeignKeyIndexes(t *fizz.Table, db *sql.DB) error { // This ignores all internal SQLite keys which are prefixed with `sqlite_` as explained here: // https://www.sqlite.org/fileformat2.html#intschema prag := fmt.Sprintf(`SELECT "seq", "table", "from", "to", "on_update", "on_delete", "match" FROM pragma_foreign_key_list('%s')`, t.Name) res, err := db.Query(prag) if err != nil { return err } defer res.Close() foreignKeys := []fizz.ForeignKey{} for res.Next() { li := sqliteForeignKeyListInfo{} err = res.Scan(&li.Seq, &li.Table, &li.From, &li.To, &li.OnUpdate, &li.OnDelete, &li.Match) if err != nil { return err } options := map[string]interface{}{} if li.OnDelete != "" { options["on_delete"] = li.OnDelete } if li.OnUpdate != "" { options["on_update"] = li.OnUpdate } i := fizz.ForeignKey{ Column: li.From, References: fizz.ForeignKeyRef{ Table: canonicalizeSQLiteTable(li.Table), Columns: []string{li.To}, }, Options: options, } i.Name = fmt.Sprintf("%s_%s_%s_fk", t.Name, i.References.Table, strings.Join(i.References.Columns, "_")) foreignKeys = append(foreignKeys, i) } t.ForeignKeys = foreignKeys return nil } ================================================ FILE: translators/sqlite_meta_test.go ================================================ package translators import ( "testing" "github.com/stretchr/testify/assert" ) func TestCanonicalizeSQLiteTable(t *testing.T) { assert.Equal(t, "e2e_users", canonicalizeSQLiteTable("_e2e_users_tmp")) assert.Equal(t, "e2e_users_tmp", canonicalizeSQLiteTable("_e2e_users_tmp_tmp")) assert.Equal(t, "e2e_users_tmp", canonicalizeSQLiteTable("e2e_users_tmp")) assert.Equal(t, "_e2e_users_tm", canonicalizeSQLiteTable("_e2e_users_tm")) assert.Equal(t, "_e2e_users_tmp_", canonicalizeSQLiteTable("_e2e_users_tmp_")) } ================================================ FILE: translators/sqlite_test.go ================================================ package translators_test import ( "fmt" "github.com/gobuffalo/fizz" "github.com/gobuffalo/fizz/translators" ) var IntIDCol = fizz.Column{ Name: "id", Primary: true, ColType: "integer", Options: fizz.Options{}, } var _ fizz.Translator = (*translators.SQLite)(nil) var schema = &fauxSchema{schema: map[string]*fizz.Table{}} var sqt = &translators.SQLite{Schema: schema} type fauxSchema struct { schema map[string]*fizz.Table } func (s *fauxSchema) Build() error { return nil } func (s *fauxSchema) IndexInfo(table string, column string) (*fizz.Index, error) { return nil, fmt.Errorf("IndexInfo is not implemented for this translator!") } func (s *fauxSchema) ReplaceSchema(schema map[string]*fizz.Table) { s.schema = schema } func (s *fauxSchema) DeleteColumn(table string, column string) { return } func (s *fauxSchema) ReplaceColumn(table string, column string, newColumn fizz.Column) error { return fmt.Errorf("ReplaceColumn is not implemented for this translator!") } func (s *fauxSchema) ColumnInfo(table string, column string) (*fizz.Column, error) { return nil, fmt.Errorf("ColumnInfo is not implemented for this translator!") } 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) TableInfo(table string) (*fizz.Table, error) { if ti, ok := p.schema[table]; ok { return ti, nil } return nil, fmt.Errorf("Could not find table data for %s!", table) } func (p *SQLiteSuite) Test_SQLite_CreateTable() { r := p.Require() ddl := `CREATE TABLE "users" ( "id" INTEGER PRIMARY KEY AUTOINCREMENT, "first_name" TEXT NOT NULL, "last_name" TEXT NOT NULL, "email" TEXT NOT NULL, "permissions" TEXT, "age" INTEGER DEFAULT '40', "raw" BLOB NOT NULL, "into" INTEGER NOT NULL, "flotante" REAL NOT NULL, "json" TEXT NOT NULL, "bytes" BLOB NOT NULL, "created_at" DATETIME NOT NULL, "updated_at" DATETIME NOT NULL );` res, _ := fizz.AString(` create_table("users") { t.Column("id", "integer", {"primary": true}) t.Column("first_name", "string", {}) t.Column("last_name", "string", {}) t.Column("email", "string", {"size":20}) t.Column("permissions", "text", {"null": true}) t.Column("age", "integer", {"null": true, "default": 40}) t.Column("raw", "blob", {}) t.Column("into", "int", {}) t.Column("flotante", "float", {}) t.Column("json", "json", {}) t.Column("bytes", "[]byte", {}) } `, sqt) r.Equal(ddl, res) } func (p *SQLiteSuite) Test_SQLite_CreateTable_UUID() { r := p.Require() ddl := `CREATE TABLE "users" ( "first_name" TEXT NOT NULL, "last_name" TEXT NOT NULL, "email" TEXT NOT NULL, "permissions" TEXT, "age" INTEGER DEFAULT '40', "company_id" char(36) NOT NULL DEFAULT lower(hex(randomblob(16))), "uuid" TEXT PRIMARY KEY, "created_at" DATETIME NOT NULL, "updated_at" DATETIME NOT NULL );` res, _ := fizz.AString(` create_table("users") { t.Column("first_name", "string", {}) t.Column("last_name", "string", {}) t.Column("email", "string", {"size":20}) t.Column("permissions", "text", {"null": true}) t.Column("age", "integer", {"null": true, "default": 40}) t.Column("company_id", "uuid", {"default_raw": "lower(hex(randomblob(16)))"}) t.Column("uuid", "uuid", {"primary": true}) } `, sqt) r.Equal(ddl, res) } func (p *SQLiteSuite) Test_SQLite_CreateTables_WithCompositePrimaryKey() { r := p.Require() ddl := `CREATE TABLE "user_profiles" ( "user_id" INTEGER NOT NULL, "profile_id" INTEGER NOT NULL, "created_at" DATETIME NOT NULL, "updated_at" DATETIME NOT NULL, PRIMARY KEY("user_id", "profile_id") );` res, _ := fizz.AString(` create_table("user_profiles") { t.Column("user_id", "INT") t.Column("profile_id", "INT") t.PrimaryKey("user_id", "profile_id") } `, sqt) r.Equal(ddl, res) } func (p *SQLiteSuite) Test_SQLite_DropTable() { r := p.Require() ddl := `DROP TABLE "users";` res, _ := fizz.AString(`drop_table("users")`, sqt) r.Equal(ddl, res) } func (p *SQLiteSuite) Test_SQLite_RenameTable() { r := p.Require() ddl := `ALTER TABLE "users" RENAME TO "people";` schema.schema["users"] = &fizz.Table{} res, _ := fizz.AString(`rename_table("users", "people")`, sqt) r.Equal(ddl, res) } func (p *SQLiteSuite) Test_SQLite_RenameTable_NotEnoughValues() { r := p.Require() _, err := sqt.RenameTable([]fizz.Table{}) r.Error(err) } func (p *SQLiteSuite) Test_SQLite_ChangeColumn() { r := p.Require() ddl := `CREATE TABLE "_users_tmp" ( "id" INTEGER PRIMARY KEY AUTOINCREMENT, "created_at" TEXT NOT NULL DEFAULT 'foo', "updated_at" DATETIME NOT NULL ); INSERT INTO "_users_tmp" (id, created_at, updated_at) SELECT id, created_at, updated_at FROM "users"; DROP TABLE "users"; ALTER TABLE "_users_tmp" RENAME TO "users";` schema.schema["users"] = &fizz.Table{ Name: "users", Columns: []fizz.Column{ IntIDCol, fizz.CREATED_COL, fizz.UPDATED_COL, }, } res, _ := fizz.AString(`change_column("users", "created_at", "string", {"default": "foo", "size": 50})`, sqt) r.Equal(ddl, res) } func (p *SQLiteSuite) Test_SQLite_AddColumn() { r := p.Require() ddl := `ALTER TABLE "users" ADD COLUMN "mycolumn" TEXT NOT NULL DEFAULT 'foo';` schema.schema["users"] = &fizz.Table{} res, _ := fizz.AString(`add_column("users", "mycolumn", "string", {"default": "foo", "size": 50})`, sqt) r.Equal(ddl, res) } func (p *SQLiteSuite) Test_SQLite_DropColumn() { r := p.Require() 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", Columns: []fizz.Column{ IntIDCol, fizz.CREATED_COL, fizz.UPDATED_COL, }, } res, _ := fizz.AString(`drop_column("users", "created_at")`, sqt) r.Equal(ddl, res) } func (p *SQLiteSuite) Test_SQLite_RenameColumn() { r := p.Require() ddl := `ALTER TABLE "users" RENAME COLUMN "created_at" TO "created_when";` schema.schema["users"] = &fizz.Table{ Name: "users", Columns: []fizz.Column{ IntIDCol, fizz.CREATED_COL, fizz.UPDATED_COL, }, } res, _ := fizz.AString(`rename_column("users", "created_at", "created_when")`, sqt) r.Equal(ddl, res) } func (p *SQLiteSuite) Test_SQLite_AddIndex() { r := p.Require() schema.schema["table_name"] = &fizz.Table{ Name: "table_name", Columns: []fizz.Column{ { Name: "column_name", }, }, } ddl := `CREATE INDEX "table_name_column_name_idx" ON "table_name" (column_name);` res, _ := fizz.AString(`add_index("table_name", "column_name", {})`, sqt) r.Equal(ddl, res) } func (p *SQLiteSuite) Test_SQLite_AddIndex_Unique() { r := p.Require() ddl := `CREATE UNIQUE INDEX "table_name_column_name_idx" ON "table_name" (column_name);` res, _ := fizz.AString(`add_index("table_name", "column_name", {"unique": true})`, sqt) r.Equal(ddl, res) } func (p *SQLiteSuite) Test_SQLite_AddIndex_MultiColumn() { r := p.Require() ddl := `CREATE INDEX "table_name_col1_col2_col3_idx" ON "table_name" (col1, col2, col3);` res, _ := fizz.AString(`add_index("table_name", ["col1", "col2", "col3"], {})`, sqt) r.Equal(ddl, res) } func (p *SQLiteSuite) Test_SQLite_AddIndex_CustomName() { r := p.Require() ddl := `CREATE INDEX "custom_name" ON "table_name" (column_name);` res, _ := fizz.AString(`add_index("table_name", "column_name", {"name": "custom_name"})`, sqt) r.Equal(ddl, res) } func (p *SQLiteSuite) Test_SQLite_DropIndex() { r := p.Require() schema.schema["my_table"] = &fizz.Table{ Name: "my_table", Indexes: []fizz.Index{ { Name: "my_idx", }, }, } ddl := `DROP INDEX IF EXISTS "my_idx";` res, _ := fizz.AString(`drop_index("my_table", "my_idx")`, sqt) r.Equal(ddl, res) } func (p *SQLiteSuite) Test_SQLite_RenameIndex() { r := p.Require() ddl := `DROP INDEX IF EXISTS "old_ix"; CREATE UNIQUE INDEX "new_ix" ON "users" (id, created_at);` schema.schema["users"] = &fizz.Table{ Name: "users", Columns: []fizz.Column{ IntIDCol, fizz.CREATED_COL, fizz.UPDATED_COL, }, Indexes: []fizz.Index{ { Name: "old_ix", Columns: []string{"id", "created_at"}, Unique: true, }, }, } res, _ := fizz.AString(`rename_index("users", "old_ix", "new_ix")`, sqt) r.Equal(ddl, res) } func (p *SQLiteSuite) Test_SQLite_DropColumnWithForeignKey() { r := p.Require() res, _ := fizz.AString(` create_table("users") { t.Column("uuid", "uuid", {"primary": true}) } create_table("user_notes") { t.Column("uuid", "uuid", {"primary": true}) t.Column("user_id", "uuid") t.Column("notes", "string") t.ForeignKey("user_id", {"users": ["uuid"]}, {"on_delete": "cascade"}) }`, sqt) r.Equal(`CREATE TABLE "users" ( "uuid" TEXT PRIMARY KEY, "created_at" DATETIME NOT NULL, "updated_at" DATETIME NOT NULL ); CREATE TABLE "user_notes" ( "uuid" TEXT PRIMARY KEY, "user_id" char(36) NOT NULL, "notes" TEXT NOT NULL, "created_at" DATETIME NOT NULL, "updated_at" DATETIME NOT NULL, FOREIGN KEY (user_id) REFERENCES users (uuid) ON DELETE cascade );`, res) res, _ = fizz.AString(`drop_column("user_notes","notes")`, sqt) 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) res, _ = fizz.AString(`add_column("user_notes","notes","string")`, sqt) r.Equal(`ALTER TABLE "user_notes" ADD COLUMN "notes" TEXT NOT NULL;`, res) } ================================================ FILE: translators/translators_test.go ================================================ package translators_test import ( "os" "testing" "github.com/stretchr/testify/suite" ) type CockroachSuite struct { suite.Suite } type PostgreSQLSuite struct { suite.Suite } type MySQLSuite struct { suite.Suite } type MariaDBSuite struct { suite.Suite } type MsSqlServerSQLSuite struct { suite.Suite } type SQLiteSuite struct { suite.Suite } type SchemaSuite struct { suite.Suite } func TestSpecificSuites(t *testing.T) { switch os.Getenv("SODA_DIALECT") { case "postgres": suite.Run(t, &PostgreSQLSuite{}) case "cockroach": suite.Run(t, &CockroachSuite{}) case "mysql", "mysql_travis": suite.Run(t, &MySQLSuite{}) case "mariadb": suite.Run(t, &MariaDBSuite{}) case "sqlserver": suite.Run(t, &MsSqlServerSQLSuite{}) case "sqlite": suite.Run(t, &SQLiteSuite{}) } suite.Run(t, &SchemaSuite{}) } func getEnv(key, defaultValue string) string { if v, found := os.LookupEnv(key); found { return v } return defaultValue } ================================================ FILE: version.go ================================================ package fizz // Version gives the current fizz version. const Version = "v1.14.3"