TTime/backend/internal/database/migrations/0070_salts.sql

17 lines
560 B
MySQL
Raw Normal View History

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
);
-- 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
-- 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;