feat: Initial commit for GrimHold with requirements and INSTALL.md

This commit is contained in:
kobold-ai
2026-10-29 08:52:34 +01:00
commit dd8be9da06
17 changed files with 9772 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
import sqlite3
import os
DB_PATH = "/home/maxi/Projekt/grimhold.waiswuaschd.de/data/grimhold.db"
def migrate():
conn = sqlite3.connect(DB_PATH)
cur = conn.cursor()
cur.execute("PRAGMA table_info(users)")
cols = [r[1] for r in cur.fetchall()]
print("Users cols:", cols)
if "max_building_slots" not in cols:
print("Adding max_building_slots column...")
cur.execute("ALTER TABLE users ADD COLUMN max_building_slots INTEGER NOT NULL DEFAULT 8")
# Set existing maze_tiles outside 16x10 bounds to be deleted or trimmed so they don't break the new grid
cur.execute("DELETE FROM maze_tiles WHERE x >= 16 OR y >= 10")
print("Cleaned up tiles outside 16x10 bounds.")
conn.commit()
conn.close()
print("Migration successful!")
if __name__ == "__main__":
migrate()