added pseudorandom generator

This commit is contained in:
Gani Georgiev
2022-11-06 15:26:34 +02:00
parent 46dc6cc47c
commit 4cddb6b5cb
9 changed files with 89 additions and 47 deletions
+2 -2
View File
@@ -530,7 +530,7 @@ func (dao *Dao) SyncRecordTableSchema(newCollection *models.Collection, oldColle
// This way we are always doing 1 more rename operation but it provides better dev experience.
if oldField == nil {
tempName := field.Name + security.RandomString(5)
tempName := field.Name + security.PseudoRandomString(5)
toRename[tempName] = field.Name
// add
@@ -539,7 +539,7 @@ func (dao *Dao) SyncRecordTableSchema(newCollection *models.Collection, oldColle
return err
}
} else if oldField.Name != field.Name {
tempName := field.Name + security.RandomString(5)
tempName := field.Name + security.PseudoRandomString(5)
toRename[tempName] = field.Name
// rename
+1 -1
View File
@@ -129,7 +129,7 @@ func (dao *Dao) expandRecords(records []*models.Record, expandPath string, fetch
}
// indirect relation
relField = &schema.SchemaField{
Id: "indirect_" + security.RandomString(3),
Id: "indirect_" + security.PseudoRandomString(5),
Type: schema.FieldTypeRelation,
Name: parts[0],
Options: relFieldOptions,