[v9.4.x] Nested Folder: Fix for SQLite not to overwrite the parent on restarts (#62756)
Nested Folder: Fix for SQLite not to overwrite the parent on restarts (#62709)
Nested Folder: Fix for SQLite not to overwrite the arent on restarts
(cherry picked from commit adaf82ffb7)
Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
This commit is contained in:
co-authored by
Sofia Papagiannaki
parent
53a1e5b7e6
commit
30081ca04b
@@ -75,7 +75,7 @@ func (s *Service) DBMigration(db db.DB) {
|
||||
err := db.WithDbSession(ctx, func(sess *sqlstore.DBSession) error {
|
||||
var err error
|
||||
if db.GetDialect().DriverName() == migrator.SQLite {
|
||||
_, err = sess.Exec("INSERT OR REPLACE INTO folder (id, uid, org_id, title, created, updated) SELECT id, uid, org_id, title, created, updated FROM dashboard WHERE is_folder = 1")
|
||||
_, err = sess.Exec("INSERT OR IGNORE INTO folder (id, uid, org_id, title, created, updated) SELECT id, uid, org_id, title, created, updated FROM dashboard WHERE is_folder = 1")
|
||||
} else if db.GetDialect().DriverName() == migrator.Postgres {
|
||||
_, err = sess.Exec("INSERT INTO folder (id, uid, org_id, title, created, updated) SELECT id, uid, org_id, title, created, updated FROM dashboard WHERE is_folder = true ON CONFLICT DO NOTHING")
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user