Merge pull request #4251 from utkarshcmu/pref-migrations

Preferences table migration
This commit is contained in:
Torkel Ödegaard 2016-03-04 10:46:13 +01:00
commit 35fc5007c8
2 changed files with 21 additions and 0 deletions

View File

@ -21,6 +21,7 @@ func AddMigrations(mg *Migrator) {
addAppSettingsMigration(mg)
addSessionMigration(mg)
addPlaylistMigrations(mg)
addPreferencesMigrations(mg)
}
func addMigrationLogMigrations(mg *Migrator) {

View File

@ -0,0 +1,20 @@
package migrations
import . "github.com/grafana/grafana/pkg/services/sqlstore/migrator"
func addPreferencesMigrations(mg *Migrator) {
preferencesV1 := Table{
Name: "preferences",
Columns: []*Column{
{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
{Name: "pref_id", Type: DB_Int, Nullable: false},
{Name: "pref_type", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "pref_data", Type: DB_Text, Nullable: false},
},
}
// create table
mg.AddMigration("create preferences table v1", NewAddTableMigration(preferencesV1))
}