Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
aa.gusti
/
opensipkd-base
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 314994c5
authored
Aug 01, 2022
by
aagusti
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'latest' of
https://git.opensipkd.com/aa.gusti/opensipkd-base
into latest
2 parents
46c58fc4
b30f87ba
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
9 deletions
opensipkd/base/scripts/initializedb.py
setup.py
opensipkd/base/scripts/initializedb.py
View file @
314994c
...
@@ -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
...
...
setup.py
View file @
314994c
...
@@ -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'
,
]
]
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment