mirror of
https://github.com/status-im/migrate.git
synced 2025-02-23 08:18:07 +00:00
replace TRUNCATE with DELETE FROM to avoid schema changes within transaction
This commit is contained in:
parent
69472d5f5c
commit
c156f5f3a1
@ -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…
x
Reference in New Issue
Block a user