mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-05-06 13:01:50 +02:00
Direct Alembic to ignore the sqlite_sequence table
This commit is contained in:
parent
91ef80ebb7
commit
0825fd1c8f
1 changed files with 8 additions and 1 deletions
|
@ -41,7 +41,7 @@ def run_migrations_offline():
|
|||
|
||||
"""
|
||||
url = config.get_main_option("sqlalchemy.url")
|
||||
context.configure(url=url)
|
||||
context.configure(url=url, include_object=include_object)
|
||||
|
||||
with context.begin_transaction():
|
||||
context.run_migrations()
|
||||
|
@ -75,6 +75,7 @@ def run_migrations_online():
|
|||
context.configure(
|
||||
connection=connection,
|
||||
target_metadata=target_metadata,
|
||||
include_object=include_object,
|
||||
process_revision_directives=process_revision_directives,
|
||||
**current_app.extensions["migrate"].configure_args
|
||||
)
|
||||
|
@ -86,6 +87,12 @@ def run_migrations_online():
|
|||
connection.close()
|
||||
|
||||
|
||||
def include_object(object, name, type_, reflected, compare_to):
|
||||
if name == "sqlite_sequence":
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
if context.is_offline_mode():
|
||||
run_migrations_offline()
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue