memos/store/db/migration/prod/0.4/00__user_setting.sql
boojack 90b881502d
feat: add user_setting model (#145)
* feat: add `user_setting` model

* chore: add global store

* chore: update settings in web

* chore: update `i18n` example
2022-08-13 14:35:33 +08:00

9 lines
263 B
SQL

-- user_setting
CREATE TABLE user_setting (
user_id INTEGER NOT NULL,
key TEXT NOT NULL,
value TEXT NOT NULL,
FOREIGN KEY(user_id) REFERENCES user(id) ON DELETE CASCADE
);
CREATE UNIQUE INDEX user_setting_key_user_id_index ON user_setting(key, user_id);