blueprint function
This commit is contained in:
10
db.py
10
db.py
@@ -92,6 +92,16 @@ def init_db():
|
||||
''')
|
||||
c.execute('CREATE INDEX IF NOT EXISTS idx_bot_logs_player_feature ON bot_logs(player_id, feature)')
|
||||
|
||||
# Blueprints - assigns a blueprint to a specific town
|
||||
c.execute('''
|
||||
CREATE TABLE IF NOT EXISTS town_blueprints (
|
||||
town_id TEXT PRIMARY KEY,
|
||||
blueprint_name TEXT NOT NULL,
|
||||
is_active INTEGER NOT NULL DEFAULT 1,
|
||||
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',
|
||||
|
||||
Reference in New Issue
Block a user