Merge pull request #305 from zikes/master

use DELETE FROM to avoid schema changes within transaction
This commit is contained in:
Matthias Kadenbach 2017-12-08 13:48:26 -08:00 committed by GitHub
commit d23f71b03c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

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