Add default value for autoconf

pull/26/head
Guillermo Rodriguez 2023-10-08 11:06:06 -03:00
parent cadd723191
commit 50ae61c7b2
No known key found for this signature in database
GPG Key ID: EC3AB66D5D83B392
1 changed files with 2 additions and 1 deletions

View File

@ -43,6 +43,7 @@ CREATE TABLE IF NOT EXISTS skynet.user_config(
guidance DECIMAL NOT NULL, guidance DECIMAL NOT NULL,
strength DECIMAL NOT NULL, strength DECIMAL NOT NULL,
upscaler VARCHAR(128), upscaler VARCHAR(128),
autoconf BOOLEAN DEFAULT TRUE,
CONSTRAINT fk_config CONSTRAINT fk_config
FOREIGN KEY(id) FOREIGN KEY(id)
REFERENCES skynet.user(id) REFERENCES skynet.user(id)
@ -172,7 +173,7 @@ async def open_database_connection(
''') ''')
if not col_check: if not col_check:
await conn.execute('alter table skynet.user_config add column autoconf boolean;') await conn.execute('alter table skynet.user_config add column autoconf boolean default true;')
async def _db_call(method: str, *args, **kwargs): async def _db_call(method: str, *args, **kwargs):
method = getattr(db, method) method = getattr(db, method)