-
Notifications
You must be signed in to change notification settings - Fork 245
DBA migrations and postgres #1795
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 39 commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
3ef2525
initial rework for dual support of mysql and postgres, moved to use m…
s3inlc a98ef7d
added update for faking sqlx migration for existing mysql systems
s3inlc 2b08347
set execution time of fake sqlx migration to 1
s3inlc 7349062
setting sequences for all tables to avoid collisions in serials
s3inlc aa955b8
Merge remote-tracking branch 'origin/dev' into dba-migrations-and-pos…
s3inlc 8ba2823
fixed sql query for migrations insert
s3inlc 14f6874
removed selective update execution part and added one last force upgr…
s3inlc 3492871
Merge remote-tracking branch 'origin/fix-update-order' into dba-migra…
s3inlc 68a918a
prevent access to migrations dir
s3inlc cd9d006
made style and order consistent in files
s3inlc bd8ddb7
added checksum for existing upgrades
s3inlc c3c0209
updated github actions to run both systems
s3inlc 73b1bdc
fixed github input
s3inlc bf3b2cd
removed double -f
s3inlc e06acae
input style fix
s3inlc 9a26d1c
syntax fix
s3inlc 4a076e6
fix workflow with -d on compose and postgres config
s3inlc 445e1bc
fixed docker compose refer
s3inlc 309bcf4
add exposed port
s3inlc 18230a7
fixed postgres devcontainer compose
s3inlc ba5b1ac
execute legacy test framework only with mysql
s3inlc 2d34f61
fixed path to initial sql
s3inlc 9910401
fix second occurrence of initial sql
s3inlc fb70714
create separate compose files for the tests to avoid clashing with de…
s3inlc 7861d4d
comment out unnecessary part
s3inlc d2059a5
really only call upgrade on mysql setups
s3inlc b17e8cb
no manual init for test needed
s3inlc 69e8372
just only create api key, everything else should be created from basi…
s3inlc 05682a9
set test user pass to default
s3inlc 468456c
reversed hashtopolis test parameters to default
s3inlc 342cc1b
create additional access group on tests
s3inlc 19d5453
avoid creating multiple relations
s3inlc e6c0e98
deactivate legacy tests for now
s3inlc f8a5ffd
Merge remote-tracking branch 'origin/dev' into dba-migrations-and-pos…
s3inlc 1ba1c09
removed order filter default on sum and minmax filters
s3inlc d029205
changed mysql specific LIKE BINARY to LIKE .. COLLATE C to achieve bi…
s3inlc 7103ac9
differ between mysql and postgres in this very specific case of like …
s3inlc f124259
make the default access group created on migration to avoid primary k…
s3inlc 364ca92
fixed order typo in like filter
s3inlc 7650aef
removed debug output
s3inlc 7f74e6d
Update src/dba/AbstractModelFactory.class.php
s3inlc b7e749f
added options list to github action
s3inlc c9ae11a
test running old test suite with changes
s3inlc 3c4df12
definitely removing old legacy test in ci workflow
s3inlc 5512458
Merge remote-tracking branch 'origin/dev' into dba-migrations-and-pos…
s3inlc d000b38
Merge remote-tracking branch 'origin/dev' into dba-migrations-and-pos…
s3inlc 9f90283
renamed all indexes to be unique, restructured file to have alphabeti…
s3inlc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| version: "3.7" | ||
| services: | ||
| hashtopolis-server-dev: | ||
| container_name: hashtopolis-server-dev | ||
| build: | ||
| context: .. | ||
| target: hashtopolis-server-dev | ||
| args: | ||
| - CONTAINER_USER_CMD_PRE | ||
| - CONTAINER_USER_CMD_POST | ||
| environment: | ||
| HASHTOPOLIS_DB_TYPE: postgres | ||
| HASHTOPOLIS_DB_USER: hashtopolis | ||
| HASHTOPOLIS_DB_PASS: hashtopolis | ||
| HASHTOPOLIS_DB_HOST: hashtopolis-db-dev | ||
| HASHTOPOLIS_DB_DATABASE: hashtopolis | ||
| HASHTOPOLIS_APIV2_ENABLE: 1 | ||
| depends_on: | ||
| - hashtopolis-db-dev | ||
| ports: | ||
| - "8080:80" | ||
| volumes: | ||
| # This is where VS Code should expect to find your project's source code | ||
| # and the value of "workspaceFolder" in .devcontainer/devcontainer.json | ||
| - ..:/var/www/html | ||
| - hashtopolis-server-dev:/usr/local/share/hashtopolis:Z | ||
| networks: | ||
| - hashtopolis_dev | ||
| hashtopolis-db-dev: | ||
| container_name: hashtopolis-db-dev | ||
| image: postgres:13 | ||
| restart: always | ||
| ports: | ||
| - "5432:5432" | ||
| volumes: | ||
| - hashtopolis-db-dev:/var/lib/postgresql/data | ||
| environment: | ||
| POSTGRES_DB: hashtopolis | ||
| POSTGRES_USER: hashtopolis | ||
| POSTGRES_PASSWORD: hashtopolis | ||
| networks: | ||
| - hashtopolis_dev | ||
|
|
||
| volumes: | ||
| hashtopolis-db-dev: | ||
| hashtopolis-server-dev: | ||
|
|
||
| networks: | ||
| hashtopolis_dev: | ||
| # This network will also be used by the python-agent | ||
| name: hashtopolis_dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,23 @@ | ||
| name: Start Hashtopolis server | ||
| description: Starts application containers and waits for Hashtopolis to be ready. | ||
|
|
||
| inputs: | ||
| db_system: | ||
| description: "Used to set which DB system should be used" | ||
| required: true | ||
| default: "mysql" | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - name: Start application containers | ||
| working-directory: .devcontainer | ||
| run: docker compose up -d | ||
| shell: bash | ||
| - name: Install composer dependencies packages | ||
| run: docker exec hashtopolis-server-dev composer install --working-dir=/var/www/html/ | ||
| working-directory: .github | ||
| run: docker compose -f docker-compose.${{ inputs.db_system }}.yml up -d | ||
| shell: bash | ||
| # should not be needed anymore as it is installed during build | ||
| # - name: Install composer dependencies packages | ||
| # run: docker exec hashtopolis-server-dev composer install --working-dir=/var/www/html/ | ||
| # shell: bash | ||
| - name: Wait until entrypoint is finished and Hashtopolis is started | ||
| run: bash .github/scripts/await-hashtopolis-startup.sh | ||
| shell: bash | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| version: "3.7" | ||
| services: | ||
| hashtopolis-server-dev: | ||
| container_name: hashtopolis-server-dev | ||
| build: | ||
| context: .. | ||
| target: hashtopolis-server-dev | ||
| args: | ||
| - CONTAINER_USER_CMD_PRE | ||
| - CONTAINER_USER_CMD_POST | ||
| environment: | ||
| HASHTOPOLIS_DB_TYPE: mysql | ||
| HASHTOPOLIS_DB_USER: hashtopolis | ||
| HASHTOPOLIS_DB_PASS: hashtopolis | ||
| HASHTOPOLIS_DB_HOST: hashtopolis-db-dev | ||
| HASHTOPOLIS_DB_DATABASE: hashtopolis | ||
| HASHTOPOLIS_APIV2_ENABLE: 1 | ||
| depends_on: | ||
| - hashtopolis-db-dev | ||
| ports: | ||
| - "8080:80" | ||
| volumes: | ||
| - hashtopolis-server-dev:/usr/local/share/hashtopolis:Z | ||
| networks: | ||
| - hashtopolis_dev | ||
| hashtopolis-db-dev: | ||
| container_name: hashtopolis-db-dev | ||
| image: mysql:8.0 | ||
| restart: always | ||
| ports: | ||
| - "3306:3306" | ||
| volumes: | ||
| - hashtopolis-db-dev:/var/lib/mysql | ||
| environment: | ||
| MYSQL_ROOT_PASSWORD: hashtopolis | ||
| MYSQL_DATABASE: hashtopolis | ||
| MYSQL_USER: hashtopolis | ||
| MYSQL_PASSWORD: hashtopolis | ||
| networks: | ||
| - hashtopolis_dev | ||
| volumes: | ||
| hashtopolis-db-dev: | ||
| hashtopolis-server-dev: | ||
|
|
||
| networks: | ||
| hashtopolis_dev: | ||
| name: hashtopolis_dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| version: "3.7" | ||
| services: | ||
| hashtopolis-server-dev: | ||
| container_name: hashtopolis-server-dev | ||
| build: | ||
| context: .. | ||
| target: hashtopolis-server-dev | ||
| args: | ||
| - CONTAINER_USER_CMD_PRE | ||
| - CONTAINER_USER_CMD_POST | ||
| environment: | ||
| HASHTOPOLIS_DB_TYPE: postgres | ||
| HASHTOPOLIS_DB_USER: hashtopolis | ||
| HASHTOPOLIS_DB_PASS: hashtopolis | ||
| HASHTOPOLIS_DB_HOST: hashtopolis-db-dev | ||
| HASHTOPOLIS_DB_DATABASE: hashtopolis | ||
| HASHTOPOLIS_APIV2_ENABLE: 1 | ||
| depends_on: | ||
| - hashtopolis-db-dev | ||
| ports: | ||
| - "8080:80" | ||
| volumes: | ||
| - hashtopolis-server-dev:/usr/local/share/hashtopolis:Z | ||
| networks: | ||
| - hashtopolis_dev | ||
| hashtopolis-db-dev: | ||
| container_name: hashtopolis-db-dev | ||
| image: postgres:13 | ||
| restart: always | ||
| ports: | ||
| - "5432:5432" | ||
| volumes: | ||
| - hashtopolis-db-dev:/var/lib/postgresql/data | ||
| environment: | ||
| POSTGRES_DB: hashtopolis | ||
| POSTGRES_USER: hashtopolis | ||
| POSTGRES_PASSWORD: hashtopolis | ||
| networks: | ||
| - hashtopolis_dev | ||
|
|
||
| volumes: | ||
| hashtopolis-db-dev: | ||
| hashtopolis-server-dev: | ||
|
|
||
| networks: | ||
| hashtopolis_dev: | ||
| name: hashtopolis_dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| version: '3.7' | ||
| services: | ||
| hashtopolis-backend: | ||
| container_name: hashtopolis-backend | ||
| image: hashtopolis/backend:latest | ||
| restart: always | ||
| volumes: | ||
| - hashtopolis:/usr/local/share/hashtopolis:Z | ||
| # - ./ssmtp.conf:/etc/ssmtp/ssmtp.conf | ||
| environment: | ||
| HASHTOPOLIS_DB_TYPE: postgres | ||
| HASHTOPOLIS_DB_USER: $POSTGRES_USER | ||
| HASHTOPOLIS_DB_PASS: $POSTGRES_PASSWORD | ||
| HASHTOPOLIS_DB_HOST: $HASHTOPOLIS_DB_HOST | ||
| HASHTOPOLIS_DB_DATABASE: $POSTGRES_DATABASE | ||
| HASHTOPOLIS_ADMIN_USER: $HASHTOPOLIS_ADMIN_USER | ||
| HASHTOPOLIS_ADMIN_PASSWORD: $HASHTOPOLIS_ADMIN_PASSWORD | ||
| HASHTOPOLIS_APIV2_ENABLE: $HASHTOPOLIS_APIV2_ENABLE | ||
| depends_on: | ||
| - db | ||
| ports: | ||
| - 8080:80 | ||
| db: | ||
| container_name: db | ||
| image: postgres:13 | ||
| restart: always | ||
| volumes: | ||
| - db:/var/lib/postgresql/data | ||
| environment: | ||
| POSTGRES_DB: $POSTGRES_DATABASE | ||
| POSTGRES_USER: $POSTGRES_USER | ||
| POSTGRES_PASSWORD: $POSTGRES_PASSWORD | ||
| hashtopolis-frontend: | ||
| container_name: hashtopolis-frontend | ||
| image: hashtopolis/frontend:latest | ||
| environment: | ||
| HASHTOPOLIS_BACKEND_URL: $HASHTOPOLIS_BACKEND_URL | ||
| restart: always | ||
| depends_on: | ||
| - hashtopolis-backend | ||
| ports: | ||
| - 4200:80 | ||
| volumes: | ||
| db: | ||
| hashtopolis: |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.