mirror of
https://github.com/semaphoreui/semaphore.git
synced 2024-11-25 06:15:56 +01:00
20 lines
480 B
Go
20 lines
480 B
Go
package sql
|
|
|
|
import "github.com/go-gorp/gorp/v3"
|
|
|
|
type migration_2_8_42 struct {
|
|
db *SqlDb
|
|
}
|
|
|
|
func (m migration_2_8_42) Apply(tx *gorp.Transaction) error {
|
|
switch m.db.sql.Dialect.(type) {
|
|
case gorp.MySQLDialect:
|
|
_, _ = tx.Exec(m.db.PrepareQuery("alter table `task` drop foreign key `task_ibfk_3`"))
|
|
case gorp.PostgresDialect:
|
|
_, err := tx.Exec(
|
|
m.db.PrepareQuery("alter table `task` drop constraint if exists `task_build_task_id_fkey`"))
|
|
return err
|
|
}
|
|
return nil
|
|
}
|