kopia lustrzana https://github.com/bugout-dev/moonstream
Merge pull request #1134 from moonstream-to/set-version-schema
Set schema for version tablepull/1130/head^2 moonstreamdbv3/v0.0.21
commit
5dad0a3f4e
|
@ -25,6 +25,7 @@ target_metadata = MoonstreamBase.metadata
|
|||
# my_important_option = config.get_main_option("my_important_option")
|
||||
# ... etc.
|
||||
from moonstreamdbv3.models import (
|
||||
MOONSTREAM_DB_V3_SCHEMA_NAME,
|
||||
AmoyLabel,
|
||||
ArbitrumNovaLabel,
|
||||
ArbitrumOneLabel,
|
||||
|
@ -112,6 +113,7 @@ def run_migrations_offline() -> None:
|
|||
literal_binds=True,
|
||||
dialect_opts={"paramstyle": "named"},
|
||||
version_table="alembic_version",
|
||||
version_table_schema=MOONSTREAM_DB_V3_SCHEMA_NAME,
|
||||
include_schemas=True,
|
||||
include_symbol=include_symbol,
|
||||
)
|
||||
|
@ -138,6 +140,7 @@ def run_migrations_online() -> None:
|
|||
connection=connection,
|
||||
target_metadata=target_metadata,
|
||||
version_table="alembic_version",
|
||||
version_table_schema=MOONSTREAM_DB_V3_SCHEMA_NAME,
|
||||
include_schemas=True,
|
||||
include_symbol=include_symbol,
|
||||
)
|
||||
|
|
|
@ -15,6 +15,7 @@ Example of label_data column record:
|
|||
}
|
||||
"""
|
||||
|
||||
import os
|
||||
import uuid
|
||||
|
||||
from sqlalchemy import (
|
||||
|
@ -56,6 +57,10 @@ Following:
|
|||
3. https://stackoverflow.com/a/33532154/13659585
|
||||
"""
|
||||
|
||||
MOONSTREAM_DB_V3_SCHEMA_NAME = os.environ.get(
|
||||
"MOONSTREAM_DB_V3_SCHEMA_NAME", "blockchain"
|
||||
)
|
||||
|
||||
|
||||
class utcnow(expression.FunctionElement):
|
||||
type = DateTime # type: ignore
|
||||
|
|
|
@ -1 +1 @@
|
|||
0.0.20
|
||||
0.0.21
|
||||
|
|
Ładowanie…
Reference in New Issue