cache: initial version of db cache

This commit is contained in:
bergquist
2019-03-08 09:09:27 +01:00
parent f9e3c33ebd
commit d4f5789660
5 changed files with 255 additions and 0 deletions
@@ -0,0 +1,17 @@
package migrations
import . "github.com/grafana/grafana/pkg/services/sqlstore/migrator"
func addCacheMigration(mg *Migrator) {
var cacheDataV1 = Table{
Name: "cache_data",
Columns: []*Column{
{Name: "key", Type: DB_Char, IsPrimaryKey: true, Length: 16},
{Name: "data", Type: DB_Blob},
{Name: "expires", Type: DB_Integer, Length: 255, Nullable: false},
{Name: "created_at", Type: DB_Integer, Length: 255, Nullable: false},
},
}
mg.AddMigration("create cache_data table", NewAddTableMigration(cacheDataV1))
}
@@ -33,6 +33,7 @@ func AddMigrations(mg *Migrator) {
addUserAuthMigrations(mg)
addServerlockMigrations(mg)
addUserAuthTokenMigrations(mg)
addCacheMigration(mg)
}
func addMigrationLogMigrations(mg *Migrator) {