aboutsummaryrefslogtreecommitdiff
path: root/app/db.py
diff options
context:
space:
mode:
authorParker <contact@pkrm.dev>2024-02-26 20:55:05 -0600
committerParker <contact@pkrm.dev>2024-02-26 20:55:05 -0600
commitbce756b9aa51dfdfa2c2e6cdef4f88f660b80148 (patch)
treed2e7a238b04d4339bedf05f626bff15d48a61945 /app/db.py
parenta0bfa5440603841c40e6a29495ca49c09a5d8c83 (diff)
Overhaul: Flask -> FastAPI
Diffstat (limited to 'app/db.py')
-rw-r--r--app/db.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/db.py b/app/db.py
index c2ceb8b..1750472 100644
--- a/app/db.py
+++ b/app/db.py
@@ -12,7 +12,7 @@ def init_db():
with engine.begin() as conn:
conn.execute(sqlalchemy.text(
'''
- CREATE TABLE IF NOT EXISTS accounts (
+ CREATE TABLE IF NOT EXISTS keys (
api_key, PRIMARY KEY (api_key)
)
'''
@@ -21,7 +21,7 @@ def init_db():
'''
CREATE TABLE IF NOT EXISTS links (
owner, link, redirect_link, expire_date,
- FOREIGN KEY (owner) REFERENCES accounts(api_key), PRIMARY KEY (link)
+ FOREIGN KEY (owner) REFERENCES keys(api_key), PRIMARY KEY (link)
)
'''
))