Commit Graph

275 Commits (0aec7f101d621b5db56475a15e0c56bc4fb8f64f)

Author SHA1 Message Date
tsctao 0aec7f101d Add error if migration directory does not exist 2017-07-09 16:56:11 +07:00
Vojtech Vitek 056a4d47dc Merge pull request #60 from smacker/reset_refresh
Reset & refresh commands
2017-07-07 10:39:44 -04:00
Sukharev Maxim b800f677cb remove refresh command 2017-07-06 10:17:33 +07:00
Sukharev Maxim 0bf6bef042 Reset & refresh commands
Reset rolls back all migrations
Refresh rolls back all migrations and applies all available migrations again
it's useful for development to put db in latest state without full
recreation of db.
2017-07-02 12:33:44 +07:00
Vojtech Vitek a0e07f5e12 Merge pull request #58 from pressly/travis
Move tests from .travis.yml to goose_test.go
2017-06-21 11:46:07 -04:00
Vojtech Vitek ae2fff1513 Move tests from .travis.yml to goose_test.go 2017-06-21 11:38:24 -04:00
Vojtech Vitek aa0240c1d4 Merge pull request #56 from pressly/pr/41
Pr/41
2017-06-20 16:42:37 -04:00
Vojtech Vitek 488325a6ec Remove debug log 2017-06-20 16:41:56 -04:00
Vojtech Vitek 9012a455c2 Fix tests 2017-06-20 16:38:00 -04:00
Vojtech Vitek a26643fb2b Fix migrations w/o TX, refactor 2017-06-20 16:30:29 -04:00
Vojtech Vitek 09b1a1b116 Fix test 2017-06-20 15:23:12 -04:00
Vojtech Vitek 9e816efe11 Rename new example 2017-06-20 15:16:02 -04:00
Vojtech Vitek aa28bb30d8 Fix build 2017-06-20 15:09:05 -04:00
Vojtech Vitek c579bcf2f9 Merge branch 'master' into optional-migrations 2017-06-20 15:04:58 -04:00
Vojtech Vitek 226da2c1b9 Merge pull request #55 from pressly/create
Create command reads .go files from FS
2017-06-20 15:03:04 -04:00
Vojtech Vitek d10e0e5458 Fix panic 2017-06-20 15:00:29 -04:00
Vojtech Vitek 28a7ddbabe Create command reads .go files from FS
Fixes #54
2017-06-20 14:55:23 -04:00
Vojtech Vitek 3f83937074 Merge pull request #53 from pressly/rename_examples_dir
Examples structure refactor
2017-06-20 13:04:07 -04:00
Vojtech Vitek 7e6b95b4d0 Examples structure refactor 2017-06-20 12:53:59 -04:00
Vojtech Vitek ca9152bc76 Update README 2017-06-20 12:26:48 -04:00
Vojtech Vitek d0b5acabe5 minor README fix 2017-06-20 12:20:05 -04:00
Vojtech Vitek b9b5cddc80 Merge pull request #52 from pressly/examples
Improve examples
2017-06-20 12:19:03 -04:00
Vojtech Vitek e66261f33e Remove tip from Travis 2017-06-20 12:17:28 -04:00
Vojtech Vitek 8daf954f3a Improve .travis tests 2017-06-20 12:12:51 -04:00
Vojtech Vitek 4df66b56ef Add example READMEs 2017-06-20 12:11:08 -04:00
Vojtech Vitek 3690b1fefd Refactor/simplify custom goose example with Go migrations 2017-06-20 12:11:08 -04:00
Vojtech Vitek 12dd99aa2c Travis: Bump to go1.8 2017-06-20 12:11:08 -04:00
Vojtech Vitek 4754ec24d0 Merge pull request #51 from mkozjak/vendoring
Add vendoring support using dep vendor package manager.
2017-06-20 11:57:01 -04:00
Mario Kozjak ebf4c10880 travis: bump golang version to 1.7
Signed-off-by: Mario Kozjak <kozjakm1@gmail.com>
2017-06-20 17:43:16 +02:00
Mario Kozjak 33c4e7f6a3 Add vendoring.
- Add vendor dependencies for better macos homebrew support
- Referencing #42
- Referencing Homebrew/homebrew-core#14724"

Signed-off-by: Mario Kozjak <kozjakm1@gmail.com>

Add vendoring.

- Add vendor dependencies for better macos homebrew support
- Referencing #42
- Referencing Homebrew/homebrew-core#14724

Signed-off-by: Mario Kozjak <kozjakm1@gmail.com>

Revert "Add vendoring. (glide)"

This reverts commit 8e3eb6282c955f14d493d6f084b3cf4fb4ad7b2b.

vendoring: removed vendor/; moved Gopkg.toml to topdir; removed Gopkg.lock

Signed-off-by: Mario Kozjak <kozjakm1@gmail.com>

travis: use golang/dep for dependency resolving; referencing #51

Signed-off-by: Mario Kozjak <kozjakm1@gmail.com>

Gopkg.toml: remove examples

Signed-off-by: Mario Kozjak <kozjakm1@gmail.com>

Gopkg.toml: goose doesn't need to pull itself :)

Signed-off-by: Mario Kozjak <kozjakm1@gmail.com>

Gopkg.toml: should be able to upgrade minor versions

Signed-off-by: Mario Kozjak <kozjakm1@gmail.com>
2017-06-20 17:35:18 +02:00
Vojtech Vitek d9477382e1 Merge pull request #50 from pressly/create_sequential
Create migration file with next version number
2017-06-19 17:30:02 -04:00
Vojtech Vitek 11a1b26516 Create migration file with next version number
Fixes #25
2017-06-19 17:23:29 -04:00
Vojtech Vitek 43bbf73c63 Merge pull request #48 from nkovacs/47-migrate-to-0
Allow down-to to roll back first version
2017-06-19 16:14:23 -04:00
Nikola Kovacs 65a517e879 Allow down-to to roll back first version
Fixes #47
2017-06-09 11:31:42 +02:00
Vojtech Vitek d24a46b61b Merge pull request #46 from duffn/readme-version
Fix dbversion to version
2017-05-08 15:20:41 -04:00
Vojtech Vitek ba3b7a9fde Merge pull request #44 from duffn/gofmt
Reformat code to adhere to golint and gofmt standards
2017-05-08 14:39:07 -04:00
Nicholas Duffy 20b92fa74d Fix comments in final 3 files 2017-05-08 12:10:25 -06:00
Nicholas Duffy abb2957c5d Update formatting per PR comments
Also rename `VersionId` to `VersionID`
2017-05-08 11:01:48 -06:00
Nicholas Duffy 5ee045e0f9 Merge branch 'master' into gofmt 2017-05-08 10:58:07 -06:00
Vojtech Vitek 67771ece62 Merge pull request #43 from duffn/subdirectories-fix
Fix globbing for files in subdirectories
2017-05-08 11:48:05 -04:00
Nicholas Duffy 22099ce50b Fix dbversion to version
The docs and usage state the command for checking the
version of the database is `dbversion` but it is just `version`.
2017-05-07 15:38:23 -06:00
Nicholas Duffy 2a9c8a91b9 Fix globbing for files in subdirectories
The glob `/**/*.sql` was looking for files in subdirectories
only and not finding SQL files in the root directory.

Now making two globs and combining the slices.
2017-05-07 07:17:09 -06:00
Nicholas Duffy fc368fe618 Reformat code to adhere to gofmt standards 2017-05-07 07:02:54 -06:00
Nicholas Duffy a515c0b5b9 Update `NO TRANSACTIONS` to `NO TRANSACTION` 2017-05-06 13:39:52 -06:00
Vojtech Vitek fbcec9931f Merge pull request #39 from duffn/sql-subdirectories
Update CollectMigrations for subdirectories
2017-05-06 13:26:03 -04:00
Vojtech Vitek 6b394259db Merge pull request #40 from duffn/readme
Update README
2017-05-06 13:24:48 -04:00
Nicholas Duffy fa8806ecfd Add support for optional migrations.
See the discussion in https://github.com/pressly/goose/issues/7.
Credit goes to @dkotson for his gist here: https://github.com/pressly/goose/issues/7#issuecomment-241613482

I've just added that patch to this repository and change the transaction comment to `-- +goose NO TRANSACTIONS`.

- Checks the migration file for `-- +goose NO TRANSACTIONS`
- Based upon that line, either runs the up/down SQL with or without transactions
- Add test to check for transactions
- Update README

Closes #7.
2017-05-06 09:41:44 -06:00
Nicholas Duffy 3c5ec4e555 Update README
- Add list of drivers
- Update command list to reference `up-to` and `down-to`
- Add `up-to` and `down-to` examples
- Update usage output

Closes #37.
2017-05-06 08:43:15 -06:00
Nicholas Duffy 0d5a6db9db Update CollectMigrations for subdirectories
I like to group my migrations by logical subdirectories.

```
[nicholasduffy@duffn:~/go/src/github.com/pressly/goose/migrations on sql-subdirectories]
% tree                                                                                                                                              ✭
.
├── group1
│   └── 20170506073854_table1_create_table.sql
└── group2
    └── 20170506073920_table2_create_table.sql

2 directories, 2 files
```

It's easy to run migrations by groups if necessary. However, I'd like the
ability to run all migrations in all subdirectories at the same time. This
PR adds discovery of all SQL files in subdirectories within the `-dir`
directory.
2017-05-06 08:04:19 -06:00
Vojtech Vitek cdb30a7da1 Merge pull request #36 from bharani91/master
Redo migration bugfix
2017-05-04 11:45:38 -04:00