mirror of
https://github.com/WGDashboard/WGDashboard.git
synced 2026-12-01 17:07:47 +00:00
fix: handle instantiated SQLAlchemy column types (#1400)
This commit is contained in:
@@ -145,7 +145,9 @@ class DashboardConfig:
|
|||||||
|
|
||||||
for col_name, col_type in expected_columns.items():
|
for col_name, col_type in expected_columns.items():
|
||||||
if col_name not in existing_columns:
|
if col_name not in existing_columns:
|
||||||
type_str = col_type().compile(dialect=self.engine.dialect)
|
type_str = (
|
||||||
|
col_type if isinstance(col_type, db.types.TypeEngine) else col_type()
|
||||||
|
).compile(dialect=self.engine.dialect)
|
||||||
current_app.logger.info(f"Adding missing column '{col_name}' to table '{table_name}'")
|
current_app.logger.info(f"Adding missing column '{col_name}' to table '{table_name}'")
|
||||||
preparer = self.engine.dialect.identifier_preparer
|
preparer = self.engine.dialect.identifier_preparer
|
||||||
quoted_table = preparer.quote_identifier(table_name)
|
quoted_table = preparer.quote_identifier(table_name)
|
||||||
|
|||||||
Reference in New Issue
Block a user