Improve errors in state store migration edge cases

This commit is contained in:
Tulir Asokan
2019-08-25 17:25:19 +03:00
parent ab91d326fd
commit 3be9aa2319
13 changed files with 42 additions and 23 deletions

View File

@ -5,8 +5,8 @@ import (
)
func init() {
upgrades[1] = upgrade{"Add ON DELETE CASCADE to message table", func(dialect Dialect, tx *sql.Tx, db *sql.DB) error {
if dialect == SQLite {
upgrades[1] = upgrade{"Add ON DELETE CASCADE to message table", func(tx *sql.Tx, ctx context) error {
if ctx.dialect == SQLite {
// SQLite doesn't support constraint updates, but it isn't that careful with constraints anyway.
return nil
}