mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Migrate user_id to BIGINT (#55084)
This commit is contained in:
parent
b827df626d
commit
7352c181c2
@ -25,4 +25,8 @@ func addQueryHistoryMigrations(mg *Migrator) {
|
|||||||
mg.AddMigration("create query_history table v1", NewAddTableMigration(queryHistoryV1))
|
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("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{
|
mg.AddMigration("add column org_id in query_history_star", NewAddColumnMigration(queryHistoryStarV1, &Column{
|
||||||
Name: "org_id", Type: DB_BigInt, Nullable: false, Default: "1",
|
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("create short_url table v1", NewAddTableMigration(shortURLV1))
|
||||||
|
|
||||||
mg.AddMigration("add index short_url.org_id-uid", NewAddIndexMigration(shortURLV1, shortURLV1.Indices[0]))
|
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…
Reference in New Issue
Block a user