Fix compose modules, add column rename (json=>meta)
This commit is contained in:
@@ -8,7 +8,7 @@ fields:
|
||||
- { field: ID }
|
||||
- { field: Handle, lookupFilterPreprocessor: lower, unique: true, sortable: true }
|
||||
- { field: Name, lookupFilterPreprocessor: lower, sortable: true }
|
||||
- { field: Meta, type: "types.JSONText" }
|
||||
- { field: Meta, type: "types.JSONText" }
|
||||
- { field: NamespaceID }
|
||||
- { field: CreatedAt, sortable: true }
|
||||
- { field: UpdatedAt, sortable: true }
|
||||
|
||||
@@ -64,6 +64,10 @@ func (g genericUpgrades) Upgrade(ctx context.Context, t *ddl.Table) error {
|
||||
g.AlterUsersDropOrganisation,
|
||||
g.AlterUsersDropRelatedUser,
|
||||
)
|
||||
case "compose_module":
|
||||
return g.all(ctx,
|
||||
g.AlterComposeModuleRenameJsonToMeta,
|
||||
)
|
||||
case "messaging_attachment":
|
||||
return g.all(ctx,
|
||||
g.AlterMessageAttachmentsRenameOwner,
|
||||
@@ -342,6 +346,11 @@ func (g genericUpgrades) RenameTable(ctx context.Context, old, new string) error
|
||||
// return nil
|
||||
//}
|
||||
|
||||
func (g genericUpgrades) AlterComposeModuleRenameJsonToMeta(ctx context.Context) error {
|
||||
_, err := g.u.RenameColumn(ctx, "compose_module", "json", "meta")
|
||||
return err
|
||||
}
|
||||
|
||||
func (g genericUpgrades) AlterMessageAttachmentsRenameOwner(ctx context.Context) error {
|
||||
_, err := g.u.RenameColumn(ctx, "messaging_attachment", "rel_user", "rel_owner")
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user