diff options
author | Alex Auvolat <alex@adnab.me> | 2020-02-26 20:21:32 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2020-02-26 20:21:32 +0100 |
commit | f675ba57e400d378088d29c08bd5d0bd9126c74b (patch) | |
tree | c5d54b55b9f8a1bbb5e12cafb3da846124a2f821 /db.go | |
parent | d1b66d30883c9e5fda0c4cace494dec74d7df024 (diff) | |
download | easybridge-f675ba57e400d378088d29c08bd5d0bd9126c74b.tar.gz easybridge-f675ba57e400d378088d29c08bd5d0bd9126c74b.zip |
Implement account configuration save/load from db
Diffstat (limited to 'db.go')
-rw-r--r-- | db.go | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -25,6 +25,8 @@ func InitDb() error { return err } + db.AutoMigrate(&DbAccountConfig{}) + db.AutoMigrate(&DbCache{}) db.AutoMigrate(&DbUserMap{}) @@ -42,6 +44,16 @@ func InitDb() error { return nil } +// Account configuration +type DbAccountConfig struct { + gorm.Model + + MxUserID string `gorm:"index:account_mxuserid"` + Name string + Protocol string + Config string +} + // Long-term cache entries type DbCache struct { gorm.Model @@ -56,7 +68,7 @@ type DbUserMap struct { Protocol string UserID connector.UserID - MxUserID string `gorm:"index:mxuserid"` + MxUserID string `gorm:"index:usermap_mxuserid"` } // Room mapping between Matrix rooms and outside rooms |