From 254a5eda7d17ff28d4604d95dba6f102120189b8 Mon Sep 17 00:00:00 2001 From: Botond Hende Date: Sat, 31 Aug 2024 01:06:58 +0200 Subject: ship data initialization on startup --- __main__.py | 2 ++ 1 file changed, 2 insertions(+) (limited to '__main__.py') diff --git a/__main__.py b/__main__.py index 9b23484..03fb366 100644 --- a/__main__.py +++ b/__main__.py @@ -11,6 +11,8 @@ from .modules.database import cursor, conn async def lifespan(app: FastAPI): cursor.execute( "CREATE TABLE IF NOT EXISTS agents(primary_key INTEGER PRIMARY KEY, callsign TEXT NOT NULL UNIQUE, token TEXT NOT NULL)") + cursor.execute( + "CREATE TABLE IF NOT EXISTS ships(primary_key INTEGER PRIMARY KEY, symbol TEXT NOT NULL UNIQUE, task TEXT NOT NULL, params TEXT)") conn.commit() agents.load_agents_from_database() yield -- cgit v1.2.3-70-g09d2