I see. I would consider doing the hashing, though. It would avoid you adding an additional index on
I see. I would consider doing the hashing, though. It would avoid you adding an additional index on a pretty long column.





CREATE TABLE IF NOT EXISTS project (
id INTEGER NOT NULL PRIMARY KEY,
name TEXT NOT NULL,
slug TEXT NOT NULL UNIQUE,
ownerId TEXT NOT NULL,
createdAt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updatedAt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP);
CREATE TRIGGER IF NOT EXISTS project_updatedAt
AFTER UPDATE ON project
FOR EACH ROW
BEGIN
UPDATE project SET updatedAt = CURRENT_TIMESTAMP WHERE id = OLD.id;
END;