aboutsummaryrefslogtreecommitdiff
path: root/migrations/auth/20221103_02_sGrIs-create-user-credentials-table.py
diff options
context:
space:
mode:
Diffstat (limited to 'migrations/auth/20221103_02_sGrIs-create-user-credentials-table.py')
-rw-r--r--migrations/auth/20221103_02_sGrIs-create-user-credentials-table.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/migrations/auth/20221103_02_sGrIs-create-user-credentials-table.py b/migrations/auth/20221103_02_sGrIs-create-user-credentials-table.py
new file mode 100644
index 0000000..48bd663
--- /dev/null
+++ b/migrations/auth/20221103_02_sGrIs-create-user-credentials-table.py
@@ -0,0 +1,20 @@
+"""
+create user_credentials table
+"""
+
+from yoyo import step
+
+__depends__ = {'20221103_01_js9ub-initialise-the-auth-entic-oris-ation-database'}
+
+steps = [
+ step(
+ """
+ CREATE TABLE IF NOT EXISTS user_credentials(
+ user_id TEXT PRIMARY KEY,
+ password TEXT NOT NULL,
+ FOREIGN KEY(user_id) REFERENCES users(user_id)
+ ON UPDATE CASCADE ON DELETE RESTRICT
+ ) WITHOUT ROWID
+ """,
+ "DROP TABLE IF EXISTS user_credentials")
+]