mysql: starting work on test data

pull/6693/merge
Torkel Ödegaard 8 years ago
parent 080d2a2054
commit 34d92b0e79
  1. 2
      pkg/services/sqlstore/migrations/migrations.go
  2. 21
      pkg/services/sqlstore/migrations/stats_mig.go

@ -24,6 +24,8 @@ func AddMigrations(mg *Migrator) {
addPreferencesMigrations(mg)
addAlertMigrations(mg)
addAnnotationMig(mg)
addStatsMigrations(mg)
addTestDataMigrations(mg)
}
func addMigrationLogMigrations(mg *Migrator) {

@ -33,3 +33,24 @@ func addStatsMigrations(mg *Migrator) {
// create table
mg.AddMigration("create stat_value table", NewAddTableMigration(statValue))
}
func addTestDataMigrations(mg *Migrator) {
testData := Table{
Name: "test_data",
Columns: []*Column{
{Name: "id", Type: DB_Int, IsPrimaryKey: true, IsAutoIncrement: true},
{Name: "metric1", Type: DB_Varchar, Length: 20, Nullable: true},
{Name: "metric2", Type: DB_NVarchar, Length: 150, Nullable: true},
{Name: "value_big_ing", Type: DB_BigInt, Nullable: true},
{Name: "value_double", Type: DB_Double, Nullable: true},
{Name: "value_float", Type: DB_Float, Nullable: true},
{Name: "value_int", Type: DB_Int, Nullable: true},
{Name: "time_epoch", Type: DB_BigInt, Nullable: false},
{Name: "time_datetime", Type: DB_DateTime, Nullable: false},
{Name: "time_timestamp", Type: DB_TimeStamp, Nullable: false},
},
}
// create table
mg.AddMigration("create test_data table", NewAddTableMigration(testData))
}

Loading…
Cancel
Save