Remove wwwroot/ from .gitignore so production deployment is just git pull. Changes: - wwwroot/index.ui: Shell layout with sidebar and main content - wwwroot/global_menu.ui: Global navigation menu (22 modules) - wwwroot/dashboard_for_sage/: Dashboard widgets and stats - wwwroot/product_management/: Product management pages - Module symlinks (accounting, rbac, bricks, etc.) Ignored: .DS_Store, *.bak, tmp/
45 lines
1.3 KiB
Plaintext
45 lines
1.3 KiB
Plaintext
dbname = get_module_dbname('llmage')
|
|
db = DBPools()
|
|
async with db.sqlorContext(dbname) as sor:
|
|
# Create table
|
|
sql = """
|
|
CREATE TABLE IF NOT EXISTS llm_catalog_rel (
|
|
id VARCHAR(32) NOT NULL PRIMARY KEY,
|
|
llmid VARCHAR(32) NOT NULL,
|
|
llmcatelogid VARCHAR(32) NOT NULL,
|
|
INDEX idx_llm (llmid),
|
|
INDEX idx_catelog (llmcatelogid)
|
|
)
|
|
"""
|
|
try:
|
|
await sor.sqlExe(sql, {})
|
|
print("Table llm_catalog_rel created or exists.")
|
|
except Exception as e:
|
|
print(f"Create table error: {e}")
|
|
|
|
# Migrate data
|
|
sql = "select id, llmcatelogid from llm where llmcatelogid is not null and llmcatelogid != ''"
|
|
rows = await sor.sqlExe(sql, {})
|
|
print(f"Found {len(rows)} records to migrate.")
|
|
|
|
for r in rows:
|
|
data = {
|
|
'llmid': r['id'],
|
|
'llmcatelogid': r['llmcatelogid']
|
|
}
|
|
try:
|
|
await sor.C('llm_catalog_rel', data)
|
|
except Exception as e:
|
|
print(f"Insert error: {e}")
|
|
|
|
print("Migration complete.")
|
|
|
|
# Drop column
|
|
try:
|
|
await sor.sqlExe("alter table llm drop column llmcatelogid", {})
|
|
print("Column llmcatelogid dropped.")
|
|
except Exception as e:
|
|
print(f"Drop column error: {e}")
|
|
|
|
return {'status': 'ok'}
|