use fixed ids in the default profiles system collections migration

This commit is contained in:
Gani Georgiev 2022-08-10 19:08:29 +03:00
parent c5091898ae
commit 119e1fb3f2
1 changed files with 5 additions and 0 deletions

View File

@ -96,6 +96,7 @@ func init() {
UpdateRule: &profileOwnerRule, UpdateRule: &profileOwnerRule,
Schema: schema.NewSchema( Schema: schema.NewSchema(
&schema.SchemaField{ &schema.SchemaField{
Id: "pbfielduser",
Name: models.ProfileCollectionUserFieldName, Name: models.ProfileCollectionUserFieldName,
Type: schema.FieldTypeUser, Type: schema.FieldTypeUser,
Unique: true, Unique: true,
@ -107,11 +108,13 @@ func init() {
}, },
}, },
&schema.SchemaField{ &schema.SchemaField{
Id: "pbfieldname",
Name: "name", Name: "name",
Type: schema.FieldTypeText, Type: schema.FieldTypeText,
Options: &schema.TextOptions{}, Options: &schema.TextOptions{},
}, },
&schema.SchemaField{ &schema.SchemaField{
Id: "pbfieldavatar",
Name: "avatar", Name: "avatar",
Type: schema.FieldTypeFile, Type: schema.FieldTypeFile,
Options: &schema.FileOptions{ Options: &schema.FileOptions{
@ -128,6 +131,8 @@ func init() {
}, },
), ),
} }
collection.Id = "systemprofiles0"
collection.MarkAsNew()
return daos.New(db).SaveCollection(collection) return daos.New(db).SaveCollection(collection)
}, func(db dbx.Builder) error { }, func(db dbx.Builder) error {