2024-03-12 20:44:54 +01:00
|
|
|
-- It is unclear weather this table will be used
|
|
|
|
|
|
|
|
-- Create the table to store hash salts
|
2024-03-16 17:32:51 +01:00
|
|
|
CREATE TABLE IF NOT EXISTS salts (
|
2024-03-12 20:44:54 +01:00
|
|
|
id INTEGER PRIMARY KEY,
|
|
|
|
salt TEXT NOT NULL
|
|
|
|
);
|
|
|
|
|
2024-03-13 11:46:17 +01:00
|
|
|
-- Commented out for now, no time for good practices, which is atrocious
|
2024-03-12 20:44:54 +01:00
|
|
|
-- Create a trigger to automatically generate a salt when inserting a new user record
|
2024-03-13 11:46:17 +01:00
|
|
|
-- CREATE TRIGGER generate_salt_trigger
|
|
|
|
-- AFTER INSERT ON users
|
|
|
|
-- BEGIN
|
|
|
|
-- INSERT INTO salts (salt) VALUES (randomblob(16));
|
|
|
|
-- UPDATE users SET salt_id = (SELECT last_insert_rowid()) WHERE id = new.id;
|
|
|
|
-- END;
|