246 Commits

Author SHA1 Message Date
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
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
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
Bharani
eea165e5d3 Redo migration bugfix 2017-05-04 20:36:11 +05:30
Vojtech Vitek
d5d23928d9 Merge pull request #33 from duffn/redshift-driver
Add Redshift driver support
2017-05-03 20:59:12 -04:00
Nicholas Duffy
1d402b32ff Add Redshift driver support
Redshift can be accessed and `up`/`down` SQL executed with the `pq`
library by default, however, the `createVersionTableSql` of the `PostgresDialect`
is not compatible with Redshift due to the `serial` datatype and `now()` default on.

This PR creates a new Redshift dialect. The dialect still uses the `pq` library and
only updates the SQL in `createVersionTableSql` to be compatible with Redshift.

Closes #32.
2017-05-03 17:41:20 -06:00
Vojtech Vitek
1da0b166cb Merge pull request #30 from itsjamie/go-template-lint-errs
Golint fixes
2017-04-13 10:23:49 -04:00
Jamie Stackhouse
261b46c60f Update migration.go
golint pass on go migrations
2017-04-12 11:58:26 -03:00
Vojtech Vitek
2784f38ca2 Merge pull request #29 from mmatczuk/mmt/ensure_db_version_panic
Avoid panic in EnsureDBVersion
2017-04-10 14:43:13 -04:00
mmatczuk
a66174eb9e Avoid panic in EnsureDBVersion 2017-04-05 12:32:40 +02:00
Vojtech Vitek
99e29546ba Merge pull request #22 from mmatczuk/mmt/export_collect_migrations
Rename collectMigrations to CollectMigrations
2017-03-27 11:21:09 -04:00
Vojtech Vitek
729045fdd1 Merge pull request #23 from przemyslaw-dobrowolski-cl/add_custom_filenames
Add support for adding migrations with custom filenames
2017-03-27 11:19:56 -04:00
Przemyslaw Dobrowolski
9fc6f5207a Add support for adding migrations with custom filenames 2017-03-27 16:12:33 +02:00
mmatczuk
1e8921d41c rename collectMigrations to CollectMigrations 2017-03-27 10:19:04 +02:00
Vojtech Vitek
221ff41793 Merge pull request #21 from mmatczuk/mmt/readme_mysql
MySQL status note
2017-03-24 10:23:49 -04:00
mmatczuk
1d358f1467 MySQL status note 2017-03-24 13:11:15 +01:00
Vojtech Vitek
90a6d29bb6 Merge pull request #20 from p-kozlowski/migrate-to-version
Support for migrating up/down to a specific version
2017-03-21 12:17:36 -04:00
Piotr Kozłowski
da36030846 Support for migrating up/down to a specific version 2017-03-17 14:44:22 +01:00
Vojtech Vitek
e591daea14 Fix example 2017-03-13 12:08:01 -04:00
Vojtech Vitek
1a4b9210ea Update Goals of this fork 2017-03-13 12:04:18 -04:00
Vojtech Vitek
f9980cee25 Fix int overflow on go 1.8-beta1 v1.0 2016-12-09 13:06:30 -05:00
Vojtech Vitek
0498aed91f Add `make dist' 2016-12-09 13:02:14 -05:00
Vojtech Vitek (V-Teq)
d6e8fe0292 Revert "Fix README example to have DB string"
This reverts commit c63bd171be103d606a2f8125710c1d4fb6e83086.

Ref. #12
v0.9
2016-11-06 13:45:28 -05:00
Vojtech Vitek
5c7c3b5b6f Merge pull request #13 from prestonp/12-refactor-create
Handle migration creation without db params
2016-11-06 13:43:49 -05:00
Preston Pham
8dcbd69b12 Handle migration creation without db params 2016-11-05 14:10:59 -05:00
Vojtech Vitek
5458c8f49f Merge pull request #10 from trevrosen/readme-fix
Fix README example to have DB string
2016-10-21 14:55:14 -04:00
Vojtech Vitek
1efa079859 Merge pull request #11 from jfyne/fix-error-on-up
ErrNoNextVersion returned on last migration
2016-10-07 16:18:20 -04:00
Josh Fyne
8a6c2299f0 Fixes the tests 2016-10-07 16:12:18 -04:00
Josh Fyne
42766096ee Fixes error on successful up 2016-10-07 15:52:55 -04:00
Trevor Rosen
c63bd171be Fix README example to have DB string 2016-10-05 14:39:07 -05:00
Vojtech Vitek
cb330a2e11 Merge pull request #9 from pressly/refactor
Refactor
2016-10-03 19:41:15 -04:00
Vojtech Vitek (V-Teq)
6804955eb2 Fix err 2016-10-03 19:36:16 -04:00