Parcourir la source

Corrected SQL migration for snapshot table column type change, #1880

Torkel Ödegaard il y a 10 ans
Parent
commit
e410fbb558
1 fichiers modifiés avec 5 ajouts et 0 suppressions
  1. 5 0
      pkg/services/sqlstore/migrations/dashboard_snapshot_mig.go

+ 5 - 0
pkg/services/sqlstore/migrations/dashboard_snapshot_mig.go

@@ -49,4 +49,9 @@ func addDashboardSnapshotMigrations(mg *Migrator) {
 	mg.AddMigration("create dashboard_snapshot table v5 #2", NewAddTableMigration(snapshotV5))
 	addTableIndicesMigrations(mg, "v5", snapshotV5)
 
+	// change column type of dashboard
+	mg.AddMigration("alter dashboard_snapshot to mediumtext v2", new(RawSqlMigration).
+		Sqlite("SELECT 0 WHERE 0;").
+		Postgres("SELECT 0;").
+		Mysql("ALTER TABLE dashboard_snapshot MODIFY dashboard MEDIUMTEXT;"))
 }