app_plugin.go 954 B

123456789101112131415161718192021222324252627
  1. package migrations
  2. import . "github.com/grafana/grafana/pkg/services/sqlstore/migrator"
  3. func addAppPluginMigration(mg *Migrator) {
  4. var appPluginV1 = Table{
  5. Name: "app_plugin",
  6. Columns: []*Column{
  7. {Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
  8. {Name: "org_id", Type: DB_BigInt, Nullable: true},
  9. {Name: "type", Type: DB_NVarchar, Length: 255, Nullable: false},
  10. {Name: "enabled", Type: DB_Bool, Nullable: false},
  11. {Name: "pin_nav_links", Type: DB_Bool, Nullable: false},
  12. {Name: "json_data", Type: DB_Text, Nullable: true},
  13. {Name: "created", Type: DB_DateTime, Nullable: false},
  14. {Name: "updated", Type: DB_DateTime, Nullable: false},
  15. },
  16. Indices: []*Index{
  17. {Cols: []string{"org_id", "type"}, Type: UniqueIndex},
  18. },
  19. }
  20. mg.AddMigration("create app_plugin table v1", NewAddTableMigration(appPluginV1))
  21. //------- indexes ------------------
  22. addTableIndicesMigrations(mg, "v1", appPluginV1)
  23. }