Commit Graph

64 Commits (90e476692d684b98f44f539fc2180ed2c63a95b3)

Author SHA1 Message Date
Nick Krichevsky 90e476692d
Update documentation for GetDBVersion to match functionality 2018-05-16 21:46:21 -04:00
Vojtech Vitek 95600eb369
Merge pull request #104 from chapsuk/table_name
Added ability to change db version table name
2018-05-03 11:24:55 -04:00
Maxim Krasilnikov 1cebce80c7 Added logger interface and SetLogger func for redefine package output 2018-04-30 12:30:13 +03:00
Maxim Krasilnikov 0639337e0b Added ability to change db version table name 2018-04-29 14:14:14 +03:00
tsctao 0aec7f101d Add error if migration directory does not exist 2017-07-09 16:56:11 +07:00
Vojtech Vitek a26643fb2b Fix migrations w/o TX, refactor 2017-06-20 16:30:29 -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
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
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 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
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
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
Piotr Kozłowski da36030846 Support for migrating up/down to a specific version 2017-03-17 14:44:22 +01:00
Vojtech Vitek f9980cee25 Fix int overflow on go 1.8-beta1 2016-12-09 13:06:30 -05:00
Josh Fyne 8a6c2299f0 Fixes the tests 2016-10-07 16:12:18 -04:00
Vojtech Vitek (V-Teq) 643386c3a6 Refactor 2016-10-03 19:31:27 -04:00
Vojtech Vitek (V-Teq) f49670b2b4 Fix go migration up 2016-09-29 19:30:23 -04:00
Vojtech Vitek (V-Teq) 96680a8221 Better version duplicate check 2016-08-15 15:29:29 -04:00
Vojtech Vitek (V-Teq) 6a2ef004b5 More verbose panic on duplicate migrations 2016-08-15 14:22:11 -04:00
Vojtech Vitek (V-Teq) 52af0e6a35 Panic on duplicate migration version 2016-08-15 14:11:46 -04:00
Josh Fyne 15b7bf5fc7 Actually works now, re-added go migration template, updated cmd parser 2016-06-29 17:56:28 -04:00
Vojtech Vitek (V-Teq) 1a51ec2e96 Add up-by-one goose command 2016-06-20 15:24:25 -04:00
Vojtech Vitek (V-Teq) 946d2ad074 Fix transaction on nil Go func migrations 2016-03-08 12:40:28 -05:00
Vojtech Vitek (V-Teq) ae64375f29 Remove go-sqlite3 dependency from goose pkg 2016-03-07 15:55:05 -05:00
Vojtech Vitek (V-Teq) c78d864291 Register Go functions as complex Go migrations 2016-03-03 18:48:45 -05:00
Vojtech Vitek (V-Teq) 59f7a561cb Refactor commands 2016-03-03 14:46:04 -05:00
Vojtech Vitek (V-Teq) 2cccd9df36 Refactor goose pkg 2016-03-02 17:23:15 -05:00
Vojtech Vitek (V-Teq) 47e4c98a97 Move lib/goose into top level pkg 2016-02-26 14:50:27 -05:00
Liam Staskawicz 381d1ac678 wip (not building): begin restructuring into separate cmd and lib packages, to allow external applications to make use of goose's internal functionality. part of #6. 2013-09-30 13:38:02 -07:00
Liam Staskawicz 5dfd15ece2 ensureDBVersion(): clean up after the db version query. fixes issue #10. 2013-09-25 11:37:19 -07:00
Liam Staskawicz bab8917da5 dialect: use insertVersionSql() to ensure txn.Exec() args are handled properly in each dialect 2013-07-08 23:37:30 -07:00
Liam Staskawicz 66fbe2d01a dialect: introduce layer to implement SQL-specific queries for internal goose operations 2013-04-07 17:51:48 -07:00
Liam Staskawicz 4446df2ca6 dbconf: split out separate DBDriver struct to encapsulate the info required for a given driver. as a bonus, we now import the correct package for Go migrations based on the driver - previously, we imported postgres only. 2013-04-07 14:24:03 -07:00
Liam Staskawicz 161a0a1cc2 reorg: plumb dbconf through to consumers that need it for dialect-specific operations 2013-04-07 12:58:24 -07:00
Chris Baynes de7ced58c6 Update postgres dependency. 2013-04-03 17:31:40 +02:00
Liam Staskawicz 3c6b6c35c4 use filepath rather than path to ensure we're dealing with filenames in an OS compatible way. fixes #2. 2013-02-24 23:06:12 -08:00
Abigail Walthall 527ee49c38 Fix goose_db_version table for postgres.
Tested with:
* mysql  Ver 15.1 Distrib 5.5.28a-MariaDB
* psql (PostgreSQL) 9.2.2
2013-01-17 09:34:37 -05:00
Liam Staskawicz 430f2bf9d0 Breaking change: Merged in ghthor/goose/primary-key-bug (pull request #5: Fixed - timestamp Primary key) 2013-01-16 23:22:16 -08:00
Liam Staskawicz b959795376 Merged in ghthor/goose/test-fix (pull request #7: Fixed the existing test's that verify the sorting order) 2013-01-16 23:02:27 -08:00
Abigail Walthall 71801fa6bf Fixed the existing test's that verify the sorting order 2013-01-16 20:29:52 -05:00
Abigail Walthall c1e1680dc8 Load the mymysql database driver 2013-01-16 17:29:03 -05:00
Abigail Walthall 7b2d93c72a Order the results by the guaranteed unique `id` instead of the potentially non-unique `tstamp` 2013-01-16 17:25:03 -05:00
Abigail Walthall b7fd3077d1 Fix Bug when finalizing the migration table when calling `goose up` for the first time 2013-01-16 15:38:45 -05:00
Liam Staskawicz 85a0c8b565 remove obsolete version comparison 2013-01-06 22:12:39 -08:00
Liam Staskawicz edaa9e3049 migrate refactor: simplify MigrationMap struct by allowing each Migration to track its own Version 2013-01-06 22:12:17 -08:00