Skip to content

Commit

Permalink
Add migration Migration::class. (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw committed Apr 26, 2023
1 parent 6986cd2 commit cf3baa5
Show file tree
Hide file tree
Showing 51 changed files with 724 additions and 826 deletions.
20 changes: 11 additions & 9 deletions .gitattributes
Expand Up @@ -22,16 +22,18 @@
*.ttf binary

# Ignore some meta files when creating an archive of this repository
/.github export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.scrutinizer.yml export-ignore
/phpunit.xml.dist export-ignore
/tests export-ignore
/docs export-ignore
/.github export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.phpunit-watcher.yml export-ignore
/.styleci.yml export-ignore
/infection.json.dist export-ignore
/phpunit.xml.dist export-ignore
/psalm.xml export-ignore
/tests export-ignore
/docs export-ignore

# Avoid merge conflicts in CHANGELOG
# https://about.gitlab.com/2015/02/10/gitlab-reduced-merge-conflicts-by-90-percent-with-changelog-placeholders/
/CHANGELOG.md merge=union

2 changes: 1 addition & 1 deletion .github/workflows/composer-require-checker.yml
Expand Up @@ -30,4 +30,4 @@ jobs:
os: >-
['ubuntu-latest']
php: >-
['8.0']
['8.1', '8.2']
43 changes: 16 additions & 27 deletions .github/workflows/mssql.yml
Expand Up @@ -27,7 +27,6 @@ jobs:

env:
extensions: pdo, pdo_sqlsrv-5.10.1
key: cache

runs-on: ${{ matrix.os }}

Expand All @@ -39,16 +38,11 @@ jobs:
php:
- 8.0
- 8.1
- 8.2

mssql:
- server:2017-latest
- server:2019-latest

exclude:
- php: 8.0
mssql: server:2017-latest
- php: 8.1
mssql: server:2017-latest
- server:2022-latest

services:
mssql:
Expand All @@ -62,13 +56,13 @@ jobs:
options: --name=mssql --health-cmd="/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'SELECT 1'" --health-interval=10s --health-timeout=5s --health-retries=3

steps:
- name: Checkout
- name: Checkout.
uses: actions/checkout@v3

- name: Create MS SQL Database
- name: Create MS SQL Database.
run: docker exec -i mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'CREATE DATABASE yiitest'

- name: Install PHP with extensions
- name: Install PHP with extensions.
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
Expand All @@ -77,23 +71,18 @@ jobs:
coverage: pcov
tools: composer:v2, pecl

- name: Determine composer cache directory
if: matrix.os == 'ubuntu-latest'
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV

- name: Cache dependencies installed with composer
uses: actions/cache@v3
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php }}-composer-
- name: Update composer
- name: Update composer.
run: composer self-update

- name: Install db-mssql
- name: Install db-mssql.
run: composer require yiisoft/db-mssql --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Run tests with phpunit
run: vendor/bin/phpunit --group Mssql --colors=always
- name: Run tests with phpunit.
run: vendor/bin/phpunit --testsuite=Mssql --coverage-clover=coverage.xml --colors=always

- name: Upload coverage to Codecov.
if: matrix.php == '8.1'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
71 changes: 10 additions & 61 deletions .github/workflows/mutation.yml
Expand Up @@ -9,8 +9,6 @@ on:
- 'psalm.xml'

push:
branches:
- "master"
paths-ignore:
- 'docs/**'
- 'README.md'
Expand All @@ -26,7 +24,7 @@ jobs:
name: PHP ${{ matrix.php }}-${{ matrix.os }}

env:
extensions: pdo, pdo_mysql, pdo_oci, pdo_pgsql, pdo_sqlsrv-5.10.1, oci8
extensions: pdo, pdo_pgsql

runs-on: ${{ matrix.os }}

Expand All @@ -36,50 +34,25 @@ jobs:
- ubuntu-latest

php:
- 8.0
- 8.1
- 8.2

services:
mssql:
image: mcr.microsoft.com/mssql/server:2019-latest
env:
SA_PASSWORD: YourStrong!Passw0rd
ACCEPT_EULA: Y
MSSQL_PID: Developer
ports:
- 1433:1433
options: --name=mssql --health-cmd="/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'SELECT 1'" --health-interval=10s --health-timeout=5s --health-retries=3
mysql:
image: mysql:latest
env:
MYSQL_ALLOW_EMPTY_PASSWORD: true
MYSQL_PASSWORD: ''
MYSQL_DATABASE: yiitest
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
postgres:
image: postgres:14
image: postgres:15
env:
POSTGRES_USER: root
POSTGRES_PASSWORD: root
POSTGRES_DB: yiitest
ports:
- 5432:5432
options: --name=postgres --health-cmd="pg_isready" --health-interval=10s --health-timeout=5s --health-retries=3
oci:
image: wnameless/oracle-xe-11g-r2:latest
ports:
- 1521:1521
options: --name=oci

steps:
- name: Checkout
- name: Checkout.
uses: actions/checkout@v3

- name: Create MS SQL Database
run: docker exec -i mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'CREATE DATABASE yiitest'

- name: Install PHP
- name: Install PHP with extensions.
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php }}"
Expand All @@ -88,38 +61,14 @@ jobs:
coverage: pcov
tools: composer:v2

- name: Determine composer cache directory
if: matrix.os == 'ubuntu-latest'
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV

- name: Cache dependencies installed with composer
uses: actions/cache@v3
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php }}-composer-
- name: Update composer
- name: Update composer.
run: composer self-update

- name: Install db-mssql
run: composer require yiisoft/db-mssql --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Install db-mysql
run: composer require yiisoft/db-mysql --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Install db-oracle
run: composer require yiisoft/db-oracle --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Install db-pgsql
- name: Install db-pgsql.
run: composer require yiisoft/db-pgsql --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Install db-sqlite
run: composer require yiisoft/db-sqlite --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Run infection
- name: Run infection.
run: |
vendor/bin/roave-infection-static-analysis-plugin -j2 --ignore-msi-with-no-mutations --only-covered
vendor/bin/roave-infection-static-analysis-plugin -j2 --ignore-msi-with-no-mutations --only-covered --test-framework-options="--testsuite=Pgsql"
env:
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
46 changes: 24 additions & 22 deletions .github/workflows/mysql.yml
Expand Up @@ -27,7 +27,6 @@ jobs:

env:
extensions: pdo, pdo_mysql
key: cache-v1

runs-on: ${{ matrix.os }}

Expand All @@ -39,14 +38,22 @@ jobs:
php:
- 8.0
- 8.1
- 8.2

mysql:
- 5.7
- latest
- mysql:5.7
- mysql:latest
- mariadb:10.4
- mariadb:10.5
- mariadb:10.6
- mariadb:10.7
- mariadb:10.8
- mariadb:10.9
- mariadb:latest

services:
mysql:
image: mysql:${{ matrix.mysql }}
image: ${{ matrix.mysql }}
env:
MYSQL_ALLOW_EMPTY_PASSWORD: true
MYSQL_PASSWORD: ''
Expand All @@ -56,34 +63,29 @@ jobs:
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

steps:
- name: Checkout
- name: Checkout.
uses: actions/checkout@v3

- name: Install PHP with extensions
- name: Install PHP with extensions.
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.extensions }}
ini-values: date.timezone='UTC'
coverage: pcov

- name: Determine composer cache directory
if: matrix.os == 'ubuntu-latest'
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV

- name: Cache dependencies installed with composer
uses: actions/cache@v3
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php }}-composer-
- name: Update composer
- name: Update composer.
run: composer self-update

- name: Install db-mysql
- name: Install db-mysql.
run: composer require yiisoft/db-mysql --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Run tests with phpunit
run: vendor/bin/phpunit --group Mysql --colors=always
- name: Run tests with phpunit.
run: vendor/bin/phpunit --testsuite=Mysql --coverage-clover=coverage.xml --colors=always

- name: Upload coverage to Codecov.
if: matrix.php == '8.1'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
50 changes: 29 additions & 21 deletions .github/workflows/oracle.yml
Expand Up @@ -23,11 +23,10 @@ name: oracle

jobs:
tests:
name: PHP ${{ matrix.php }}-${{ matrix.os }}
name: PHP ${{ matrix.php }}-oracle-${{ matrix.oracle }}

env:
extensions: pdo, pdo_oci, oci8
key: cache-v1

runs-on: ${{ matrix.os }}

Expand All @@ -39,19 +38,32 @@ jobs:
php:
- 8.0
- 8.1
- 8.2

oracle:
- 18
- 21

services:
oci:
image: wnameless/oracle-xe-11g-r2:latest
image: gvenzl/oracle-xe:${{ matrix.oracle }}
ports:
- 1521:1521
options: --name=oci
env:
ORACLE_DATABASE : yiitest
ORACLE_PASSWORD : root
options: >-
--name=oci
--health-cmd healthcheck.sh
--health-interval 10s
--health-timeout 5s
--health-retries 10
steps:
- name: Checkout
- name: Checkout.
uses: actions/checkout@v3

- name: Install PHP with extensions
- name: Install PHP with extensions.
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
Expand All @@ -60,22 +72,18 @@ jobs:
coverage: pcov
tools: composer:v2

- name: Determine composer cache directory
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV

- name: Cache dependencies installed with composer
uses: actions/cache@v3
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php }}-composer-
- name: Update composer
- name: Update composer.
run: composer self-update

- name: Install db-oracle
- name: Install db-oracle.
run: composer require yiisoft/db-oracle --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Run tests with phpunit
run: vendor/bin/phpunit --group Oracle --colors=always
- name: Run tests with phpunit.
run: vendor/bin/phpunit --testsuite=Oracle --coverage-clover=coverage.xml --colors=always

- name: Upload coverage to Codecov.
if: matrix.php == '8.1'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml

0 comments on commit cf3baa5

Please sign in to comment.