Skip to content

Commit fe96cdc

Browse files
authored
flow-php/postgresql-migrations (#2290)
* refactor: flow-php/postgresql - migrations core chore: introduce parameters() dsl function to posgresql client feature: introduce schema to flow-php/postgresql - create schema definition - read whole Catalog from a postgresql db - added dependeny from flow-php/types - created TypeMapper to quickly map rows into collections of structures feature: catalog comparator - including comparator for all db objects refactor: move parsing data type string to dedicated parser refactor: unify naming convetion with colum and value type refactoring: optimizations and renames - geneate diff sql's for migratiosn up/down - unify naming of postgresql dsl - cover unlogged tables - added toSql() to Schema objects feature: missing postgresql table options feature: table rename detection refactor: remove RawCondition and RawExpression - unify DSL - replace inline strings with proper query builders in tests refactor: split postgresql dsl into smaller files refactor: simplify diffs to return only one way migration sqls refactor: make diffs to return query builders feature: improve rename strategies - introduce similarity names abstraction - introduce rename strategy abstraction feature: detect if the view requires an update refactor: allow to pass strings instead of col() table() expressions - update documentation fix: introduce execution order strategy chore: flow-php/postgresql-migrations skeleton * feature: flow-php/symfony-postgresql-bundle feature: migrations cli app interface feature: basic building blocks for migrations feature: migration store feature: migrations repository feature: migrations repository feature: migrations generator feature: migration executor feature: setup migrations cli commands feauter: symfony migration bundle - move core abstractions to postgresql package - move implementations to symfony bundle feature: load catalog cofiguration from yaml feature: wrap migrations in transations refactor: catalog_providers configuration in postgresql bundles - detach catalog from connection - allow to chain providers - allow to register by tag / attribute refactor: simplify catalog congigratuin feature: add support for telemetry in postgresql bundle feature: documentation * fix: ci/cd workflow configuration
1 parent ab43f9e commit fe96cdc

File tree

680 files changed

+42527
-14064
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

680 files changed

+42527
-14064
lines changed

.codecov.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ component_management:
100100
name: bridge-symfony-http-foundation-telemetry
101101
paths:
102102
- src/bridge/symfony/http-foundation-telemetry/**
103+
- component_id: bridge-symfony-postgresql-bundle
104+
name: bridge-symfony-postgresql-bundle
105+
paths:
106+
- src/bridge/symfony/postgresql-bundle/**
103107
- component_id: bridge-symfony-telemetry-bundle
104108
name: bridge-symfony-telemetry-bundle
105109
paths:

.github/workflows/job-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ jobs:
141141
- name: "Test - Bridges"
142142
run: "composer test:bridges"
143143
env:
144+
PGSQL_DATABASE_URL: pgsql://postgres:postgres@127.0.0.1:${{ job.services.postgres.ports[5432] }}/postgres?serverVersion=11&charset=utf8
144145
AZURITE_HOST: "localhost"
145146
AZURITE_BLOB_PORT: "10000"
146147
AZURITE_ACCOUNT_NAME: "flowphpaccount01"

.github/workflows/monorepo-split.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ jobs:
9494
split_repository: 'symfony-http-foundation-bridge'
9595
- local_path: 'src/bridge/symfony/http-foundation-telemetry'
9696
split_repository: 'symfony-http-foundation-telemetry-bridge'
97+
- local_path: 'src/bridge/symfony/postgresql-bundle'
98+
split_repository: 'symfony-postgresql-bundle'
9799
- local_path: 'src/bridge/symfony/telemetry-bundle'
98100
split_repository: 'symfony-telemetry-bundle'
99101
- local_path: 'src/bridge/telemetry/otlp'

bin/docs.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,12 @@ public function execute(InputInterface $input, OutputInterface $output) : int
6060
__DIR__ . '/../src/adapter/etl-adapter-xml/src/Flow/ETL/Adapter/XML/functions.php',
6161
__DIR__ . '/../src/lib/filesystem/src/Flow/Filesystem/DSL/functions.php',
6262
__DIR__ . '/../src/lib/types/src/Flow/Types/DSL/functions.php',
63-
__DIR__ . '/../src/lib/postgresql/src/Flow/PostgreSql/DSL/functions.php',
63+
__DIR__ . '/../src/lib/postgresql/src/Flow/PostgreSql/DSL/schema.php',
64+
__DIR__ . '/../src/lib/postgresql/src/Flow/PostgreSql/DSL/query.php',
65+
__DIR__ . '/../src/lib/postgresql/src/Flow/PostgreSql/DSL/condition.php',
66+
__DIR__ . '/../src/lib/postgresql/src/Flow/PostgreSql/DSL/parser.php',
67+
__DIR__ . '/../src/lib/postgresql/src/Flow/PostgreSql/DSL/client.php',
68+
__DIR__ . '/../src/lib/postgresql/src/Flow/PostgreSql/Migrations/DSL/functions.php',
6469
__DIR__ . '/../src/lib/telemetry/src/Flow/Telemetry/DSL/functions.php',
6570
__DIR__ . '/../src/lib/azure-sdk/src/Flow/Azure/SDK/DSL/functions.php',
6671
__DIR__ . '/../src/bridge/filesystem/azure/src/Flow/Filesystem/Bridge/Azure/DSL/functions.php',

composer.json

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"ext-xmlreader": "*",
2121
"ext-xmlwriter": "*",
2222
"ext-zlib": "*",
23-
"composer-runtime-api": "^2.0",
23+
"composer-runtime-api": "^2.2",
2424
"async-aws/s3": "^2.6",
2525
"brick/math": "^0.12 || ^0.13 || ^0.14",
2626
"coduo/php-humanizer": "^5.0",
@@ -39,15 +39,15 @@
3939
"psr/http-message": "^1.0 || ^2.0",
4040
"psr/log": "^2.0 || ^3.0",
4141
"psr/simple-cache": "^1.0 || ^2.0 || ^3.0",
42-
"symfony/config": "^6.4 || ^7.3 || ^8.0",
43-
"symfony/console": "^6.4 || ^7.3 || ^8.0",
44-
"symfony/dependency-injection": "^6.4 || ^7.3 || ^8.0",
45-
"symfony/event-dispatcher": "^6.4 || ^7.3 || ^8.0",
46-
"symfony/http-foundation": "^6.4 || ^7.3 || ^8.0",
47-
"symfony/http-kernel": "^6.4 || ^7.3 || ^8.0",
42+
"symfony/config": "^6.4 || ^7.4 || ^8.0",
43+
"symfony/console": "^6.4 || ^7.4 || ^8.0",
44+
"symfony/dependency-injection": "^6.4 || ^7.4 || ^8.0",
45+
"symfony/event-dispatcher": "^6.4 || ^7.4 || ^8.0",
46+
"symfony/http-foundation": "^6.4 || ^7.4 || ^8.0",
47+
"symfony/http-kernel": "^6.4 || ^7.4 || ^8.0",
4848
"symfony/polyfill-mbstring": "^1.33",
49-
"symfony/string": "^6.4 || ^7.3 || ^8.0",
50-
"symfony/uid": "^6.4 || ^7.3 || ^8.0",
49+
"symfony/string": "^6.4 || ^7.4 || ^8.0",
50+
"symfony/uid": "^6.4 || ^7.4 || ^8.0",
5151
"webmozart/glob": "^3.0 || ^4.0"
5252
},
5353
"require-dev": {
@@ -61,14 +61,14 @@
6161
"php-http/curl-client": "^2.2",
6262
"php-http/mock-client": "^1.5",
6363
"ramsey/uuid": "^4.5",
64-
"symfony/cache": "^6.4 || ^7.3 || ^8.0",
65-
"symfony/dotenv": "^6.4 || ^7.3 || ^8.0",
66-
"symfony/finder": "^6.4 || ^7.3 || ^8.0",
67-
"symfony/framework-bundle": "^6.4 || ^7.3 || ^8.0",
68-
"symfony/http-client": "^6.4 || ^7.3 || ^8.0",
69-
"symfony/messenger": "^6.4 || ^7.3 || ^8.0",
70-
"symfony/process": "^7.3 || ^8.0",
71-
"symfony/routing": "^6.4 || ^7.3 || ^8.0",
64+
"symfony/cache": "^6.4 || ^7.4 || ^8.0",
65+
"symfony/dotenv": "^6.4 || ^7.4 || ^8.0",
66+
"symfony/finder": "^6.4 || ^7.4 || ^8.0",
67+
"symfony/framework-bundle": "^6.4 || ^7.4 || ^8.0",
68+
"symfony/http-client": "^6.4 || ^7.4 || ^8.0",
69+
"symfony/messenger": "^6.4 || ^7.4 || ^8.0",
70+
"symfony/process": "^7.4 || ^8.0",
71+
"symfony/routing": "^6.4 || ^7.4 || ^8.0",
7272
"twig/twig": "^3.0"
7373
},
7474
"replace": {
@@ -109,6 +109,7 @@
109109
"flow-php/snappy": "self.version",
110110
"flow-php/symfony-http-foundation-bridge": "self.version",
111111
"flow-php/symfony-http-foundation-telemetry-bridge": "self.version",
112+
"flow-php/symfony-postgresql-bundle": "self.version",
112113
"flow-php/symfony-telemetry-bundle": "self.version",
113114
"flow-php/telemetry": "self.version",
114115
"flow-php/telemetry-otlp-bridge": "self.version",
@@ -144,6 +145,7 @@
144145
"src/bridge/psr18/telemetry/src/Flow",
145146
"src/bridge/symfony/http-foundation-telemetry/src/Flow",
146147
"src/bridge/symfony/http-foundation/src/Flow",
148+
"src/bridge/symfony/postgresql-bundle/src/Flow",
147149
"src/bridge/symfony/telemetry-bundle/src/Flow",
148150
"src/bridge/telemetry/otlp/src/Flow",
149151
"src/bridge/phpunit/telemetry/src/Flow",
@@ -204,8 +206,13 @@
204206
"src/lib/parquet/src/Flow/Parquet/functions.php",
205207
"src/lib/parquet/src/Flow/Parquet/Binary/functions.php",
206208
"src/lib/parquet/src/stubs.php",
207-
"src/lib/postgresql/src/Flow/PostgreSql/DSL/functions.php",
209+
"src/lib/postgresql/src/Flow/PostgreSql/DSL/client.php",
210+
"src/lib/postgresql/src/Flow/PostgreSql/DSL/condition.php",
211+
"src/lib/postgresql/src/Flow/PostgreSql/DSL/parser.php",
212+
"src/lib/postgresql/src/Flow/PostgreSql/DSL/query.php",
213+
"src/lib/postgresql/src/Flow/PostgreSql/DSL/schema.php",
208214
"src/lib/postgresql/src/stubs.php",
215+
"src/lib/postgresql/src/Flow/PostgreSql/Migrations/DSL/functions.php",
209216
"src/lib/snappy/polyfill.php",
210217
"src/lib/telemetry/src/Flow/Telemetry/DSL/functions.php",
211218
"src/lib/types/src/Flow/Types/DSL/functions.php"
@@ -237,6 +244,7 @@
237244
"src/bridge/psr18/telemetry/tests/Flow",
238245
"src/bridge/symfony/http-foundation-telemetry/tests/Flow",
239246
"src/bridge/symfony/http-foundation/tests/Flow",
247+
"src/bridge/symfony/postgresql-bundle/tests/Flow",
240248
"src/bridge/symfony/telemetry-bundle/tests/Flow",
241249
"src/bridge/telemetry/otlp/tests/Flow",
242250
"src/bridge/phpunit/telemetry/tests/Flow",
@@ -296,6 +304,7 @@
296304
"@test:lib:parquet",
297305
"@test:lib:parquet-viewer",
298306
"@test:lib:postgresql",
307+
"@test:lib:postgresql-migrations",
299308
"@test:lib:snappy",
300309
"@test:lib:telemetry",
301310
"@test:lib:types"
@@ -311,6 +320,7 @@
311320
"@test:bridge:psr18-telemetry",
312321
"@test:bridge:symfony-http-foundation",
313322
"@test:bridge:symfony-http-foundation-telemetry",
323+
"@test:bridge:symfony-postgresql-bundle",
314324
"@test:bridge:symfony-telemetry-bundle",
315325
"@test:bridge:telemetry-otlp"
316326
],
@@ -371,6 +381,10 @@
371381
"tools/phpunit/vendor/bin/phpunit --testsuite=lib-postgresql-unit --log-junit ./var/phpunit/logs/lib-postgresql-unit.junit.xml --coverage-clover=./var/phpunit/coverage/clover/lib-postgresql-unit.coverage.xml",
372382
"tools/phpunit/vendor/bin/phpunit --testsuite=lib-postgresql-integration --log-junit ./var/phpunit/logs/lib-postgresql-integration.junit.xml --coverage-clover=./var/phpunit/coverage/clover/lib-postgresql-integration.coverage.xml"
373383
],
384+
"test:lib:postgresql-migrations": [
385+
"tools/phpunit/vendor/bin/phpunit --testsuite=lib-postgresql-migrations-unit --log-junit ./var/phpunit/logs/lib-postgresql-migrations-unit.junit.xml --coverage-clover=./var/phpunit/coverage/clover/lib-postgresql-migrations-unit.coverage.xml",
386+
"tools/phpunit/vendor/bin/phpunit --testsuite=lib-postgresql-migrations-integration --log-junit ./var/phpunit/logs/lib-postgresql-migrations-integration.junit.xml --coverage-clover=./var/phpunit/coverage/clover/lib-postgresql-migrations-integration.coverage.xml"
387+
],
374388
"test:bridge:filesystem-azure": [
375389
"tools/phpunit/vendor/bin/phpunit --testsuite=bridge-filesystem-azure-unit --log-junit ./var/phpunit/logs/bridge-filesystem-azure-unit.junit.xml --coverage-clover=./var/phpunit/coverage/clover/bridge-filesystem-azure-unit.coverage.xml",
376390
"tools/phpunit/vendor/bin/phpunit --testsuite=bridge-filesystem-azure-integration --log-junit ./var/phpunit/logs/bridge-filesystem-azure-integration.junit.xml --coverage-clover=./var/phpunit/coverage/clover/bridge-filesystem-azure-integration.coverage.xml"
@@ -404,6 +418,10 @@
404418
"tools/phpunit/vendor/bin/phpunit --testsuite=bridge-symfony-http-foundation-telemetry-unit --log-junit ./var/phpunit/logs/bridge-symfony-http-foundation-telemetry-unit.junit.xml --coverage-clover=./var/phpunit/coverage/clover/bridge-symfony-http-foundation-telemetry-unit.coverage.xml",
405419
"tools/phpunit/vendor/bin/phpunit --testsuite=bridge-symfony-http-foundation-telemetry-integration --log-junit ./var/phpunit/logs/bridge-symfony-http-foundation-telemetry-integration.junit.xml --coverage-clover=./var/phpunit/coverage/clover/bridge-symfony-http-foundation-telemetry-integration.coverage.xml"
406420
],
421+
"test:bridge:symfony-postgresql-bundle": [
422+
"tools/phpunit/vendor/bin/phpunit --testsuite=bridge-symfony-postgresql-bundle-unit --log-junit ./var/phpunit/logs/bridge-symfony-postgresql-bundle-unit.junit.xml --coverage-clover=./var/phpunit/coverage/clover/bridge-symfony-postgresql-bundle-unit.coverage.xml",
423+
"tools/phpunit/vendor/bin/phpunit --testsuite=bridge-symfony-postgresql-bundle-integration --log-junit ./var/phpunit/logs/bridge-symfony-postgresql-bundle-integration.junit.xml --coverage-clover=./var/phpunit/coverage/clover/bridge-symfony-postgresql-bundle-integration.coverage.xml"
424+
],
407425
"test:bridge:symfony-telemetry-bundle": [
408426
"tools/phpunit/vendor/bin/phpunit --testsuite=bridge-symfony-telemetry-bundle-unit --log-junit ./var/phpunit/logs/bridge-symfony-telemetry-bundle-unit.junit.xml --coverage-clover=./var/phpunit/coverage/clover/bridge-symfony-telemetry-bundle-unit.coverage.xml",
409427
"tools/phpunit/vendor/bin/phpunit --testsuite=bridge-symfony-telemetry-bundle-integration --log-junit ./var/phpunit/logs/bridge-symfony-telemetry-bundle-integration.junit.xml --coverage-clover=./var/phpunit/coverage/clover/bridge-symfony-telemetry-bundle-integration.coverage.xml"

0 commit comments

Comments
 (0)