user_auth_oauth_mig.go 1012 B

12345678910111213141516171819202122232425
  1. package migrations
  2. import . "github.com/grafana/grafana/pkg/services/sqlstore/migrator"
  3. func addUserAuthOAuthMigrations(mg *Migrator) {
  4. userAuthV2 := Table{Name: "user_auth"}
  5. mg.AddMigration("Add OAuth access token to user_auth", NewAddColumnMigration(userAuthV2, &Column{
  6. Name: "o_auth_access_token", Type: DB_Text, Nullable: true, Length: 255,
  7. }))
  8. mg.AddMigration("Add OAuth refresh token to user_auth", NewAddColumnMigration(userAuthV2, &Column{
  9. Name: "o_auth_refresh_token", Type: DB_Text, Nullable: true, Length: 255,
  10. }))
  11. mg.AddMigration("Add OAuth token type to user_auth", NewAddColumnMigration(userAuthV2, &Column{
  12. Name: "o_auth_token_type", Type: DB_Text, Nullable: true, Length: 255,
  13. }))
  14. mg.AddMigration("Add OAuth expiry to user_auth", NewAddColumnMigration(userAuthV2, &Column{
  15. Name: "o_auth_expiry", Type: DB_DateTime, Nullable: true,
  16. }))
  17. mg.AddMigration("Add index to user_id column in user_auth", NewAddIndexMigration(userAuthV2, &Index{
  18. Cols: []string{"user_id"},
  19. }))
  20. }