Skip to content

Commit

Permalink
SBERDOMA-121 repair migrations after keystone update
Browse files Browse the repository at this point in the history
  • Loading branch information
pahaz committed Apr 10, 2021
1 parent bb02814 commit d2302f7
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions bin/kmigrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from pathlib import Path
from time import time

VERSION = (1, 1, 6)
VERSION = (1, 2, 0)
CACHE_DIR = Path('.kmigrator')
KNEX_MIGRATIONS_DIR = Path('migrations')
GET_KNEX_SETTINGS_SCRIPT = CACHE_DIR / 'get.knex.settings.js'
Expand Down Expand Up @@ -295,7 +295,8 @@ def main():
(async () => {
keystone.eventHandlers = {}
await keystone.connect()
await asyncForEach(Object.values(keystone.adapters), async adapter => {
const adapter = keystone.adapter
if (!adapter._createTables || !adapter.knex) {
return
}
Expand Down Expand Up @@ -345,10 +346,7 @@ def main():
process.exit(1)
}
}
}).catch((e) => {
console.error(e)
process.exit(1)
})
if (!hasKnexConnection) {
console.error('\\nERROR: No KNEX adapter connection settings! Check the DATABASE_URL')
process.exit(3)
Expand Down Expand Up @@ -388,7 +386,8 @@ def main():
(async () => {
keystone.eventHandlers = {}
await keystone.connect()
await asyncForEach(Object.values(keystone.adapters), async adapter => {
const adapter = keystone.adapter
if (!adapter._createTables || !adapter.knex) {
return
}
Expand All @@ -399,10 +398,7 @@ def main():
console.error(e)
process.exit(1)
}
}).catch((e) => {
console.error(e)
process.exit(1)
})
process.exit(0)
})()
"""
Expand Down

0 comments on commit d2302f7

Please sign in to comment.