grafana/pkg
Marcus Efraimsson b7a9533476
Database: Initialize xorm with an empty schema for postgres (#17357)
xorm introduced some changes in
https://github.com/go-xorm/xorm/pull/824 and
https://github.com/go-xorm/xorm/pull/876 which by default will use
public as the postgres schema and this was a breaking change compared
to before. Grafana has implemented a custom postgres dialect so above
changes wasn't a problem here. However, Grafana's custom database
migration was using xorm dialect to check if the migration table exists
or not.
For those using a custom search_path (schema) in postgres configured on
server, database or user level the migration table check would not find
the migration table since it was looking in public schema due to xorm
changes above. This had the consequence that Grafana's database
migration failed the second time since migration had already run
migrations in another schema.
This change will make xorm use an empty default schema for postgres and
by that mimic the functionality of how it was functioning before
xorm's changes above.
Fixes #16720

Co-Authored-By: Carl Bergquist <carl@grafana.com>
2019-06-03 16:45:03 +02:00
..
api Alerting: golint fixes for alerting (#17246) 2019-06-03 10:25:58 +02:00
bus bus: noop should still execute fn 2018-06-15 12:46:20 +02:00
cmd CLI: Add command to migrate all datasources to use encrypted password fields (#17118) 2019-05-27 10:47:21 +02:00
components MySQL/Postgres/MSSQL: Add parsing for day, weeks and year intervals in macros (#13086) 2019-05-30 09:58:29 +02:00
events feat(signup): progress on new sign up and email verification flow, #2353 2015-08-28 15:14:24 +02:00
extensions Enterprise: remove gofakeit dep (#17344) 2019-05-29 15:55:51 +03:00
infra LDAP: consistently name the LDAP entities (#17203) 2019-05-22 15:30:03 +03:00
login LDAP: consistently name the LDAP entities (#17203) 2019-05-22 15:30:03 +03:00
middleware Auth Proxy: Log any error in middleware (#17275) 2019-05-27 10:38:17 +02:00
models Batch disable users (#17254) 2019-05-31 13:22:22 +03:00
plugins Explore: Queries the datasource once per run query and uses DataStreamObserver (#17263) 2019-06-03 14:54:32 +02:00
registry add functionality to override service in registry 2018-10-30 13:37:30 +01:00
services Database: Initialize xorm with an empty schema for postgres (#17357) 2019-06-03 16:45:03 +02:00
setting HTTP Server: Serve Grafana with a custom URL path prefix (#17048) 2019-05-27 17:47:29 +02:00
tsdb MySQL/Postgres/MSSQL: Add parsing for day, weeks and year intervals in macros (#13086) 2019-05-30 09:58:29 +02:00
util CLI: Add command to migrate all datasources to use encrypted password fields (#17118) 2019-05-27 10:47:21 +02:00