Updated formatting of queries

This commit is contained in:
Gourav Kumar 2024-06-21 16:21:06 +05:30
parent 4ef416f3ee
commit 91ac771400

View File

@ -37,10 +37,10 @@ def create_user_table():
def create_keys_table():
query = """
create table if not exists keys (
user_id INTEGER,
encryption_key TEXT,
encryption_key_salt TEXT,
FOREIGN KEY (user_id) REFERENCES users (id)
user_id INTEGER,
encryption_key TEXT,
encryption_key_salt TEXT,
FOREIGN KEY (user_id) REFERENCES users (id)
ON DELETE CASCADE
)
"""
@ -58,13 +58,13 @@ def create_keys_table():
def create_secrets_table():
query = """
create table if not exists secrets (
id INTEGER PRIMARY KEY AUTOINCREMENT,
user_id INTEGER,
data TEXT NOT NULL,
added_on TEXT DEFAULT CURRENT_TIMESTAMP,
id INTEGER PRIMARY KEY AUTOINCREMENT,
user_id INTEGER,
data TEXT NOT NULL,
added_on TEXT DEFAULT CURRENT_TIMESTAMP,
modified_on TEXT,
active BOOLEAN DEFAULT TRUE,
FOREIGN KEY (user_id) REFERENCES users(id)
active BOOLEAN DEFAULT TRUE,
FOREIGN KEY (user_id) REFERENCES users(id)
ON DELETE CASCADE
)
"""