plugin_bundle.go 912 B

1234567891011121314151617181920212223242526
  1. package migrations
  2. import . "github.com/grafana/grafana/pkg/services/sqlstore/migrator"
  3. func addPluginBundleMigration(mg *Migrator) {
  4. var pluginBundleV1 = Table{
  5. Name: "plugin_bundle",
  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: "json_data", Type: DB_Text, Nullable: true},
  12. {Name: "created", Type: DB_DateTime, Nullable: false},
  13. {Name: "updated", Type: DB_DateTime, Nullable: false},
  14. },
  15. Indices: []*Index{
  16. {Cols: []string{"org_id", "type"}, Type: UniqueIndex},
  17. },
  18. }
  19. mg.AddMigration("create plugin_bundle table v1", NewAddTableMigration(pluginBundleV1))
  20. //------- indexes ------------------
  21. addTableIndicesMigrations(mg, "v1", pluginBundleV1)
  22. }