296 Commits

Author SHA1 Message Date
Brendan Fosberry
80dc0ba7ad Handling case here walkerr is raised and info is nil 2014-06-05 14:42:20 -05:00
Liam Staskawicz
3e7dc7cfd3 migrate: consolidate db openings to use OpenDBFromDBConf() 2014-06-05 11:45:59 -07:00
Liam Staskawicz
f2a7d821af dbconf: provide new helper to open and configure a DB based on a given DBConf 2014-06-05 10:09:26 -07:00
Kevin Gorjan
206ca342c5 Added -pgschema option for Postgres 2014-06-05 09:57:43 -07:00
Liam Staskawicz
e885648f5a ReadMe: pointer to goose create as a reminder of how to create both Go and SQL migrations. fixes issue #24 2014-04-01 11:08:47 -07:00
Liam Staskawicz
b9dc9c12b8 Merged in jkl1337/goose/sqlite3 (pull request #31)
Replace TEXT type with TIMESTAMP in sqlite migration table
2014-03-26 07:35:07 -07:00
John K. Luebs
16769960ce Replace TEXT type with TIMESTAMP in sqlite migration table
Although TIMESTAMP specifies NUMERIC affinity, since datetime() is
a string the actual type will always be TEXT.
sqlite never enforces type, so this is a non-issue.

As documented here: https://github.com/mattn/go-sqlite3/issues/42 the
column must be TIMESTAMP for Time type scan.
2014-03-17 18:12:53 -04:00
Liam Staskawicz
53ce70e6f3 ReadMe: update thanks 2014-03-14 14:12:00 -07:00
Liam Staskawicz
8ad1755926 Merged in lukehutton/goose/add-cmd-version (pull request #30)
Add command "goose version" to retrieve the current version for the DB
2014-03-14 14:10:53 -07:00
Luke Hutton
fff1cda8bd Make command name more specific and consistent output formatting 2014-03-14 14:00:22 -07:00
Luke Hutton
09600ab4d7 Add command "goose version" to retrieve the current version for the DB 2014-03-14 13:30:23 -07:00
Liam Staskawicz
a9882a2ed7 Merged in technosophos/goose (pull request #28)
Minor formatting in the README.md.
2014-03-11 12:25:39 -07:00
Matt Butcher
ac3c774890 Minor formatting in the README.md. 2014-03-11 13:09:09 -06:00
Liam Staskawicz
e868d71621 readme: update thanks 2014-02-23 22:13:49 -08:00
Liam Staskawicz
ff8c5c2a42 Merged in jkl1337/goose/sqlite3 (pull request #27)
Add core sqlite3 support using mattn/go-sqlite3
2014-02-23 22:12:06 -08:00
John K. Luebs
b333124f96 Add sqlite3 to dialectByName 2014-02-23 20:32:37 -05:00
John K. Luebs
eac4a3744d Add core sqlite3 support using mattn/go-sqlite3 2014-02-23 20:18:11 -05:00
Liam Staskawicz
215fc52614 readme: update heroku example to work as written 2014-02-22 16:30:23 -08:00
Liam Staskawicz
c7df92cbac ReadMe: add documentation for the argument to create an sql migration 2014-01-07 16:34:43 -08:00
Liam Staskawicz
8b0e5cc603 readme: update import path in heroku instructions 2013-10-08 16:35:09 -07:00
Liam Staskawicz
80293b668f thanks: update 2013-10-01 14:34:28 -07:00
Liam Staskawicz
02bbe7aec8 re-org: unexport MigrationSlice and MigrationMap
MigrationSlice -> migrationSorter and MigrationMap goes away. We can return just a slice of Migrations from CollectMigrations()
2013-10-01 14:16:35 -07:00
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