Skip to content

Commit

Permalink
set server defaults for all tables (teaxyz#11)
Browse files Browse the repository at this point in the history
* set server defaults for all tables

* dependencies.id, and remove accidental column drop
  • Loading branch information
sanchitram1 authored Oct 18, 2024
1 parent 1f554e5 commit 662ecbb
Show file tree
Hide file tree
Showing 3 changed files with 791 additions and 45 deletions.
10 changes: 8 additions & 2 deletions alembic/env.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import os
from logging.config import fileConfig

from alembic import context
from sqlalchemy import engine_from_config, pool

from alembic import context
from src.pipeline.models import Base

# this is the Alembic Config object, which provides
Expand Down Expand Up @@ -39,6 +40,7 @@ def run_migrations_offline() -> None:
target_metadata=target_metadata,
literal_binds=True,
dialect_opts={"paramstyle": "named"},
compare_server_default=True,
)

with context.begin_transaction():
Expand All @@ -58,7 +60,11 @@ def run_migrations_online() -> None:
)

with connectable.connect() as connection:
context.configure(connection=connection, target_metadata=target_metadata)
context.configure(
connection=connection,
target_metadata=target_metadata,
compare_server_default=True,
)

with context.begin_transaction():
context.run_migrations()
Expand Down
Loading

0 comments on commit 662ecbb

Please sign in to comment.