MCPcopy Index your code
hub / github.com/TaskingAI/TaskingAI / get_current_version

Function get_current_version

backend/tkhelper/database/postgres/migrate.py:30–44  ·  view source on GitHub ↗

Get current migration version :param conn: asyncpg database connection :return: current migration version, if not exists, return 0

(
    conn,
)

Source from the content-addressed store, hash-verified

28
29
30async def get_current_version(
31 conn,
32):
33 """
34 Get current migration version
35 :param conn: asyncpg database connection
36 :return: current migration version, if not exists, return 0
37 """
38 try:
39 await create_migration_table(conn)
40 result = await conn.fetchval(f"SELECT MAX(version) FROM {MIGRATION_TABLE}")
41 return result or 0
42 except Exception as e:
43 logger.error(f"Error fetching current version: {e}")
44 return 0
45
46
47async def apply_migration(

Callers 1

migrate_if_neededFunction · 0.85

Calls 1

create_migration_tableFunction · 0.85

Tested by

no test coverage detected