diff --git a/server/resource.go b/server/resource.go index 2cec7880..141efb32 100644 --- a/server/resource.go +++ b/server/resource.go @@ -3,7 +3,7 @@ package server import ( "encoding/json" "fmt" - "io/ioutil" + "io" "net/http" "strconv" @@ -39,7 +39,7 @@ func (s *Server) registerResourceRoutes(g *echo.Group) { } defer src.Close() - fileBytes, err := ioutil.ReadAll(src) + fileBytes, err := io.ReadAll(src) if err != nil { return echo.NewHTTPError(http.StatusInternalServerError, "Failed to read file").SetInternal(err) } diff --git a/store/db/migration/prod/LATEST__SCHEMA.sql b/store/db/migration/prod/LATEST__SCHEMA.sql index ca0bb148..5c1bc47e 100644 --- a/store/db/migration/prod/LATEST__SCHEMA.sql +++ b/store/db/migration/prod/LATEST__SCHEMA.sql @@ -3,6 +3,7 @@ DROP TABLE IF EXISTS `memo_organizer`; DROP TABLE IF EXISTS `memo`; DROP TABLE IF EXISTS `shortcut`; DROP TABLE IF EXISTS `resource`; +DROP TABLE IF EXISTS `user_setting`; DROP TABLE IF EXISTS `user`; -- user @@ -139,3 +140,13 @@ SET WHERE rowid = old.rowid; END; + +-- 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);