mirror of
https://github.com/pocketbase/pocketbase.git
synced 2026-11-02 02:10:29 +01:00
updated automigrate templates, added js bindings tests and updated models IsNew behavior
This commit is contained in:
1 parent
604009bd10
commit
b8cd686b32
21 files changed
+546
-213
No files matched your search
+1
-1
@@ -239,7 +239,7 @@ func (dao *Dao) create(m models.Model) error {
|
||||
}
|
||||
|
||||
// clears the "new" model flag
|
||||
m.UnmarkAsNew()
|
||||
m.MarkAsNotNew()
|
||||
|
||||
if dao.AfterCreateFunc != nil {
|
||||
dao.AfterCreateFunc(dao, m)
|
||||
|
||||
@@ -212,6 +212,8 @@ func (dao *Dao) ImportCollections(
|
||||
}
|
||||
|
||||
if existing, ok := mappedExisting[imported.GetId()]; ok {
|
||||
imported.MarkAsNotNew()
|
||||
|
||||
// preserve original created date
|
||||
if !existing.Created.IsZero() {
|
||||
imported.Created = existing.Created
|
||||
|
||||
Reference in new issue
Block a user