PGP import feature

This commit is contained in:
nemunaire 2022-09-03 16:16:41 +02:00
parent 9436220685
commit de4bb43e86
12 changed files with 547 additions and 0 deletions

12
db.go
View file

@ -74,6 +74,18 @@ CREATE TABLE IF NOT EXISTS user_sessions(
time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY(id_user) REFERENCES users(id_user)
) DEFAULT CHARACTER SET = utf8 COLLATE = utf8_bin;
`); err != nil {
return err
}
if _, err := db.Exec(`
CREATE TABLE IF NOT EXISTS user_keys(
id_key INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
id_user INTEGER NOT NULL,
type ENUM('pgp', 'ssh') NOT NULL,
content TEXT NOT NULL,
time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY(id_user) REFERENCES users(id_user)
) DEFAULT CHARACTER SET = utf8 COLLATE = utf8_bin;
`); err != nil {
return err
}