Преглед изворни кода

increase length of auth_id column in user_auth table

Marcus Efraimsson пре 7 година
родитељ
комит
3d9b7a5892
1 измењених фајлова са 5 додато и 0 уклоњено
  1. 5 0
      pkg/services/sqlstore/migrations/user_auth_mig.go

+ 5 - 0
pkg/services/sqlstore/migrations/user_auth_mig.go

@@ -21,4 +21,9 @@ func addUserAuthMigrations(mg *Migrator) {
 	mg.AddMigration("create user auth table", NewAddTableMigration(userAuthV1))
 	// add indices
 	addTableIndicesMigrations(mg, "v1", userAuthV1)
+
+	mg.AddMigration("alter user_auth.auth_id to length 255", new(RawSqlMigration).
+		Sqlite("SELECT 0 WHERE 0;").
+		Postgres("ALTER TABLE user_auth ALTER COLUMN auth_id TYPE VARCHAR(255);").
+		Mysql("ALTER TABLE user_auth MODIFY auth_id VARCHAR(255);"))
 }