Commit Graph

51 Commits (edaa9e3049296076d97de521d3de786999e80bec)

Author SHA1 Message Date
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
Liam Staskawicz 0287dcd9b2 readme: slight formatting tweak 2013-01-06 11:32:51 -08:00
Liam Staskawicz 8ccb502c95 readme: add notes about the available commands 2013-01-06 11:31:29 -08:00
Liam Staskawicz 47d455779e create: command to generate the scaffolding for a new migration 2013-01-06 11:22:30 -08:00
Liam Staskawicz 562485a7b7 pending: remove pending command. it wasn't properly implemented and is superseded by the status command anyhow 2013-01-06 10:36:06 -08:00
Liam Staskawicz 5431538c39 refactor: move writeTemplateToFile() into new util.go 2013-01-06 09:22:06 -08:00
Liam Staskawicz e770a07efe reorg: prefix command sources with 'cmd' for slightly clearer organization 2013-01-06 08:46:21 -08:00
Liam Staskawicz 77a0382914 results: don't bother counting the number of sql statements. we don't have a good way of tracking it for go migrations, and it's not particularly helpful either 2013-01-04 19:39:36 -10:00
Liam Staskawicz 0b250b8511 ensure migration IDs are greater than zero 2013-01-04 19:24:40 -10:00
Liam Staskawicz 517e1701e2 breaking change: version id is now int64 to accommodate larger date-based version id schemes 2013-01-04 19:22:03 -10:00
Liam Staskawicz 9140de5045 status: ensure that the version table exists 2013-01-04 19:16:09 -10:00
Liam Staskawicz c1320a5e81 rename only: DBVersion => MigrationRecord 2013-01-04 18:32:25 -10:00
Liam Staskawicz 949df006a9 status: add status command to show a summary of applied and pending migrations 2013-01-04 18:29:12 -10:00
Liam Staskawicz 4bec0b22ec breaking change: add a column to the version table to record whether we migrated up or down. fixes the case in which we weren't correctly calculating the current version previously in some cases, and also allows us to maintain a more complete historic record of all migrations made. 2013-01-04 18:11:18 -10:00
Liam Staskawicz ef4602b5e8 migrate: refactor sorting of migrations out of the collection routine 2012-12-25 12:50:30 -08:00
Liam Staskawicz 8c4171074b readme: missed a couple mentions of configuration vs environment 2012-12-24 12:14:19 -08:00
Liam Staskawicz 5431e23861 pending: slight change to textual output 2012-12-24 12:12:52 -08:00
Liam Staskawicz 9fbce90a79 flags: improved option names 2012-12-24 12:12:31 -08:00
Liam Staskawicz 1232c87d8e note for later 2012-12-24 10:35:35 -08:00
Liam Staskawicz ab33fd0625 main: adjust usage to indicate that -db and -config apply to the goose command, and that any subcommand options come after the subcommand 2012-12-24 10:28:57 -08:00
Liam Staskawicz 8cd66bc122 pending: add new command that lists migrations yet to be run 2012-12-24 10:27:32 -08:00
Liam Staskawicz dc913a5569 reorg: move getDBVersion() into migrate to clarify that it's common functionality 2012-12-24 10:22:33 -08:00
Liam Staskawicz fe14d0a1f5 flags: consolidate dbconf details to DBConf struct, reusable by any subcommands. 2012-12-24 10:09:15 -08:00
Liam Staskawicz b0dc55130d main: simple usage function. 2012-12-23 18:53:04 -08:00
Liam Staskawicz 05fdb1ac5f down: add 'down' command to roll back the version by 1 2012-12-23 18:00:09 -08:00
Liam Staskawicz 8af5b84677 migrate: fix off-by-one comparison, and print correct versions 2012-12-23 17:59:36 -08:00
Liam Staskawicz e3112d5a4f migrate: validate that given migrations don't have ID 0 2012-12-23 17:51:49 -08:00
Liam Staskawicz ce29ebdf7e use filepath.Walk when collecting migrations as well 2012-12-23 16:59:22 -08:00
Liam Staskawicz 78a2b24d13 up: make use of filepath.Walk to simplify traversing migration files 2012-12-23 14:25:38 -08:00
Liam Staskawicz bccf6afa62 reorg: breaking out functionality into separate subcommands 2012-12-23 14:01:45 -08:00
Liam Staskawicz 9e1edc94d7 readme: fix installation instructions 2012-12-17 12:39:18 -08:00
Liam Staskawicz c28116e175 reorg: move source files to top level of repo to simplify `go install` usage. 2012-12-17 08:12:20 -08:00
Liam Staskawicz 047beda98d previous test caught an error 2012-12-15 15:53:21 -08:00
Liam Staskawicz 93d928851d some basic tests 2012-12-15 15:53:08 -08:00
Liam Staskawicz b736bb38bf tiny include cleanup 2012-12-15 12:16:56 -08:00
Liam Staskawicz 2bc4ab80a0 keep all args handling in main.go for now 2012-12-15 12:10:00 -08:00
Liam Staskawicz c8383e8a34 resolve refactoring fallout 2012-12-15 12:04:19 -08:00
Liam Staskawicz ad5db711d8 migrate: cleaner and more explicit handling of target version 2012-12-15 11:29:20 -08:00
Liam Staskawicz 36f3bce74a let DBConf definition live in main, since it will be common to several commands 2012-12-15 10:48:32 -08:00
Liam Staskawicz 5c8a0d2123 more reorg: move migration specific logic to migrate.go, no functional change. 2012-12-15 10:37:29 -08:00
Liam Staskawicz 396d40b6ab reorg only: rename goose.go to main.go 2012-12-15 10:26:54 -08:00
Liam Staskawicz b373fe57bd migrations: capture next/previous versions - can't assume migration IDs will be sequential 2012-12-11 09:24:51 -08:00
Liam Staskawicz 8394b86b46 readme: tweaks 2012-12-10 09:12:43 -08:00
Liam Staskawicz 2454507384 readme: prelim usage notes 2012-12-10 09:03:57 -08:00
Liam Staskawicz 6622648865 dbconf: use standard .yml suffix rather than .yaml 2012-12-10 08:49:47 -08:00
Liam Staskawicz 04abe351a6 migration_go: insert DB version as part of each migration's transaction 2012-12-10 08:45:09 -08:00
Liam Staskawicz 9a39a80ec9 re-org: move more SQL specific code into migration_sql.go. also, acknowledge that we're only going to run one go migration at a time for now 2012-12-10 08:35:46 -08:00
Liam Staskawicz 7b645a2844 break sql migration code out into separate file. re-org only, no functional changes. 2012-12-10 00:02:57 -08:00
Liam Staskawicz 7c7ee46218 rough support for .go migrations 2012-12-10 00:00:06 -08:00
Liam Staskawicz 9802b11405 gitignore 2012-11-24 16:57:41 -08:00