grafana/pkg/services/sqlstore/migrator
Oleg Gaidarenko b37ee65bd3
Chore: prepare our SQL for cockroach db (#16471)
This is basically implementation of the https://github.com/grafana/grafana/issues/8900#issuecomment-435437167
points, except for the type conversion bit.

I tried to implement idea mentioned in cockroachdb ticket (see below).
And it is possible, but it complicates things as lot - not only we have to
have 4 SQL statements instead of one, but we would have to copy the column
structure as well - PK, FG, indexes and stuff, plus there will
be additional downtime with this approach.

So idea for this pull is to prepare our SQL as much as possible, so when
cockroachdb will add support for full type conversions, we could easilly add
support for it as well.

* Add `CASCADE` to `DROP INDEX` statement

* Make string conversions explicit

Thanks @Luit

Ref #8900
Ref cockroach/cockroach#9851
2019-04-15 18:49:24 +03:00
..
column.go move database-specific code into dialects (#11884) 2018-05-10 16:54:21 +02:00
conditions.go fix only add column if not exists for mysql 2018-12-18 23:02:08 +01:00
dialect.go fix only add column if not exists for mysql 2018-12-18 23:02:08 +01:00
migrations.go fix only add column if not exists for mysql 2018-12-18 23:02:08 +01:00
migrator.go fix only add column if not exists for mysql 2018-12-18 23:02:08 +01:00
mysql_dialect.go fix only add column if not exists for mysql 2018-12-18 23:02:08 +01:00
postgres_dialect.go Chore: prepare our SQL for cockroach db (#16471) 2019-04-15 18:49:24 +03:00
sqlite_dialect.go fix only create/drop database indices if not exists/exists 2018-12-18 21:47:45 +01:00
types.go sql: added code migration type 2018-08-21 13:53:04 +02:00