From f1ffcf96ec6f629078fbc1b298d2aa52b95a4dcc Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Tue, 3 Mar 2020 11:36:30 -0600 Subject: [PATCH] Remove user_id and remote_user_id constraints in v4&v5 migrations It's not straightforward to remove these constraints in SQLite, so this just skips it entirely. Since both of these migrations are part of the same WF release, this should have minimal impact on admins. --- migrations/v4.go | 2 -- migrations/v5.go | 2 -- 2 files changed, 4 deletions(-) diff --git a/migrations/v4.go b/migrations/v4.go index 93bfbc1..403a3f0 100644 --- a/migrations/v4.go +++ b/migrations/v4.go @@ -18,8 +18,6 @@ func oauth(db *datastore) error { SetIfNotExists(true). Column(dialect.Column("user_id", wf_db.ColumnTypeInteger, wf_db.UnsetSize)). Column(dialect.Column("remote_user_id", wf_db.ColumnTypeInteger, wf_db.UnsetSize)). - UniqueConstraint("user_id"). - UniqueConstraint("remote_user_id"). ToSQL() if err != nil { return err diff --git a/migrations/v5.go b/migrations/v5.go index 94e3944..0dc5129 100644 --- a/migrations/v5.go +++ b/migrations/v5.go @@ -49,8 +49,6 @@ func oauthSlack(db *datastore) error { "access_token", wf_db.ColumnTypeVarChar, wf_db.OptionalInt{Set: true, Value: 512,})), - dialect.DropIndex("remote_user_id", "oauth_users"), - dialect.DropIndex("user_id", "oauth_users"), dialect.CreateUniqueIndex("oauth_users", "oauth_users", "user_id", "provider", "client_id"), } for _, builder := range builders {