about summary refs log tree commit diff
path: root/src/init.sql
diff options
context:
space:
mode:
Diffstat (limited to 'src/init.sql')
-rw-r--r--src/init.sql8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/init.sql b/src/init.sql
index 1439bd338835..117a3bd06f90 100644
--- a/src/init.sql
+++ b/src/init.sql
@@ -9,6 +9,7 @@ BEGIN TRANSACTION;
 DROP TABLE IF EXISTS Accounts;
 DROP TABLE IF EXISTS Trips;
 DROP TABLE IF EXISTS Sessions;
+DROP TABLE IF EXISTS LoginAttempts;
 
 CREATE TABLE Accounts (
 -- TODO(wpcarro): Add CHECK(..) constraint
@@ -38,4 +39,11 @@ CREATE TABLE Sessions (
   FOREIGN KEY (username) REFERENCES Accounts ON DELETE CASCADE
 );
 
+CREATE TABLE LoginAttempts (
+  username TEXT NOT NULL UNIQUE,
+  numAttempts INTEGER NOT NULL,
+  PRIMARY KEY (username),
+  FOREIGN KEY (username) REFERENCES Accounts ON DELETE CASCADE
+);
+
 COMMIT;