mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge pull request #775 from gradido/fix_database_migrations
fix_database_migrations
This commit is contained in:
commit
b721428abc
@ -22,9 +22,10 @@ const DB_VERSION = '0001-init_db'
|
||||
async function main() {
|
||||
// check for correct database version
|
||||
const con = await connection()
|
||||
const [rows] = await con.query(`SELECT fileName FROM migrations ORDER BY version DESC LIMIT 1;`)
|
||||
const [rows] = await con.query(`SELECT * FROM migrations ORDER BY version DESC LIMIT 1;`)
|
||||
if (
|
||||
(<RowDataPacket>rows).length === 0 ||
|
||||
!(<RowDataPacket>rows)[0].fileName ||
|
||||
(<RowDataPacket>rows)[0].fileName.indexOf(DB_VERSION) === -1
|
||||
) {
|
||||
throw new Error(`Wrong database version - the backend requires '${DB_VERSION}'`)
|
||||
|
||||
@ -58,6 +58,7 @@ services:
|
||||
# This makes sure the docker container has its own node modules.
|
||||
# Therefore it is possible to have a different node version on the host machine
|
||||
- database_node_modules:/app/node_modules
|
||||
- database_build:/app/build
|
||||
# bind the local folder to the docker to allow live reload
|
||||
- ./database:/app
|
||||
|
||||
@ -149,4 +150,5 @@ volumes:
|
||||
frontend_node_modules:
|
||||
backend_node_modules:
|
||||
database_node_modules:
|
||||
database_build:
|
||||
login_build_ubuntu_3.1:
|
||||
Loading…
x
Reference in New Issue
Block a user