MCPcopy Index your code
hub / github.com/AutoForgeAI/autoforge / _migrate_add_dependencies_column

Function _migrate_add_dependencies_column

api/database.py:222–236  ·  view source on GitHub ↗

Add dependencies column to existing databases that don't have it. Uses NULL default for backwards compatibility - existing features without dependencies will have NULL which is treated as empty list.

(engine)

Source from the content-addressed store, hash-verified

220
221
222def _migrate_add_dependencies_column(engine) -> None:
223 """Add dependencies column to existing databases that don't have it.
224
225 Uses NULL default for backwards compatibility - existing features
226 without dependencies will have NULL which is treated as empty list.
227 """
228 with engine.connect() as conn:
229 # Check if column exists
230 result = conn.execute(text("PRAGMA table_info(features)"))
231 columns = [row[1] for row in result.fetchall()]
232
233 if "dependencies" not in columns:
234 # Use TEXT for SQLite JSON storage, NULL default for backwards compat
235 conn.execute(text("ALTER TABLE features ADD COLUMN dependencies TEXT DEFAULT NULL"))
236 conn.commit()
237
238
239def _migrate_add_testing_columns(engine) -> None:

Callers 1

create_databaseFunction · 0.85

Calls 1

connectMethod · 0.80

Tested by

no test coverage detected