mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Move oauth token migrations in user_auth_mig
This commit is contained in:
@@ -33,7 +33,6 @@ func AddMigrations(mg *Migrator) {
|
|||||||
addUserAuthMigrations(mg)
|
addUserAuthMigrations(mg)
|
||||||
addServerlockMigrations(mg)
|
addServerlockMigrations(mg)
|
||||||
addUserAuthTokenMigrations(mg)
|
addUserAuthTokenMigrations(mg)
|
||||||
addUserAuthOAuthMigrations(mg)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func addMigrationLogMigrations(mg *Migrator) {
|
func addMigrationLogMigrations(mg *Migrator) {
|
||||||
|
|||||||
@@ -25,4 +25,21 @@ func addUserAuthMigrations(mg *Migrator) {
|
|||||||
mg.AddMigration("alter user_auth.auth_id to length 190", NewRawSqlMigration("").
|
mg.AddMigration("alter user_auth.auth_id to length 190", NewRawSqlMigration("").
|
||||||
Postgres("ALTER TABLE user_auth ALTER COLUMN auth_id TYPE VARCHAR(190);").
|
Postgres("ALTER TABLE user_auth ALTER COLUMN auth_id TYPE VARCHAR(190);").
|
||||||
Mysql("ALTER TABLE user_auth MODIFY auth_id VARCHAR(190);"))
|
Mysql("ALTER TABLE user_auth MODIFY auth_id VARCHAR(190);"))
|
||||||
|
|
||||||
|
mg.AddMigration("Add OAuth access token to user_auth", NewAddColumnMigration(userAuthV1, &Column{
|
||||||
|
Name: "o_auth_access_token", Type: DB_Text, Nullable: true,
|
||||||
|
}))
|
||||||
|
mg.AddMigration("Add OAuth refresh token to user_auth", NewAddColumnMigration(userAuthV1, &Column{
|
||||||
|
Name: "o_auth_refresh_token", Type: DB_Text, Nullable: true,
|
||||||
|
}))
|
||||||
|
mg.AddMigration("Add OAuth token type to user_auth", NewAddColumnMigration(userAuthV1, &Column{
|
||||||
|
Name: "o_auth_token_type", Type: DB_Text, Nullable: true,
|
||||||
|
}))
|
||||||
|
mg.AddMigration("Add OAuth expiry to user_auth", NewAddColumnMigration(userAuthV1, &Column{
|
||||||
|
Name: "o_auth_expiry", Type: DB_DateTime, Nullable: true,
|
||||||
|
}))
|
||||||
|
|
||||||
|
mg.AddMigration("Add index to user_id column in user_auth", NewAddIndexMigration(userAuthV1, &Index{
|
||||||
|
Cols: []string{"user_id"},
|
||||||
|
}))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
package migrations
|
|
||||||
|
|
||||||
import . "github.com/grafana/grafana/pkg/services/sqlstore/migrator"
|
|
||||||
|
|
||||||
func addUserAuthOAuthMigrations(mg *Migrator) {
|
|
||||||
userAuthV2 := Table{Name: "user_auth"}
|
|
||||||
|
|
||||||
mg.AddMigration("Add OAuth access token to user_auth", NewAddColumnMigration(userAuthV2, &Column{
|
|
||||||
Name: "o_auth_access_token", Type: DB_Text, Nullable: true,
|
|
||||||
}))
|
|
||||||
mg.AddMigration("Add OAuth refresh token to user_auth", NewAddColumnMigration(userAuthV2, &Column{
|
|
||||||
Name: "o_auth_refresh_token", Type: DB_Text, Nullable: true,
|
|
||||||
}))
|
|
||||||
mg.AddMigration("Add OAuth token type to user_auth", NewAddColumnMigration(userAuthV2, &Column{
|
|
||||||
Name: "o_auth_token_type", Type: DB_Text, Nullable: true,
|
|
||||||
}))
|
|
||||||
mg.AddMigration("Add OAuth expiry to user_auth", NewAddColumnMigration(userAuthV2, &Column{
|
|
||||||
Name: "o_auth_expiry", Type: DB_DateTime, Nullable: true,
|
|
||||||
}))
|
|
||||||
|
|
||||||
mg.AddMigration("Add index to user_id column in user_auth", NewAddIndexMigration(userAuthV2, &Index{
|
|
||||||
Cols: []string{"user_id"},
|
|
||||||
}))
|
|
||||||
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user