diff options
Diffstat (limited to 'internal/repositories/migration_db_repo.go')
| -rw-r--r-- | internal/repositories/migration_db_repo.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/internal/repositories/migration_db_repo.go b/internal/repositories/migration_db_repo.go index 7f8fc10..6a37e7b 100644 --- a/internal/repositories/migration_db_repo.go +++ b/internal/repositories/migration_db_repo.go @@ -83,7 +83,10 @@ func (mr *MigrationDBRepo) IsApplied(version string) (applied bool, err error) { // and adding the applied migration version into the migrations table. When // successfully applied, the `migration` model's `Applied` field will be set // to true. -func (mr *MigrationDBRepo) Apply(upgradeScript string, migration *models.Migration) error { +func (mr *MigrationDBRepo) Apply( + upgradeScript string, + migration *models.Migration, +) error { tx, err := mr.db.Begin() if err != nil { return err @@ -114,7 +117,10 @@ func (mr *MigrationDBRepo) Apply(upgradeScript string, migration *models.Migrati // Revert reverts a migration by executing the corresponding downgrade script // and deleting the migration version from the migrations table. When successfully // reverted, the `migration` model's `Applied` field will be set to false. -func (mr *MigrationDBRepo) Revert(downgradeScript string, migration *models.Migration) error { +func (mr *MigrationDBRepo) Revert( + downgradeScript string, + migration *models.Migration, +) error { tx, err := mr.db.Begin() if err != nil { return err |