mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge pull request #932 from gradido/community_test_database_fix
Community test database fix
This commit is contained in:
commit
efbdd6bb6a
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@ -470,7 +470,7 @@ jobs:
|
|||||||
run: echo "::set-output name=id::$(docker network ls | grep github_network | awk '{ print $1 }')"
|
run: echo "::set-output name=id::$(docker network ls | grep github_network | awk '{ print $1 }')"
|
||||||
id: network
|
id: network
|
||||||
- name: Start database migration
|
- name: Start database migration
|
||||||
run: docker run --network ${{ steps.network.outputs.id }} --name=database --env NODE_ENV=production --env DB_HOST=mariadb -d gradido/database:production_up
|
run: docker run --network ${{ steps.network.outputs.id }} --name=database --env NODE_ENV=production --env DB_HOST=mariadb --env DB_DATABASE=gradido_community_test -d gradido/database:production_up
|
||||||
- name: get database migration container id
|
- name: get database migration container id
|
||||||
run: echo "::set-output name=id::$(docker container ls | grep database | awk '{ print $1 }')"
|
run: echo "::set-output name=id::$(docker container ls | grep database | awk '{ print $1 }')"
|
||||||
id: database_container
|
id: database_container
|
||||||
|
|||||||
@ -25,12 +25,6 @@ export default async (): Promise<void> => {
|
|||||||
DEFAULT CHARACTER SET utf8mb4
|
DEFAULT CHARACTER SET utf8mb4
|
||||||
DEFAULT COLLATE utf8mb4_unicode_ci;`)
|
DEFAULT COLLATE utf8mb4_unicode_ci;`)
|
||||||
|
|
||||||
// Create Database `gradido_community_test` for tests
|
|
||||||
await con.query(`
|
|
||||||
CREATE DATABASE IF NOT EXISTS ${CONFIG.DB_DATABASE}_test
|
|
||||||
DEFAULT CHARACTER SET utf8mb4
|
|
||||||
DEFAULT COLLATE utf8mb4_unicode_ci;`)
|
|
||||||
|
|
||||||
// Check if old migration table is present, delete if needed
|
// Check if old migration table is present, delete if needed
|
||||||
const [rows] = await con.query(`SHOW TABLES FROM \`${CONFIG.DB_DATABASE}\` LIKE 'migrations';`)
|
const [rows] = await con.query(`SHOW TABLES FROM \`${CONFIG.DB_DATABASE}\` LIKE 'migrations';`)
|
||||||
if ((<RowDataPacket>rows).length > 0) {
|
if ((<RowDataPacket>rows).length > 0) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user