• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

golang-migrate / migrate / 716 / 1
54%
master: 54%

Build:
DEFAULT BRANCH: master
Ran 11 Mar 2020 12:21AM UTC
Files 41
Run time 2s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

10 Mar 2020 11:59PM UTC coverage: 53.191% (+0.7%) from 52.509%
GO111MODULE=on MIGRATE_TEST_CONTAINER_BOOT_TIMEOUT=60 DOCKER_USERNAME=golangmigrate DOCKER_PASSWORD=[secure]

push

travis-ci-com

web-flow
Improved migration creation + Windows fix (#352)

* CLI: Improve migration creation.

* Validates migration version on creation, to avoid creation of duplicated versions
* Uses `os.OpenFile` with `O_CREATE|O_EXCL` to create files to avoid file collisions
* Uses `filepath.Join` to concatenate paths, making `cleanPath()` not necessary
* Prints generated filenames
* Fixes #238
* Supersedes #250

* CLI: change `createCmd` to return error and accept `print` parameter

* feat: print out an abs path

Better for Windows OS when specify -dir as /subdir, user will see C:/subdir/0001_name.up.sql rather than /subdir/0001_name.up.sql

* test: fixed abs path test fail for OS Windows

abs path tests fails because filepath.IsAbs() treats `/subdir` path as invalid abs path at windows when drive letter is not present

* feat: print absolute path for created files

Better for Windows OS systems where `/path` can be interpreted in different ways depending on working dir

* test: corrected tests for OS Windows

OS Windows has different interpretation of `/path`, it depends on working dir.
If working dir D:\test it interprets `/path` as `D:\path`

* test: fixed `dir invalid` test

Linux OS has less restriction on a filepath than Windows, so path invalid in windows is perfectly valid for Linux. The only invalid dir name in Linux is one ending with null string terminator (\000)

* refac(cli): *Cmd() now returns an error and not uses log.fatalErr(err)

* docs: added godoc, migarate usage updated

* refac(cli): code refactored

* refac: removed unnecessary path covert

* docs: comment added

* test: fixed code review issue, noErrorExpected var removed

https://github.com/golang-migrate/migrate/pull/352#discussion_r389409789

* docs: fixed godoc

Co-authored-by: Kiyoshi '13k' Murata <kbmurata@gmail.com>

2559 of 4811 relevant lines covered (53.19%)

16.73 hits per line

Source Files on job 716.1 (GO111MODULE=on MIGRATE_TEST_CONTAINER_BOOT_TIMEOUT=60 DOCKER_USERNAME=golangmigrate DOCKER_PASSWORD=[secure])
  • Tree
  • List 0
  • Changed 3
  • Source Changed 3
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 494
  • Travis Job 716.1
  • 8e142dfa on github
  • Prev Job for GO111MODULE=on MIGRATE_TEST_CONTAINER_BOOT_TIMEOUT=60 DOCKER_USERNAME=golangmigrate DOCKER_PASSWORD=[secure] on master (#713.1)
  • Next Job for GO111MODULE=on MIGRATE_TEST_CONTAINER_BOOT_TIMEOUT=60 DOCKER_USERNAME=golangmigrate DOCKER_PASSWORD=[secure] on master (#723.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc