Commit b30f87ba by iWan Mustaqim

perbaikan initializedb

1 parent 5e03bef7
...@@ -263,12 +263,12 @@ def alembic_run(ini_file, name=None): ...@@ -263,12 +263,12 @@ def alembic_run(ini_file, name=None):
sys.exit() sys.exit()
def alembic_run(ini_file, name='alembic_base'): # def alembic_run(ini_file, name='alembic_base'):
bin_path = os.path.split(sys.executable)[0] # bin_path = os.path.split(sys.executable)[0]
alembic_bin = os.path.join(bin_path, 'alembic') # alembic_bin = os.path.join(bin_path, 'alembic')
command = (alembic_bin, '-c', ini_file, '-n', name, 'upgrade', 'head') # command = (alembic_bin, '-c', ini_file, '-n', name, 'upgrade', 'head')
if subprocess.call(command) != 0: # if subprocess.call(command) != 0:
sys.exit() # sys.exit()
def base_alembic_run(ini_file): def base_alembic_run(ini_file):
...@@ -285,9 +285,10 @@ def main(argv=sys.argv): ...@@ -285,9 +285,10 @@ def main(argv=sys.argv):
engine = engine_from_config(settings, 'sqlalchemy.') engine = engine_from_config(settings, 'sqlalchemy.')
DBSession.configure(bind=engine) DBSession.configure(bind=engine)
LogDBSession.configure(bind=engine) LogDBSession.configure(bind=engine)
alembic_run(config_uri) alembic_run(config_uri) # alembicnya ziggurat
Base.metadata.create_all(engine) Base.metadata.create_all(engine)
base_alembic_run(config_uri) alembic_run(config_uri, "alembic_base")
# base_alembic_run(config_uri)
reset_sequences() reset_sequences()
Base.metadata.bind = engine Base.metadata.bind = engine
......
...@@ -33,7 +33,7 @@ requires = [ ...@@ -33,7 +33,7 @@ requires = [
'google-api-python-client', 'google-api-python-client',
'google', 'google',
'pyjwt', 'pyjwt',
'z3c.rml' 'z3c.rml',
'opensipkd-tools @git+https://git.opensipkd.com/aa.gusti/opensipkd-tools.git', 'opensipkd-tools @git+https://git.opensipkd.com/aa.gusti/opensipkd-tools.git',
] ]
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!