Merge pull request #1134 from moonstream-to/set-version-schema

Set schema for version table
pull/1130/head^2 moonstreamdbv3/v0.0.21
Sergei Sumarokov 2024-10-16 16:26:10 +03:00 zatwierdzone przez GitHub
commit 5dad0a3f4e
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
3 zmienionych plików z 9 dodań i 1 usunięć

Wyświetl plik

@ -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,
)

Wyświetl plik

@ -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

Wyświetl plik

@ -1 +1 @@
0.0.20
0.0.21