diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9ed29e79a..fba80faa2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,7 @@ jobs: fail-fast: false matrix: node-version: [10, 18, 20] - postgres-version: [oldest, latest] + postgres-version: [oldest-v6, oldest-v7, latest] minify-aliases: [true, false] native: [true, false] name: postgres ${{ matrix.postgres-version }}${{ matrix.native && ' (native)' || '' }} (Node ${{ matrix.node-version }})${{ matrix.minify-aliases && ' (minified aliases)' || '' }} @@ -55,7 +55,7 @@ jobs: fail-fast: false matrix: node-version: [10, 18, 20] - database-version: [oldest, latest] + database-version: [oldest-v6, oldest-v7, latest] dialect: [mysql, mariadb, mssql] name: ${{ matrix.dialect }} ${{ matrix.database-version }} (Node ${{ matrix.node-version }}) runs-on: ubuntu-latest diff --git a/dev/mariadb/oldest-v6/docker-compose.yml b/dev/mariadb/oldest-v6/docker-compose.yml new file mode 100644 index 000000000..fea1217c4 --- /dev/null +++ b/dev/mariadb/oldest-v6/docker-compose.yml @@ -0,0 +1,26 @@ +services: + mariadb-oldest-v6: + container_name: sequelize-mariadb-oldest-v6 + image: mariadb:10.3 + environment: + MYSQL_DATABASE: sequelize_test + MYSQL_USER: sequelize_test + MYSQL_PASSWORD: sequelize_test + MYSQL_ROOT_PASSWORD: sequelize_test + ports: + - 21103:3306 + volumes: + - mariadb-oldest-v6:/var/lib/mysql + healthcheck: + test: ["CMD", "mariadb-admin", "-usequelize_test", "-psequelize_test", "status"] + interval: 3s + timeout: 1s + retries: 10 + +networks: + default: + name: sequelize-mariadb-oldest-v6-network + +volumes: + mariadb-oldest-v6: + name: sequelize-mariadb-oldest-v6-volume diff --git a/dev/mariadb/oldest-v6/reset.sh b/dev/mariadb/oldest-v6/reset.sh new file mode 100644 index 000000000..632e3a68a --- /dev/null +++ b/dev/mariadb/oldest-v6/reset.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -Eeuxo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ +cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" # https://stackoverflow.com/a/17744637 + +docker compose -p sequelize-mariadb-oldest-v6 down --remove-orphans --volumes diff --git a/dev/mariadb/oldest/start.sh b/dev/mariadb/oldest-v6/start.sh similarity index 64% rename from dev/mariadb/oldest/start.sh rename to dev/mariadb/oldest-v6/start.sh index 15b51b796..2836d3145 100644 --- a/dev/mariadb/oldest/start.sh +++ b/dev/mariadb/oldest-v6/start.sh @@ -2,12 +2,12 @@ set -Eeuxo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" # https://stackoverflow.com/a/17744637 -docker compose -p sequelize-mariadb-oldest down --remove-orphans -docker compose -p sequelize-mariadb-oldest up -d +docker compose -p sequelize-mariadb-oldest-v6 down --remove-orphans +docker compose -p sequelize-mariadb-oldest-v6 up -d -./../../wait-until-healthy.sh sequelize-mariadb-oldest +./../../wait-until-healthy.sh sequelize-mariadb-oldest-v6 -docker exec sequelize-mariadb-oldest \ +docker exec sequelize-mariadb-oldest-v6 \ mariadb --host 127.0.0.1 --port 3306 -uroot -psequelize_test -e "GRANT ALL ON *.* TO 'sequelize_test'@'%' with grant option; FLUSH PRIVILEGES;" DIALECT=mariadb ts-node ../../check-connection.ts diff --git a/dev/mariadb/oldest/stop.sh b/dev/mariadb/oldest-v6/stop.sh similarity index 80% rename from dev/mariadb/oldest/stop.sh rename to dev/mariadb/oldest-v6/stop.sh index bc4665a50..8a8ebda0d 100644 --- a/dev/mariadb/oldest/stop.sh +++ b/dev/mariadb/oldest-v6/stop.sh @@ -2,6 +2,6 @@ set -Eeuxo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" # https://stackoverflow.com/a/17744637 -docker compose -p sequelize-mariadb-oldest down --remove-orphans +docker compose -p sequelize-mariadb-oldest-v6 down --remove-orphans echo "Local oldest supported MariaDB instance stopped (if it was running)." diff --git a/dev/mariadb/oldest/docker-compose.yml b/dev/mariadb/oldest-v7/docker-compose.yml similarity index 66% rename from dev/mariadb/oldest/docker-compose.yml rename to dev/mariadb/oldest-v7/docker-compose.yml index 78a46ffcc..59b06d900 100644 --- a/dev/mariadb/oldest/docker-compose.yml +++ b/dev/mariadb/oldest-v7/docker-compose.yml @@ -1,6 +1,6 @@ services: - mariadb-oldest: - container_name: sequelize-mariadb-oldest + mariadb-oldest-v7: + container_name: sequelize-mariadb-oldest-v7 image: mariadb:10.4.30 environment: MYSQL_DATABASE: sequelize_test @@ -10,7 +10,7 @@ services: ports: - 21103:3306 volumes: - - mariadb-oldest:/var/lib/mysql + - mariadb-oldest-v7:/var/lib/mysql healthcheck: test: ["CMD", "mariadb-admin", "-usequelize_test", "-psequelize_test", "status"] interval: 3s @@ -19,8 +19,8 @@ services: networks: default: - name: sequelize-mariadb-oldest-network + name: sequelize-mariadb-oldest-v7-network volumes: - mariadb-oldest: - name: sequelize-mariadb-oldest-volume + mariadb-oldest-v7: + name: sequelize-mariadb-oldest-v7-volume diff --git a/dev/mariadb/oldest-v7/reset.sh b/dev/mariadb/oldest-v7/reset.sh new file mode 100644 index 000000000..b1c7e4ac3 --- /dev/null +++ b/dev/mariadb/oldest-v7/reset.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -Eeuxo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ +cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" # https://stackoverflow.com/a/17744637 + +docker compose -p sequelize-mariadb-oldest-v7 down --remove-orphans --volumes diff --git a/dev/mariadb/oldest-v7/start.sh b/dev/mariadb/oldest-v7/start.sh new file mode 100644 index 000000000..0f10cfa67 --- /dev/null +++ b/dev/mariadb/oldest-v7/start.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +set -Eeuxo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ +cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" # https://stackoverflow.com/a/17744637 + +docker compose -p sequelize-mariadb-oldest-v7 down --remove-orphans +docker compose -p sequelize-mariadb-oldest-v7 up -d + +./../../wait-until-healthy.sh sequelize-mariadb-oldest-v7 + +docker exec sequelize-mariadb-oldest-v7 \ + mariadb --host 127.0.0.1 --port 3306 -uroot -psequelize_test -e "GRANT ALL ON *.* TO 'sequelize_test'@'%' with grant option; FLUSH PRIVILEGES;" + +DIALECT=mariadb ts-node ../../check-connection.ts diff --git a/dev/mariadb/oldest-v7/stop.sh b/dev/mariadb/oldest-v7/stop.sh new file mode 100644 index 000000000..aa22e4c8e --- /dev/null +++ b/dev/mariadb/oldest-v7/stop.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +set -Eeuxo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ +cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" # https://stackoverflow.com/a/17744637 + +docker compose -p sequelize-mariadb-oldest-v7 down --remove-orphans + +echo "Local oldest supported MariaDB instance stopped (if it was running)." diff --git a/dev/mssql/oldest-v6/docker-compose.yml b/dev/mssql/oldest-v6/docker-compose.yml new file mode 100644 index 000000000..8addd67e6 --- /dev/null +++ b/dev/mssql/oldest-v6/docker-compose.yml @@ -0,0 +1,26 @@ +services: + mssql-oldest-v6: + container_name: sequelize-mssql-oldest-v6 + # SQL Server 2014 does not have an image + image: mcr.microsoft.com/mssql/server:2017-latest + environment: + ACCEPT_EULA: Y + MSSQL_PID: Developer + MSSQL_SA_PASSWORD: Password12! + ports: + - 22019:1433 + volumes: + - mssql-oldest-v6:/var/opt/mssql + healthcheck: + test: ["CMD", "/opt/mssql-tools/bin/sqlcmd", "-S", "localhost", "-U", "SA", "-P", "Password12!", "-l", "30", "-Q", "SELECT 1"] + interval: 3s + timeout: 1s + retries: 10 + +networks: + default: + name: sequelize-mssql-oldest-v6-network + +volumes: + mssql-oldest-v6: + name: sequelize-mssql-oldest-v6-volume diff --git a/dev/postgres/oldest/reset.sh b/dev/mssql/oldest-v6/reset.sh similarity index 76% rename from dev/postgres/oldest/reset.sh rename to dev/mssql/oldest-v6/reset.sh index ddbad00c3..bed0eaf35 100644 --- a/dev/postgres/oldest/reset.sh +++ b/dev/mssql/oldest-v6/reset.sh @@ -2,4 +2,4 @@ set -Eeuxo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" # https://stackoverflow.com/a/17744637 -docker compose -p sequelize-postgres-oldest down --remove-orphans --volumes +docker compose -p sequelize-mssql-oldest-v6 down --remove-orphans --volumes diff --git a/dev/mssql/oldest/start.sh b/dev/mssql/oldest-v6/start.sh similarity index 66% rename from dev/mssql/oldest/start.sh rename to dev/mssql/oldest-v6/start.sh index eef74ca6e..b52420e24 100644 --- a/dev/mssql/oldest/start.sh +++ b/dev/mssql/oldest-v6/start.sh @@ -2,12 +2,12 @@ set -Eeuxo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" # https://stackoverflow.com/a/17744637 -docker compose -p sequelize-mssql-oldest down --remove-orphans -docker compose -p sequelize-mssql-oldest up -d +docker compose -p sequelize-mssql-oldest-v6 down --remove-orphans +docker compose -p sequelize-mssql-oldest-v6 up -d -./../../wait-until-healthy.sh sequelize-mssql-oldest +./../../wait-until-healthy.sh sequelize-mssql-oldest-v6 -docker exec sequelize-mssql-oldest \ +docker exec sequelize-mssql-oldest-v6 \ /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P "Password12!" -Q "CREATE DATABASE sequelize_test; ALTER DATABASE sequelize_test SET READ_COMMITTED_SNAPSHOT ON;" DIALECT=mssql ts-node ../../check-connection.ts diff --git a/dev/mssql/oldest-v6/stop.sh b/dev/mssql/oldest-v6/stop.sh new file mode 100644 index 000000000..aa6e80cde --- /dev/null +++ b/dev/mssql/oldest-v6/stop.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +set -Eeuxo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ +cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" # https://stackoverflow.com/a/17744637 + +docker compose -p sequelize-mssql-oldest-v6 down --remove-orphans + +echo "Local oldest-v6 supported MSSQL instance stopped (if it was running)." diff --git a/dev/mssql/oldest/docker-compose.yml b/dev/mssql/oldest-v7/docker-compose.yml similarity index 67% rename from dev/mssql/oldest/docker-compose.yml rename to dev/mssql/oldest-v7/docker-compose.yml index aa0374f27..e23eb5ead 100644 --- a/dev/mssql/oldest/docker-compose.yml +++ b/dev/mssql/oldest-v7/docker-compose.yml @@ -1,6 +1,6 @@ services: - mssql-oldest: - container_name: sequelize-mssql-oldest + mssql-oldest-v7: + container_name: sequelize-mssql-oldest-v7 image: mcr.microsoft.com/mssql/server:2017-latest environment: ACCEPT_EULA: Y @@ -9,7 +9,7 @@ services: ports: - 22019:1433 volumes: - - mssql-oldest:/var/opt/mssql + - mssql-oldest-v7:/var/opt/mssql healthcheck: test: ["CMD", "/opt/mssql-tools/bin/sqlcmd", "-S", "localhost", "-U", "SA", "-P", "Password12!", "-l", "30", "-Q", "SELECT 1"] interval: 3s @@ -18,8 +18,8 @@ services: networks: default: - name: sequelize-mssql-oldest-network + name: sequelize-mssql-oldest-v7-network volumes: - mssql-oldest: - name: sequelize-mssql-oldest-volume + mssql-oldest-v7: + name: sequelize-mssql-oldest-v7-volume diff --git a/dev/mssql/oldest/reset.sh b/dev/mssql/oldest-v7/reset.sh similarity index 72% rename from dev/mssql/oldest/reset.sh rename to dev/mssql/oldest-v7/reset.sh index 6b4eb1f27..05d8042d8 100644 --- a/dev/mssql/oldest/reset.sh +++ b/dev/mssql/oldest-v7/reset.sh @@ -2,4 +2,4 @@ set -Eeuxo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" # https://stackoverflow.com/a/17744637 -docker compose -p sequelize-mssql-oldest down --remove-orphans --volumes +docker compose -p sequelize-mssql-oldest-v7 down --remove-orphans --volumes diff --git a/dev/mssql/oldest-v7/start.sh b/dev/mssql/oldest-v7/start.sh new file mode 100644 index 000000000..fcedb6766 --- /dev/null +++ b/dev/mssql/oldest-v7/start.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +set -Eeuxo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ +cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" # https://stackoverflow.com/a/17744637 + +docker compose -p sequelize-mssql-oldest-v7 down --remove-orphans +docker compose -p sequelize-mssql-oldest-v7 up -d + +./../../wait-until-healthy.sh sequelize-mssql-oldest-v7 + +docker exec sequelize-mssql-oldest-v7 \ + /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P "Password12!" -Q "CREATE DATABASE sequelize_test; ALTER DATABASE sequelize_test SET READ_COMMITTED_SNAPSHOT ON;" + +DIALECT=mssql ts-node ../../check-connection.ts diff --git a/dev/mssql/oldest/stop.sh b/dev/mssql/oldest-v7/stop.sh similarity index 80% rename from dev/mssql/oldest/stop.sh rename to dev/mssql/oldest-v7/stop.sh index defffb6e6..11c2fe718 100644 --- a/dev/mssql/oldest/stop.sh +++ b/dev/mssql/oldest-v7/stop.sh @@ -2,6 +2,6 @@ set -Eeuxo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" # https://stackoverflow.com/a/17744637 -docker compose -p sequelize-mssql-oldest down --remove-orphans +docker compose -p sequelize-mssql-oldest-v7 down --remove-orphans echo "Local oldest supported MSSQL instance stopped (if it was running)." diff --git a/dev/mysql/oldest-v6/docker-compose.yml b/dev/mysql/oldest-v6/docker-compose.yml new file mode 100644 index 000000000..84e3ed692 --- /dev/null +++ b/dev/mysql/oldest-v6/docker-compose.yml @@ -0,0 +1,26 @@ +services: + mysql-oldest-v6: + container_name: sequelize-mysql-oldest-v6 + image: mysql:5.7 + environment: + MYSQL_DATABASE: sequelize_test + MYSQL_USER: sequelize_test + MYSQL_PASSWORD: sequelize_test + MYSQL_ROOT_PASSWORD: sequelize_test + ports: + - 20057:3306 + volumes: + - mysql-oldest-v6:/var/lib/mysql + healthcheck: + test: ["CMD", "mysqladmin", "-usequelize_test", "-psequelize_test", "status"] + interval: 3s + timeout: 1s + retries: 10 + +networks: + default: + name: sequelize-mysql-oldest-v6-network + +volumes: + mysql-oldest-v6: + name: sequelize-mysql-oldest-v6-volume diff --git a/dev/mariadb/oldest/reset.sh b/dev/mysql/oldest-v6/reset.sh similarity index 72% rename from dev/mariadb/oldest/reset.sh rename to dev/mysql/oldest-v6/reset.sh index a83919aa3..ac633de06 100644 --- a/dev/mariadb/oldest/reset.sh +++ b/dev/mysql/oldest-v6/reset.sh @@ -2,4 +2,4 @@ set -Eeuxo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" # https://stackoverflow.com/a/17744637 -docker compose -p sequelize-mariadb-oldest down --remove-orphans --volumes +docker compose -p sequelize-mysql-oldest-v6 down --remove-orphans --volumes diff --git a/dev/mysql/oldest/start.sh b/dev/mysql/oldest-v6/start.sh similarity index 64% rename from dev/mysql/oldest/start.sh rename to dev/mysql/oldest-v6/start.sh index 2bdf0b068..f4b19bcbf 100644 --- a/dev/mysql/oldest/start.sh +++ b/dev/mysql/oldest-v6/start.sh @@ -2,12 +2,12 @@ set -Eeuxo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" # https://stackoverflow.com/a/17744637 -docker compose -p sequelize-mysql-oldest down --remove-orphans -docker compose -p sequelize-mysql-oldest up -d +docker compose -p sequelize-mysql-oldest-v6 down --remove-orphans +docker compose -p sequelize-mysql-oldest-v6 up -d -./../../wait-until-healthy.sh sequelize-mysql-oldest +./../../wait-until-healthy.sh sequelize-mysql-oldest-v6 -docker exec sequelize-mysql-oldest \ +docker exec sequelize-mysql-oldest-v6 \ mysql --host 127.0.0.1 --port 3306 -uroot -psequelize_test -e "GRANT ALL ON *.* TO 'sequelize_test'@'%' with grant option; FLUSH PRIVILEGES;" DIALECT=mysql ts-node ../../check-connection.ts diff --git a/dev/mysql/oldest/stop.sh b/dev/mysql/oldest-v6/stop.sh similarity index 80% rename from dev/mysql/oldest/stop.sh rename to dev/mysql/oldest-v6/stop.sh index 7130d700c..c1c01726f 100644 --- a/dev/mysql/oldest/stop.sh +++ b/dev/mysql/oldest-v6/stop.sh @@ -2,6 +2,6 @@ set -Eeuxo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" # https://stackoverflow.com/a/17744637 -docker compose -p sequelize-mysql-oldest down --remove-orphans +docker compose -p sequelize-mysql-oldest-v6 down --remove-orphans echo "Local oldest supported MySQL instance stopped (if it was running)." diff --git a/dev/mysql/oldest/docker-compose.yml b/dev/mysql/oldest-v7/docker-compose.yml similarity index 67% rename from dev/mysql/oldest/docker-compose.yml rename to dev/mysql/oldest-v7/docker-compose.yml index 87509d9c9..071c51f71 100644 --- a/dev/mysql/oldest/docker-compose.yml +++ b/dev/mysql/oldest-v7/docker-compose.yml @@ -1,6 +1,6 @@ services: - mysql-oldest: - container_name: sequelize-mysql-oldest + mysql-oldest-v7: + container_name: sequelize-mysql-oldest-v7 image: mysql:8.0.19 environment: MYSQL_DATABASE: sequelize_test @@ -10,7 +10,7 @@ services: ports: - 20057:3306 volumes: - - mysql-oldest:/var/lib/mysql + - mysql-oldest-v7:/var/lib/mysql healthcheck: test: ["CMD", "mysqladmin", "-usequelize_test", "-psequelize_test", "status"] interval: 3s @@ -19,8 +19,8 @@ services: networks: default: - name: sequelize-mysql-oldest-network + name: sequelize-mysql-oldest-v7-network volumes: - mysql-oldest: - name: sequelize-mysql-oldest-volume + mysql-oldest-v7: + name: sequelize-mysql-oldest-v7-volume diff --git a/dev/mysql/oldest/reset.sh b/dev/mysql/oldest-v7/reset.sh similarity index 72% rename from dev/mysql/oldest/reset.sh rename to dev/mysql/oldest-v7/reset.sh index 7007b4d4b..41bb8bf76 100644 --- a/dev/mysql/oldest/reset.sh +++ b/dev/mysql/oldest-v7/reset.sh @@ -2,4 +2,4 @@ set -Eeuxo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" # https://stackoverflow.com/a/17744637 -docker compose -p sequelize-mysql-oldest down --remove-orphans --volumes +docker compose -p sequelize-mysql-oldest-v7 down --remove-orphans --volumes diff --git a/dev/mysql/oldest-v7/start.sh b/dev/mysql/oldest-v7/start.sh new file mode 100644 index 000000000..07da8f230 --- /dev/null +++ b/dev/mysql/oldest-v7/start.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +set -Eeuxo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ +cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" # https://stackoverflow.com/a/17744637 + +docker compose -p sequelize-mysql-oldest-v7 down --remove-orphans +docker compose -p sequelize-mysql-oldest-v7 up -d + +./../../wait-until-healthy.sh sequelize-mysql-oldest-v7 + +docker exec sequelize-mysql-oldest-v7 \ + mysql --host 127.0.0.1 --port 3306 -uroot -psequelize_test -e "GRANT ALL ON *.* TO 'sequelize_test'@'%' with grant option; FLUSH PRIVILEGES;" + +DIALECT=mysql ts-node ../../check-connection.ts diff --git a/dev/mysql/oldest-v7/stop.sh b/dev/mysql/oldest-v7/stop.sh new file mode 100644 index 000000000..fd8175d15 --- /dev/null +++ b/dev/mysql/oldest-v7/stop.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +set -Eeuxo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ +cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" # https://stackoverflow.com/a/17744637 + +docker compose -p sequelize-mysql-oldest-v7 down --remove-orphans + +echo "Local oldest supported MySQL instance stopped (if it was running)." diff --git a/dev/postgres/oldest-v6/docker-compose.yml b/dev/postgres/oldest-v6/docker-compose.yml new file mode 100644 index 000000000..30963f620 --- /dev/null +++ b/dev/postgres/oldest-v6/docker-compose.yml @@ -0,0 +1,25 @@ +services: + postgres-oldest-v6: + container_name: sequelize-postgres-oldest-v6 + image: postgis/postgis:9.5-2.5 + environment: + POSTGRES_USER: sequelize_test + POSTGRES_PASSWORD: sequelize_test + POSTGRES_DB: sequelize_test + ports: + - 23010:5432 + volumes: + - postgres-oldest-v6:/var/lib/postgresql/data + healthcheck: + test: ["CMD", "pg_isready", "-U", "sequelize_test"] + interval: 3s + timeout: 1s + retries: 10 + +networks: + default: + name: sequelize-postgres-oldest-v6-network + +volumes: + postgres-oldest-v6: + name: sequelize-postgres-oldest-v6-volume diff --git a/dev/postgres/oldest-v6/reset.sh b/dev/postgres/oldest-v6/reset.sh new file mode 100644 index 000000000..edafa46b1 --- /dev/null +++ b/dev/postgres/oldest-v6/reset.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -Eeuxo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ +cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" # https://stackoverflow.com/a/17744637 + +docker compose -p sequelize-postgres-oldest-v6 down --remove-orphans --volumes diff --git a/dev/postgres/oldest/start.sh b/dev/postgres/oldest-v6/start.sh similarity index 68% rename from dev/postgres/oldest/start.sh rename to dev/postgres/oldest-v6/start.sh index 30ce010b7..e57baf3ac 100644 --- a/dev/postgres/oldest/start.sh +++ b/dev/postgres/oldest-v6/start.sh @@ -2,12 +2,12 @@ set -Eeuxo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" # https://stackoverflow.com/a/17744637 -docker compose -p sequelize-postgres-oldest down --remove-orphans -docker compose -p sequelize-postgres-oldest up -d +docker compose -p sequelize-postgres-oldest-v6 down --remove-orphans +docker compose -p sequelize-postgres-oldest-v6 up -d -./../../wait-until-healthy.sh sequelize-postgres-oldest +./../../wait-until-healthy.sh sequelize-postgres-oldest-v6 DIALECT=postgres ts-node ../../check-connection.ts -docker exec sequelize-postgres-oldest \ +docker exec sequelize-postgres-oldest-v6 \ bash -c "export PGPASSWORD=sequelize_test && psql -h localhost -p 5432 -U sequelize_test sequelize_test -c 'CREATE EXTENSION IF NOT EXISTS btree_gist; CREATE EXTENSION IF NOT EXISTS hstore; CREATE EXTENSION IF NOT EXISTS citext;'" diff --git a/dev/postgres/oldest-v6/stop.sh b/dev/postgres/oldest-v6/stop.sh new file mode 100644 index 000000000..791f8a393 --- /dev/null +++ b/dev/postgres/oldest-v6/stop.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +set -Eeuxo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ +cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" # https://stackoverflow.com/a/17744637 + +docker compose -p sequelize-postgres-oldest-v6 down --remove-orphans + +echo "Local oldest supported Postgres instance with postgis stopped (if it was running)." diff --git a/dev/postgres/oldest/docker-compose.yml b/dev/postgres/oldest-v7/docker-compose.yml similarity index 61% rename from dev/postgres/oldest/docker-compose.yml rename to dev/postgres/oldest-v7/docker-compose.yml index 05e77e423..025610d98 100644 --- a/dev/postgres/oldest/docker-compose.yml +++ b/dev/postgres/oldest-v7/docker-compose.yml @@ -1,6 +1,6 @@ services: - postgres-oldest: - container_name: sequelize-postgres-oldest + postgres-oldest-v7: + container_name: sequelize-postgres-oldest-v7 image: postgis/postgis:11-2.5 environment: POSTGRES_USER: sequelize_test @@ -9,7 +9,7 @@ services: ports: - 23010:5432 volumes: - - postgres-oldest:/var/lib/postgresql/data + - postgres-oldest-v7:/var/lib/postgresql/data healthcheck: test: ["CMD", "pg_isready", "-U", "sequelize_test"] interval: 3s @@ -18,8 +18,8 @@ services: networks: default: - name: sequelize-postgres-oldest-network + name: sequelize-postgres-oldest-v7-network volumes: - postgres-oldest: - name: sequelize-postgres-oldest-volume + postgres-oldest-v7: + name: sequelize-postgres-oldest-v7-volume diff --git a/dev/postgres/oldest-v7/reset.sh b/dev/postgres/oldest-v7/reset.sh new file mode 100644 index 000000000..1debcdf89 --- /dev/null +++ b/dev/postgres/oldest-v7/reset.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -Eeuxo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ +cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" # https://stackoverflow.com/a/17744637 + +docker compose -p sequelize-postgres-oldest-v7 down --remove-orphans --volumes diff --git a/dev/postgres/oldest-v7/start.sh b/dev/postgres/oldest-v7/start.sh new file mode 100644 index 000000000..b2bad12e7 --- /dev/null +++ b/dev/postgres/oldest-v7/start.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +set -Eeuxo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ +cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" # https://stackoverflow.com/a/17744637 + +docker compose -p sequelize-postgres-oldest-v7 down --remove-orphans +docker compose -p sequelize-postgres-oldest-v7 up -d + +./../../wait-until-healthy.sh sequelize-postgres-oldest-v7 + +DIALECT=postgres ts-node ../../check-connection.ts + +docker exec sequelize-postgres-oldest-v7 \ + bash -c "export PGPASSWORD=sequelize_test && psql -h localhost -p 5432 -U sequelize_test sequelize_test -c 'CREATE EXTENSION IF NOT EXISTS btree_gist; CREATE EXTENSION IF NOT EXISTS hstore; CREATE EXTENSION IF NOT EXISTS citext;'" diff --git a/dev/postgres/oldest/stop.sh b/dev/postgres/oldest-v7/stop.sh similarity index 81% rename from dev/postgres/oldest/stop.sh rename to dev/postgres/oldest-v7/stop.sh index 70210f2e6..e03fd93f9 100644 --- a/dev/postgres/oldest/stop.sh +++ b/dev/postgres/oldest-v7/stop.sh @@ -2,6 +2,6 @@ set -Eeuxo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" # https://stackoverflow.com/a/17744637 -docker compose -p sequelize-postgres-oldest down --remove-orphans +docker compose -p sequelize-postgres-v7 down --remove-orphans echo "Local oldest supported Postgres instance with postgis stopped (if it was running)." diff --git a/package.json b/package.json index b54c66b62..33b86a326 100644 --- a/package.json +++ b/package.json @@ -26,25 +26,30 @@ "test:mysql": "cross-env DIALECT=mysql yarn run _test", "test:mssql": "cross-env DIALECT=mssql yarn run _test", "------------------------------------- local test dbs --------------------------------------": "", - "reset-mariadb": "bash dev/mariadb/oldest/reset.sh; bash dev/mariadb/latest/reset.sh", - "reset-mysql": "bash dev/mysql/oldest/reset.sh; bash dev/mysql/latest/reset.sh", - "reset-postgres": "bash dev/postgres/oldest/reset.sh; bash dev/postgres/latest/reset.sh", - "reset-mssql": "bash dev/mssql/oldest/reset.sh; bash dev/mssql/latest/reset.sh", + "reset-mariadb": "bash dev/mariadb/oldest-v6/reset.sh; bash dev/mariadb/oldest-v7/reset.sh; bash dev/mariadb/latest/reset.sh", + "reset-mysql": "bash dev/mysql/oldest-v6/reset.sh; bash dev/mysql/oldest-v7/reset.sh; bash dev/mysql/latest/reset.sh", + "reset-postgres": "bash dev/postgres/oldest-v6/reset.sh; bash dev/postgres/oldest-v7/reset.sh; bash dev/postgres/latest/reset.sh", + "reset-mssql": "bash dev/mssql/oldest-v6/reset.sh; bash dev/mssql/oldest-v7/reset.sh; bash dev/mssql/latest/reset.sh", "reset-all": "concurrently \"npm:reset-*(!all)\"", - "start-mariadb-oldest": "bash dev/mariadb/oldest/start.sh", + "start-mariadb-oldest-v6": "bash dev/mariadb/oldest-v6/start.sh", + "start-mariadb-oldest-v7": "bash dev/mariadb/oldest-v7/start.sh", "start-mariadb-latest": "bash dev/mariadb/latest/start.sh", - "start-mysql-oldest": "bash dev/mysql/oldest/start.sh", + "start-mysql-oldest-v6": "bash dev/mysql/oldest-v6/start.sh", + "start-mysql-oldest-v7": "bash dev/mysql/oldest-v7/start.sh", "start-mysql-latest": "bash dev/mysql/latest/start.sh", - "start-postgres-oldest": "bash dev/postgres/oldest/start.sh", + "start-postgres-oldest-v6": "bash dev/postgres/oldest-v6/start.sh", + "start-postgres-oldest-v7": "bash dev/postgres/oldest-v7/start.sh", "start-postgres-latest": "bash dev/postgres/latest/start.sh", - "start-mssql-oldest": "bash dev/mssql/oldest/start.sh", + "start-mssql-oldest-v6": "bash dev/mssql/oldest-v6/start.sh", + "start-mssql-oldest-v7": "bash dev/mssql/oldest-v7/start.sh", "start-mssql-latest": "bash dev/mssql/latest/start.sh", - "start-oldest": "concurrently \"npm:start-*-oldest\"", + "start-oldest-v6": "concurrently \"npm:start-*-oldest-v6\"", + "start-oldest-v7": "concurrently \"npm:start-*-oldest-v7\"", "start-latest": "concurrently \"npm:start-*-latest\"", - "stop-mariadb": "bash dev/mariadb/oldest/stop.sh; bash dev/mariadb/latest/stop.sh", - "stop-mysql": "bash dev/mysql/oldest/stop.sh; bash dev/mysql/latest/stop.sh", - "stop-postgres": "bash dev/postgres/oldest/stop.sh; bash dev/postgres/latest/stop.sh", - "stop-mssql": "bash dev/mssql/oldest/stop.sh; bash dev/mssql/latest/stop.sh", + "stop-mariadb": "bash dev/mariadb/oldest-v6/stop.sh; bash dev/mariadb/oldest-v7/stop.sh; bash dev/mariadb/latest/stop.sh", + "stop-mysql": "bash dev/mysql/oldest-v6/stop.sh; bash dev/mysql/oldest-v7/stop.sh; bash dev/mysql/latest/stop.sh", + "stop-postgres": "bash dev/postgres/oldest-v6/stop.sh; bash dev/postgres/oldest-v7/stop.sh; bash dev/postgres/latest/stop.sh", + "stop-mssql": "bash dev/mssql/oldest-v6/stop.sh; bash dev/mssql/oldest-v7/stop.sh; bash dev/mssql/latest/stop.sh", "stop-all": "concurrently \"npm:stop-*(!all)\"", "do-replace": "node dev/lib-replacements.ts --do", "undo-replace": "node dev/lib-replacements.ts --undo",