Skip to content

Commit 805ad97

Browse files
authored
add alembic include scehmas (#6036)
1 parent 9a817b4 commit 805ad97

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

reflex/environment.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,9 @@ class EnvironmentVariables:
583583
# Path to the alembic config file
584584
ALEMBIC_CONFIG: EnvVar[ExistingPath] = env_var(Path(constants.ALEMBIC_CONFIG))
585585

586+
# Include schemas in alembic migrations.
587+
ALEMBIC_INCLUDE_SCHEMAS: EnvVar[bool] = env_var(False)
588+
586589
# Disable SSL verification for HTTPX requests.
587590
SSL_NO_VERIFY: EnvVar[bool] = env_var(False)
588591

reflex/model.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,7 @@ def run_autogenerate(rev: str, context: MigrationContext):
518518
render_item=cls._alembic_render_item,
519519
process_revision_directives=writer,
520520
compare_type=False,
521+
include_schemas=environment.ALEMBIC_INCLUDE_SCHEMAS.get(),
521522
render_as_batch=True, # for sqlite compatibility
522523
)
523524
env.run_migrations()

0 commit comments

Comments
 (0)