Work on failed outbound requests and move type migrators
- DB type migrators are now in separate file, in preparation for full custom sql migration statements - Start work on handling failed outbound requests stored in the db
This commit is contained in:
parent
81a01fbf8b
commit
7ac4c628b8
13 changed files with 372 additions and 145 deletions
|
@ -55,6 +55,8 @@ func newRole(db *gorm.DB, opts ...gen.DOOption) role {
|
|||
_role.CanMentionOthers = field.NewBool(tableName, "can_mention_others")
|
||||
_role.HasMentionCountLimit = field.NewBool(tableName, "has_mention_count_limit")
|
||||
_role.MentionLimit = field.NewUint32(tableName, "mention_limit")
|
||||
_role.MaxIndividualFileSize = field.NewUint64(tableName, "max_individual_file_size")
|
||||
_role.MaxTotalFileSize = field.NewUint64(tableName, "max_total_file_size")
|
||||
_role.AutoNsfwMedia = field.NewBool(tableName, "auto_nsfw_media")
|
||||
_role.AutoCwPosts = field.NewBool(tableName, "auto_cw_posts")
|
||||
_role.AutoCwPostsText = field.NewString(tableName, "auto_cw_posts_text")
|
||||
|
@ -118,6 +120,8 @@ type role struct {
|
|||
CanMentionOthers field.Bool
|
||||
HasMentionCountLimit field.Bool
|
||||
MentionLimit field.Uint32
|
||||
MaxIndividualFileSize field.Uint64
|
||||
MaxTotalFileSize field.Uint64
|
||||
AutoNsfwMedia field.Bool
|
||||
AutoCwPosts field.Bool
|
||||
AutoCwPostsText field.String
|
||||
|
@ -187,6 +191,8 @@ func (r *role) updateTableName(table string) *role {
|
|||
r.CanMentionOthers = field.NewBool(table, "can_mention_others")
|
||||
r.HasMentionCountLimit = field.NewBool(table, "has_mention_count_limit")
|
||||
r.MentionLimit = field.NewUint32(table, "mention_limit")
|
||||
r.MaxIndividualFileSize = field.NewUint64(table, "max_individual_file_size")
|
||||
r.MaxTotalFileSize = field.NewUint64(table, "max_total_file_size")
|
||||
r.AutoNsfwMedia = field.NewBool(table, "auto_nsfw_media")
|
||||
r.AutoCwPosts = field.NewBool(table, "auto_cw_posts")
|
||||
r.AutoCwPostsText = field.NewString(table, "auto_cw_posts_text")
|
||||
|
@ -228,7 +234,7 @@ func (r *role) GetFieldByName(fieldName string) (field.OrderExpr, bool) {
|
|||
}
|
||||
|
||||
func (r *role) fillFieldMap() {
|
||||
r.fieldMap = make(map[string]field.Expr, 53)
|
||||
r.fieldMap = make(map[string]field.Expr, 55)
|
||||
r.fieldMap["id"] = r.ID
|
||||
r.fieldMap["created_at"] = r.CreatedAt
|
||||
r.fieldMap["updated_at"] = r.UpdatedAt
|
||||
|
@ -257,6 +263,8 @@ func (r *role) fillFieldMap() {
|
|||
r.fieldMap["can_mention_others"] = r.CanMentionOthers
|
||||
r.fieldMap["has_mention_count_limit"] = r.HasMentionCountLimit
|
||||
r.fieldMap["mention_limit"] = r.MentionLimit
|
||||
r.fieldMap["max_individual_file_size"] = r.MaxIndividualFileSize
|
||||
r.fieldMap["max_total_file_size"] = r.MaxTotalFileSize
|
||||
r.fieldMap["auto_nsfw_media"] = r.AutoNsfwMedia
|
||||
r.fieldMap["auto_cw_posts"] = r.AutoCwPosts
|
||||
r.fieldMap["auto_cw_posts_text"] = r.AutoCwPostsText
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue