Updated formatting of queries
This commit is contained in:
parent
4ef416f3ee
commit
91ac771400
20
migration.py
20
migration.py
@ -37,10 +37,10 @@ def create_user_table():
|
|||||||
def create_keys_table():
|
def create_keys_table():
|
||||||
query = """
|
query = """
|
||||||
create table if not exists keys (
|
create table if not exists keys (
|
||||||
user_id INTEGER,
|
user_id INTEGER,
|
||||||
encryption_key TEXT,
|
encryption_key TEXT,
|
||||||
encryption_key_salt TEXT,
|
encryption_key_salt TEXT,
|
||||||
FOREIGN KEY (user_id) REFERENCES users (id)
|
FOREIGN KEY (user_id) REFERENCES users (id)
|
||||||
ON DELETE CASCADE
|
ON DELETE CASCADE
|
||||||
)
|
)
|
||||||
"""
|
"""
|
||||||
@ -58,13 +58,13 @@ def create_keys_table():
|
|||||||
def create_secrets_table():
|
def create_secrets_table():
|
||||||
query = """
|
query = """
|
||||||
create table if not exists secrets (
|
create table if not exists secrets (
|
||||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
user_id INTEGER,
|
user_id INTEGER,
|
||||||
data TEXT NOT NULL,
|
data TEXT NOT NULL,
|
||||||
added_on TEXT DEFAULT CURRENT_TIMESTAMP,
|
added_on TEXT DEFAULT CURRENT_TIMESTAMP,
|
||||||
modified_on TEXT,
|
modified_on TEXT,
|
||||||
active BOOLEAN DEFAULT TRUE,
|
active BOOLEAN DEFAULT TRUE,
|
||||||
FOREIGN KEY (user_id) REFERENCES users(id)
|
FOREIGN KEY (user_id) REFERENCES users(id)
|
||||||
ON DELETE CASCADE
|
ON DELETE CASCADE
|
||||||
)
|
)
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user