Skip to content

Commit 7dc43dd

Browse files
Add LastPasswordReset timestamp column, missing DB version bump
1 parent cd4e7ee commit 7dc43dd

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

sql/migration5.sql

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
BEGIN TRANSACTION;
2-
-- New Column
2+
-- New Columns
33
ALTER TABLE Accounts ADD Email TEXT DEFAULT '' NOT NULL;
4+
ALTER TABLE Accounts ADD LastPasswordReset INTEGER DEFAULT 0 NOT NULL;
5+
-- Update DB Version
6+
UPDATE Meta SET Value = 6 WHERE Key = 'DatabaseVersion';
7+
UPDATE Meta SET Value = strftime('%s', 'now') WHERE Key = 'LastMigration';
48
COMMIT;

sql/tables.sql

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
CREATE TABLE IF NOT EXISTS Accounts (
2-
AccountID INTEGER NOT NULL,
3-
Login TEXT NOT NULL UNIQUE COLLATE NOCASE,
4-
Password TEXT NOT NULL,
5-
Selected INTEGER DEFAULT 1 NOT NULL,
6-
AccountLevel INTEGER NOT NULL,
7-
Created INTEGER DEFAULT (strftime('%s', 'now')) NOT NULL,
8-
LastLogin INTEGER DEFAULT (strftime('%s', 'now')) NOT NULL,
9-
BannedUntil INTEGER DEFAULT 0 NOT NULL,
10-
BannedSince INTEGER DEFAULT 0 NOT NULL,
11-
BanReason TEXT DEFAULT '' NOT NULL,
12-
Email TEXT DEFAULT '' NOT NULL,
2+
AccountID INTEGER NOT NULL,
3+
Login TEXT NOT NULL UNIQUE COLLATE NOCASE,
4+
Password TEXT NOT NULL,
5+
Selected INTEGER DEFAULT 1 NOT NULL,
6+
AccountLevel INTEGER NOT NULL,
7+
Created INTEGER DEFAULT (strftime('%s', 'now')) NOT NULL,
8+
LastLogin INTEGER DEFAULT (strftime('%s', 'now')) NOT NULL,
9+
BannedUntil INTEGER DEFAULT 0 NOT NULL,
10+
BannedSince INTEGER DEFAULT 0 NOT NULL,
11+
BanReason TEXT DEFAULT '' NOT NULL,
12+
Email TEXT DEFAULT '' NOT NULL,
13+
LastPasswordReset INTEGER DEFAULT 0 NOT NULL,
1314
PRIMARY KEY(AccountID AUTOINCREMENT)
1415
);
1516

0 commit comments

Comments
 (0)