update add modules

This commit is contained in:
2026-04-23 18:45:54 +03:00
parent aec99fa00d
commit 54ec9a3db6
6 changed files with 826 additions and 10 deletions

10
db.py
View File

@@ -55,6 +55,16 @@ def init_db():
)
''')
# Farm settings — per-player auto-farm configuration
c.execute('''
CREATE TABLE IF NOT EXISTS farm_settings (
player_id TEXT PRIMARY KEY,
enabled INTEGER NOT NULL DEFAULT 0,
loot_option INTEGER NOT NULL DEFAULT 1, -- 1=5min, 2=20min, 3=90min, 4=4h
updated_at TEXT NOT NULL DEFAULT (datetime('now'))
)
''')
# Migration: add new columns if upgrading an existing database
for _col in [
'ALTER TABLE town_state ADD COLUMN player_id TEXT',