~egtann/migrate

63ab11e78000c1377004663f1a4664198d3cefee — Evan Tann 11 months ago cc093c5
refuse to migrate empty sql files
1 files changed, 5 insertions(+), 0 deletions(-)

M migrate.go
M migrate.go => migrate.go +5 -0
@@ 147,6 147,11 @@ func (m *Migrate) migrateFile(filename string) error {
		}
	}

	// Ensure that commands are present
	if len(filteredCmds) == 0 {
		return fmt.Errorf("no sql statements in file: %s", filename)
	}

	// Get our checkpoints, if any
	checkpoints, err := m.db.GetMetaCheckpoints(filename)
	if err != nil {