Skip to content

Commit

Permalink
feat: add history table column comparison with normal table
Browse files Browse the repository at this point in the history
  • Loading branch information
lchen-2101 committed Feb 14, 2024
1 parent 761d366 commit ef60c5c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/migrations/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,16 @@ def test_fi_versioning_tables_3f893e52d05c(alembic_runner: MigrationContext, ale
assert "version" in [column.get("name") for column in fi_columns]
mapping_columns = inspector.get_columns("fi_to_type_mapping")
assert "version" in [column.get("name") for column in mapping_columns]


def test_fi_history_table_columns_8106d83ff594(alembic_runner: MigrationContext, alembic_engine: Engine):
alembic_runner.migrate_up_to("8106d83ff594")
inspector = sqlalchemy.inspect(alembic_engine)
fi_columns = inspector.get_columns("financial_institutions")
mapping_columns = inspector.get_columns("fi_to_type_mapping")
fi_history_columns = inspector.get_columns("financial_institutions_history")
mapping_history_columns = inspector.get_columns("fi_to_type_mapping_history")
assert {column.get("name") for column in fi_columns}.issubset({column.get("name") for column in fi_history_columns})
assert {column.get("name") for column in mapping_columns}.issubset(
{column.get("name") for column in mapping_history_columns}
)

0 comments on commit ef60c5c

Please sign in to comment.