Migrate user_id to BIGINT (#55084)

pull/55316/head
Piotr Jamróz 3 years ago committed by GitHub
parent b827df626d
commit 7352c181c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      pkg/services/sqlstore/migrations/query_history_mig.go
  2. 4
      pkg/services/sqlstore/migrations/query_history_star_mig.go
  3. 4
      pkg/services/sqlstore/migrations/short_url_mig.go

@ -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;"))
}

@ -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;"))
}

@ -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;"))
}

Loading…
Cancel
Save