feat(database): regenerated the sql code and fixed autoincrement on text column
This commit is contained in:
parent
8e4081f494
commit
bca385adc9
2 changed files with 5 additions and 4 deletions
|
|
@ -16,7 +16,7 @@ Project Transcendance {
|
|||
}
|
||||
|
||||
Table user {
|
||||
id integer [PK, not null, increment]
|
||||
id text [PK, not null]
|
||||
name text [unique, not null]
|
||||
password text [null, Note: "If password is NULL, this means that the user is created through OAUTH2"]
|
||||
otp text [null, Note: "If otp is NULL, then the user didn't configure 2FA"]
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
CREATE TABLE IF NOT EXISTS user (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
id TEXT PRIMARY KEY NOT NULL,
|
||||
name TEXT NOT NULL UNIQUE,
|
||||
password TEXT,
|
||||
otp TEXT
|
||||
otp TEXT,
|
||||
guest INTEGER NOT NULL DEFAULT 0
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS auth (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
provider TEXT NOT NULL,
|
||||
user INTEGER NOT NULL,
|
||||
user TEXT NOT NULL,
|
||||
oauth2_user TEXT NOT NULL UNIQUE,
|
||||
FOREIGN KEY(user) REFERENCES user(id)
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue