mirror of https://github.com/status-im/migrate.git
Merge pull request #305 from zikes/master
use DELETE FROM to avoid schema changes within transaction
This commit is contained in:
commit
d23f71b03c
|
@ -223,7 +223,7 @@ func (c *CockroachDb) Run(migration io.Reader) error {
|
|||
|
||||
func (c *CockroachDb) SetVersion(version int, dirty bool) error {
|
||||
return crdb.ExecuteTx(context.Background(), c.db, nil, func(tx *sql.Tx) error {
|
||||
if _, err := tx.Exec( `TRUNCATE "` + c.config.MigrationsTable + `"`); err != nil {
|
||||
if _, err := tx.Exec(`DELETE FROM "` + c.config.MigrationsTable + `"`); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue