Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 27fe8c24ec | |||
| eef1e4e8c6 |
@@ -20,7 +20,7 @@ depends_on: Sequence[str] | None = None
|
||||
def upgrade() -> None:
|
||||
conn = op.get_bind()
|
||||
|
||||
# Find code-server tool types with broken command overrides
|
||||
# Fix tool_types templates in DB
|
||||
result = conn.execute(
|
||||
sa.text("""
|
||||
SELECT id, compose_template
|
||||
@@ -64,12 +64,23 @@ def upgrade() -> None:
|
||||
)
|
||||
print(f"Removed broken command override from LSIO template ({tool_id})")
|
||||
|
||||
# Also clean up existing instance compose files on disk
|
||||
# Fix existing instance compose files on disk
|
||||
# Use information_schema to check if compose_path column exists
|
||||
col_result = conn.execute(
|
||||
sa.text("""
|
||||
SELECT column_name
|
||||
FROM information_schema.columns
|
||||
WHERE table_name = 'tool_instances'
|
||||
AND column_name = 'compose_path'
|
||||
""")
|
||||
).fetchone()
|
||||
|
||||
if col_result:
|
||||
result = conn.execute(
|
||||
sa.text("""
|
||||
SELECT id, compose_file_path
|
||||
SELECT id, compose_path
|
||||
FROM tool_instances
|
||||
WHERE compose_file_path IS NOT NULL
|
||||
WHERE compose_path IS NOT NULL
|
||||
""")
|
||||
).fetchall()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user