Migrate user_id to BIGINT (#55084)

This commit is contained in:
Piotr Jamróz 2022-09-15 13:29:46 +02:00 committed by GitHub
parent b827df626d
commit 7352c181c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 0 deletions

View File

@ -25,4 +25,8 @@ func addQueryHistoryMigrations(mg *Migrator) {
mg.AddMigration("create query_history table v1", NewAddTableMigration(queryHistoryV1))
mg.AddMigration("add index query_history.org_id-created_by-datasource_uid", NewAddIndexMigration(queryHistoryV1, queryHistoryV1.Indices[0]))
mg.AddMigration("alter table query_history alter column created_by type to bigint", NewRawSQLMigration("").
Mysql("ALTER TABLE query_history MODIFY created_by BIGINT;").
Postgres("ALTER TABLE query_history ALTER COLUMN created_by TYPE BIGINT;"))
}

View File

@ -24,4 +24,8 @@ func addQueryHistoryStarMigrations(mg *Migrator) {
mg.AddMigration("add column org_id in query_history_star", NewAddColumnMigration(queryHistoryStarV1, &Column{
Name: "org_id", Type: DB_BigInt, Nullable: false, Default: "1",
}))
mg.AddMigration("alter table query_history_star_mig column user_id type to bigint", NewRawSQLMigration("").
Mysql("ALTER TABLE query_history_star MODIFY user_id BIGINT;").
Postgres("ALTER TABLE query_history_star ALTER COLUMN user_id TYPE BIGINT;"))
}

View File

@ -24,4 +24,8 @@ func addShortURLMigrations(mg *Migrator) {
mg.AddMigration("create short_url table v1", NewAddTableMigration(shortURLV1))
mg.AddMigration("add index short_url.org_id-uid", NewAddIndexMigration(shortURLV1, shortURLV1.Indices[0]))
mg.AddMigration("alter table short_url alter column created_by type to bigint", NewRawSQLMigration("").
Mysql("ALTER TABLE short_url MODIFY created_by BIGINT;").
Postgres("ALTER TABLE short_url ALTER COLUMN created_by TYPE BIGINT;"))
}