diff options
author | Frédéric Guillot <fguillot@users.noreply.github.com> | 2014-04-19 22:12:12 -0400 |
---|---|---|
committer | Frédéric Guillot <fguillot@users.noreply.github.com> | 2014-04-19 22:12:12 -0400 |
commit | a04ecbde778decfdea7200806a6b1144861ae05f (patch) | |
tree | e4670e3013734d9c7bd201f5d6ef1fbaae13d3b5 /schemas/sqlite.php | |
parent | 5aacb6a76351889a6ec5ed01c8e80f139c2b2027 (diff) |
Add RememberMe feature and authentications history
Diffstat (limited to 'schemas/sqlite.php')
-rw-r--r-- | schemas/sqlite.php | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/schemas/sqlite.php b/schemas/sqlite.php index 26ae09f7..4a69751c 100644 --- a/schemas/sqlite.php +++ b/schemas/sqlite.php @@ -2,6 +2,37 @@ namespace Schema; +function version_12($pdo) +{ + $pdo->exec( + 'CREATE TABLE remember_me ( + id INTEGER PRIMARY KEY, + user_id INTEGER, + ip TEXT, + user_agent TEXT, + token TEXT, + sequence TEXT, + expiration INTEGER, + date_creation INTEGER, + FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE CASCADE + )' + ); + + $pdo->exec( + 'CREATE TABLE last_logins ( + id INTEGER PRIMARY KEY, + auth_type TEXT, + user_id INTEGER, + ip TEXT, + user_agent TEXT, + date_creation INTEGER, + FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE CASCADE + )' + ); + + $pdo->exec('CREATE INDEX last_logins_user_idx ON last_logins(user_id)'); +} + function version_11($pdo) { $pdo->exec( |