Split migrations in to two statements
This commit is contained in:
parent
c2b6019c35
commit
dac29c1786
|
@ -12,11 +12,15 @@ func LoadAddPolicyVersion(m *sqlutil.Migrations) {
|
|||
}
|
||||
|
||||
func UpAddPolicyVersion(tx *sql.Tx) error {
|
||||
_, err := tx.Exec("ALTER TABLE account_accounts ADD COLUMN IF NOT EXISTS policy_version TEXT;" +
|
||||
"ALTER TABLE account_accounts ADD COLUMN IF NOT EXISTS policy_version_sent TEXT;")
|
||||
_, err := tx.Exec("ALTER TABLE account_accounts ADD COLUMN IF NOT EXISTS policy_version TEXT;")
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to execute upgrade: %w", err)
|
||||
}
|
||||
_, err = tx.Exec("ALTER TABLE account_accounts ADD COLUMN IF NOT EXISTS policy_version_sent TEXT;")
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to execute upgrade: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -12,8 +12,11 @@ func LoadAddPolicyVersion(m *sqlutil.Migrations) {
|
|||
}
|
||||
|
||||
func UpAddPolicyVersion(tx *sql.Tx) error {
|
||||
_, err := tx.Exec("ALTER TABLE account_accounts ADD COLUMN policy_version TEXT;" +
|
||||
"ALTER TABLE account_accounts ADD COLUMN policy_version_sent TEXT;")
|
||||
_, err := tx.Exec("ALTER TABLE account_accounts ADD COLUMN policy_version TEXT;")
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to execute upgrade: %w", err)
|
||||
}
|
||||
_, err = tx.Exec("ALTER TABLE account_accounts ADD COLUMN policy_version_sent TEXT;")
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to execute upgrade: %w", err)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue