mirror of
https://github.com/writefreely/writefreely
synced 2024-11-10 11:24:13 +00:00
Skip IF [TABLE] NOT EXISTS on v4 migrations
We'd like these queries to fail correctly if the tables exist.
This commit is contained in:
parent
61ddcff2c0
commit
32f3fcb859
1 changed files with 2 additions and 2 deletions
|
@ -25,7 +25,7 @@ func oauth(db *datastore) error {
|
|||
return wf_db.RunTransactionWithOptions(context.Background(), db.DB, &sql.TxOptions{}, func(ctx context.Context, tx *sql.Tx) error {
|
||||
createTableUsersOauth, err := dialect.
|
||||
Table("oauth_users").
|
||||
SetIfNotExists(true).
|
||||
SetIfNotExists(false).
|
||||
Column(dialect.Column("user_id", wf_db.ColumnTypeInteger, wf_db.UnsetSize)).
|
||||
Column(dialect.Column("remote_user_id", wf_db.ColumnTypeInteger, wf_db.UnsetSize)).
|
||||
ToSQL()
|
||||
|
@ -34,7 +34,7 @@ func oauth(db *datastore) error {
|
|||
}
|
||||
createTableOauthClientState, err := dialect.
|
||||
Table("oauth_client_states").
|
||||
SetIfNotExists(true).
|
||||
SetIfNotExists(false).
|
||||
Column(dialect.Column("state", wf_db.ColumnTypeVarChar, wf_db.OptionalInt{Set: true, Value: 255})).
|
||||
Column(dialect.Column("used", wf_db.ColumnTypeBool, wf_db.UnsetSize)).
|
||||
Column(dialect.Column("created_at", wf_db.ColumnTypeDateTime, wf_db.UnsetSize).SetDefaultCurrentTimestamp()).
|
||||
|
|
Loading…
Reference in a new issue