This commit is contained in:
2026-08-10 00:23:20 +02:00
parent 2bdcf6528f
commit 6cac64a3f6
63 changed files with 3499 additions and 68 deletions
+45
View File
@@ -121,6 +121,17 @@ def init_db():
_index(db, "comments", "idx_comments_user_uid", ["user_uid"])
_index(db, "comments", "idx_comments_created_at", ["created_at"])
_index(db, "votes", "idx_votes_target", ["target_uid", "target_type"])
messages = get_table("messages")
for column, example in (
("uid", ""),
("sender_uid", ""),
("receiver_uid", ""),
("content", ""),
("read", False),
("created_at", ""),
):
if not messages.has_column(column):
messages.create_column_by_example(column, example)
_index(db, "messages", "idx_messages_sender", ["sender_uid"])
_index(db, "messages", "idx_messages_receiver", ["receiver_uid"])
_index(
@@ -588,6 +599,10 @@ def init_db():
("flag_reason", ""),
("suspended_at", ""),
("suspended_by", ""),
("boot_marker", ""),
("workspace_cpu_millicores", 0),
("workspace_memory_mb", 0),
("workspace_disk_quota_mb", 0),
):
if not instances.has_column(column):
instances.create_column_by_example(column, example)
@@ -628,12 +643,36 @@ def init_db():
("egress_quota_mb", 0),
("idle_stop_minutes", 0),
("retention_days", 0),
("cpu_millicores", 0),
("memory_mb", 0),
("created_at", ""),
("updated_at", ""),
):
if not quota_rules.has_column(column):
quota_rules.create_column_by_example(column, example)
editor_prefs = get_table("workspace_editor_prefs")
for column, example in (
("uid", ""),
("owner_kind", ""),
("owner_id", ""),
("font_size", 0),
("terminal_font_size", 0),
("zoom_level", -99),
("theme", ""),
("layout", ""),
("panel_preset", ""),
("window_mode", ""),
("window_width", 0),
("window_height", 0),
("boot_agent", ""),
("boot_shell", -1),
("created_at", ""),
("updated_at", ""),
):
if not editor_prefs.has_column(column):
editor_prefs.create_column_by_example(column, example)
flags = get_table("workspace_flags")
for column, example in (
("uid", ""),
@@ -666,6 +705,12 @@ def init_db():
"idx_workspace_quota_owner",
["owner_kind", "owner_id"],
)
_index(
db,
"workspace_editor_prefs",
"idx_workspace_editor_prefs_owner",
["owner_kind", "owner_id"],
)
_index(db, "workspace_flags", "idx_workspace_flags_open", ["status", "created_at"])
_index(
db,