[eXPlainPMT Developers] SC45: Rework migrations so they build the entire database
johnwilger at gmail.com
Sun Feb 19 22:14:36 EST 2006
On 2/19/06, Eric Davis <edavis10 at gmail.com> wrote:
> I am thinking of just bumping all the migrations up a number like:
> 001 - Initial
> 002 - Fix Stories
> 003 - Add Length
My thinking when I created the story card was that the
pre-migration-1-schema information could just be added to the "version
001" migration. I would just change the file/class name of the 001
migration and have self.up create the entire database as it would
appear after the current 001 migration is run. That way the version
numbers don't have to be shifted.
If you run `rake migrate VERSION=1` followed by `rake db_schema_dump`,
the db/schema.rb file will contain almost exactly what you would need
for the self.up method in the new 001 migration.
Alice came to a fork in the road. "Which road do I take?" she asked.
"Where do you want to go?" responded the Cheshire cat.
"I don't know," Alice answered.
"Then," said the cat, "it doesn't matter."
- Lewis Carrol, Alice in Wonderland
More information about the Explainpmt-developers