124 Commits

Author SHA1 Message Date
Liam Staskawicz
f3e80f6773 migration_sql: fix minor issues reported by go vet 2013-10-01 13:49:48 -07:00
Liam Staskawicz
1ecf08bd20 re-org: unexport dialectByName() 2013-10-01 13:26:47 -07:00
Liam Staskawicz
41c7fe5cfd re-org: unexport newDBDriver 2013-10-01 12:32:39 -07:00
Liam Staskawicz
8d1d348062 CreateMigration(): enforce migration type so that callers don't have to 2013-10-01 11:39:18 -07:00
Liam Staskawicz
4e0e887c02 readme: some cya for the state of the API, and update thanks 2013-10-01 08:22:38 -07:00
Liam Staskawicz
d1dc7a676e gitignore: remove executable in new location 2013-09-30 20:19:04 -07:00
Liam Staskawicz
b5238a6198 readme: updates for new package structure 2013-09-30 20:11:17 -07:00
Liam Staskawicz
6ace67054b refactor: provide a helper to create a new dbconf from the given flags 2013-09-30 16:26:39 -07:00
Liam Staskawicz
199684b93e cmd create: move template creation inside lib/goose
might be nice to write this to an arbitrary io.Writer, maybe another day
2013-09-30 16:22:44 -07:00
Liam Staskawicz
30a7f19413 cmds: no need to register Run at init time 2013-09-30 15:46:59 -07:00
Liam Staskawicz
bf8be62073 RunMigrations(): api cleanup, return an error rather than aborting 2013-09-30 15:29:52 -07:00
Liam Staskawicz
e5a160a313 GetPreviousDBVersion(): api cleanup, don't return 'earliest' but do return error
callers of this function shouldn't be concerned with the earliest possible DB version, but we do want a way to return an error if we don't find any valid previous versions. this cleans up the 'down' and 'redo' commands.
2013-09-30 15:20:30 -07:00
Liam Staskawicz
ae19207fff GetDBVersion(): report error rather than aborting 2013-09-30 14:44:09 -07:00
Liam Staskawicz
8f7107e30a GetMostRecentDBVersion(): don't rely on magic number to report error condition 2013-09-30 14:39:31 -07:00
Liam Staskawicz
f337f77ed6 re-org: preliminary exports from lib/goose to allow cmd/goose to build properly.
Tried to minimize changes other than export/import updates. API is not quite right yet, but everything works as it did before. part of #6.
2013-09-30 14:27:10 -07: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
6acd40e4a6 gitignore: update for forthcoming changes to package structure 2013-09-30 13:31:57 -07:00
Liam Staskawicz
bf614779b1 thanks: update 2013-09-30 08:13:08 -07:00
clipperhouse
e524060a89 Version needs to be int64, otherwise Go throws with overflow int 2013-09-30 08:08:48 -07:00
Liam Staskawicz
3b8ee5dc3f thanks: add Gyepi Sam & James Cooper 2013-09-27 16:01:50 -07:00
Liam Staskawicz
d5bd1d4aee Merged in gyepisam/goose (pull request #16)
Show usage options in help string
2013-09-27 15:57:45 -07:00
Liam Staskawicz
d6778db387 readme: add some notes for new StatementBegin and StatementEnd annotations, and clarify that semicolons are the default statement delimiter 2013-09-27 14:25:07 -07:00
Liam Staskawicz
cb801ded9c sql migrations: add new annotation to accommodate SQL statements that may have semicolons within them, such as functions. some basic tests as well. fixes #4 2013-09-27 14:24:37 -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
8f76dfe638 dbconf: fewer branches in IsValid() 2013-07-08 23:38:31 -07:00
Liam Staskawicz
7664678289 dbconf test: fix ordering for Errorf() output 2013-07-08 23:37:56 -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
2847f34016 readme: add contributors section 2013-06-30 11:47:19 -07:00
Liam Staskawicz
f8e86e3745 migration: allow database/sql to do type conversion to avoid dialect differences 2013-06-30 11:38:24 -07:00
Liam Staskawicz
d5427607db readme: update and clarify go migration example 2013-06-30 11:08:44 -07:00
Gyepi Sam
d92ebe5963 Merge commit '1cae7f2834e76c410fcdb7514e55c62065787af0' 2013-05-20 16:31:08 -04:00
Gyepi Sam
1cae7f2834 Show usage options in help string 2013-05-20 16:27:15 -04:00
Liam Staskawicz
dd0239febf Merged in danielrheath/goose (pull request #15)
Update readme
2013-04-23 21:03:29 -07:00
Daniel Heath
bb8240b815 Update readme 2013-04-24 12:39:37 +10:00
Liam Staskawicz
9041c57c74 Merged in danielrheath/goose (pull request #14)
Add 'redo' command to goose
2013-04-20 09:12:15 -07:00
Daniel Heath
e3effd59a4 Add 'redo' command to goose 2013-04-16 10:30:05 +10:00
Daniel Heath
df02edc595 Use a large enough constant to be later than '20130328010151' number format 2013-04-16 10:29:40 +10: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
608aee6c2e cleanup: rename MakeDBConf to NewDBConf to more clearly represent what it's actually doing. No functional changes. 2013-04-07 17:26:46 -07:00
Liam Staskawicz
c9a4615595 migration sql: error out if no annotations are found, rather than marking the migration as having run successfully. 2013-04-07 16:55:13 -07:00
Liam Staskawicz
09e81b9cb9 dbconf: allow configuration to override a driver's import field 2013-04-07 15:18:43 -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
Liam Staskawicz
bb38ea2554 sql migration: diagnose scripts that have no Up/Down annotations. fixes #3 2013-04-07 12:17:07 -07:00
Liam Staskawicz
f1ab447a9a dbconf: cleaning, no need to declare several error variables 2013-04-07 11:21:04 -07:00
Liam Staskawicz
84b1aeabec Merged in chris_baynes/goose/fix_postgres_dependency (pull request #13)
Update postgres dependency.
2013-04-03 08:47:18 -07:00
Chris Baynes
de7ced58c6 Update postgres dependency. 2013-04-03 17:31:40 +02:00
Liam Staskawicz
b41a586b5f dbconf: simple preliminary test 2013-03-30 16:58:28 -07:00
Liam Staskawicz
634c127941 dbconf: accept path and env to allow for testing 2013-03-30 16:58:02 -07:00
Liam Staskawicz
12ca5933e8 Merged in danielrheath/goose/backtraces (pull request #11)
Show backtraces when something goes wrong
2013-03-30 16:06:13 -07:00