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.
This commit is contained in:
Matt Baer 2020-03-03 11:36:30 -06:00
parent 5b2612af54
commit f1ffcf96ec
2 changed files with 0 additions and 4 deletions

View File

@ -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

View File

@ -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 {