-
-
Save reosarevok/67bc8f1cc09b589cd76612ac5783ca50 to your computer and use it in GitHub Desktop.
edit_note_change
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TYPE edit_note_status AS ENUM ('deleted', 'edited'); | |
CREATE TABLE edit_note_change | |
( | |
id SERIAL, -- PK | |
status edit_note_status, | |
edit_note INTEGER NOT NULL, -- references edit_note.id | |
changing_editor INTEGER NOT NULL, -- references editor.id | |
change_time TIMESTAMP WITH TIME ZONE DEFAULT NOW(), | |
old_note TEXT NOT NULL, | |
new_note TEXT NOT NULL, | |
reason TEXT NOT NULL DEFAULT '', | |
); |
I'd rather have an empty string, but I'll change to TEXT NOT NULL DEFAULT ''
Maybe change_by_admin
ought to be the ID of the editor who changed the note instead? Since it might be useful sometimes to know which admin changed something.
Ok, we considered that as an option but wasn't sure if needed, but I guess it can't hurt :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Would it make sense to allow
reason
to beNULL
for cases where no reason was provided? Or is it better to just have an empty string?