support card content migrations

Ticket

+commit
 

we've been using the rail db migration tool to do content migrations, which regularly gets us into trouble.  In short the problem is that

  1. it's very hard to do anything sophisticated without using the card models.
  2. as soon as you start using any models, you create a situation where new structure migrations will break old content migrations.  (bc the code always expects the db to be in the latest state)

This is why we've had to ask people to do many hops to get old wagns migrated forward.

 

The migration pattern we need is pretty clear:

  1. run all structural migrations, THEN
  2. run all content migrations

So we need to separate the two out.  The API will look something like:

  • rake db:migrate (run structural migrations)
  • rake wagn:migrate_cards (run content migrations)
  • rake wagn:migrate (run both of the above in order)

 

 

 

There is talk of building an eventual api that will be more in the style of federation / DeckoSystems, etc.  This baby step is needed in a hurry to get Wagn 1.11 out because of migrations needed then.  Doing this now with current card API should keep us from having to make people do baby steps forward (and will provide test cases for whatever future data patterns arise)


So, can we load them with the JSON API? Hmmm, should link that ticket, but is it a ticket or still an idea? Probably should be a ticket since we have code in the queue.

  --Gerry Gleason.....2013-03-13 20:50:07 +0000


Hmm, I think we could, we've done yaml in the past, which is consistent railsy data practices, but this would be more exciting, at least in the long term.

 

Of course we need more than object notation for the migration themselves; I don't think we're ready to start specifying merge strategies in JSON or anything. But we could load the basic card data that way. (Usually we develop the data on en.dwagn.org, so this could involve import and export)

  --Ethan McCutchen.....2013-03-14 02:57:37 +0000


I got the following working:

- rake wagn:migrate_cards runs migrations in db/migrate_cards (tracked in schema_migration_cards table)

- rails generate card_migration creates a migration there

 

To complete this ticket, we need to:

- add rake wagn:migrate to run all migrations

- handle stamping

--Ethan McCutchen.....2013-04-10 20:12:30 +0000

Doesn't this need updating? Trying to find info on wagn generate support for these and what I need to make work. Some tests would be nice for wagn command generally, no?

--Gerry Gleason.....2014-12-08 20:41:41 +0000

this is a closed ticket. we do need to add documentation, though. (There's almost no documentation for mod developers in general)

--Ethan McCutchen.....2014-12-08 20:53:30 +0000