Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions bindata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ func test_migrations_2_record_sql() ([]byte, error) {
// It returns an error if the asset could not be found or
// could not be loaded.
func Asset(name string) ([]byte, error) {
cannonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[cannonicalName]; ok {
canonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[canonicalName]; ok {
return f()
}
return nil, fmt.Errorf("Asset %s not found", name)
Expand Down Expand Up @@ -105,8 +105,8 @@ var _bindata = map[string]func() ([]byte, error){
func AssetDir(name string) ([]string, error) {
node := _bintree
if len(name) != 0 {
cannonicalName := strings.Replace(name, "\\", "/", -1)
pathList := strings.Split(cannonicalName, "/")
canonicalName := strings.Replace(name, "\\", "/", -1)
pathList := strings.Split(canonicalName, "/")
for _, p := range pathList {
node = node.Children[p]
if node == nil {
Expand Down
10 changes: 5 additions & 5 deletions migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,20 @@ var numberPrefixRegex = regexp.MustCompile(`^(\d+).*$`)
// of already applied migrations and the currently found. For example, when the database
// contains a migration which is not among the migrations list found for an operation.
type PlanError struct {
Migration *Migration
ErrorMessag string
Migration *Migration
ErrorMessage string
}

func newPlanError(migration *Migration, errorMessage string) error {
return &PlanError{
Migration: migration,
ErrorMessag: errorMessage,
Migration: migration,
ErrorMessage: errorMessage,
}
}

func (p *PlanError) Error() string {
return fmt.Sprintf("Unable to create migration plan because of %s: %s",
p.Migration.Id, p.ErrorMessag)
p.Migration.Id, p.ErrorMessage)
}

// TxError is returned when any error is encountered during a database
Expand Down
4 changes: 2 additions & 2 deletions sqlparse/sqlparse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (s *SqlParseSuite) TestSplitStatements(c *C) {
}

func (s *SqlParseSuite) TestIntentionallyBadStatements(c *C) {
for _, test := range intenionallyBad {
for _, test := range intentionallyBad {
_, err := ParseMigration(strings.NewReader(test))
c.Assert(err, NotNil)
}
Expand Down Expand Up @@ -187,7 +187,7 @@ DROP TABLE fancier_post;
`

// raise error when statements are not explicitly ended
var intenionallyBad = []string{
var intentionallyBad = []string{
// first statement missing terminator
`-- +migrate Up
CREATE TABLE post (
Expand Down