Hi, Ive been coopted onto a distributed team using Ruby on rails, starting next week.
My first task is to look into how we can 'bootstrap' a standard database into our code, so that all the developers are writing / testing against a standard set of sample data.
Ive been reading a few books / websites, and would like to make sure Im on the right track before I waste my time pursuing the wrong soluton.
Am I correct in that the best way to do this is to write a migration file and use rake db:migrate ?
If so, my supplemental questions are then;
Once its all set up, if the database tables are changed (such as adding a new property to a class) is there an automatic way of updating the migration file, or do I need to make sure that the whole team is aware they are responsbile for the migration script ?
Apart from writing the create code in self.up, can I also add in code there to create the default records, or does that have to be done elsewhere ?
If there are multiple tables, am I better off having all the commands in a single migration file, or do I need one per class / table ?
(FWIW Im aware that I need to do more work around creating relations between the tables, but I figured I ought to check Im on the right path, and walking before I try and run..)
TIA
K
My first task is to look into how we can 'bootstrap' a standard database into our code, so that all the developers are writing / testing against a standard set of sample data.
Ive been reading a few books / websites, and would like to make sure Im on the right track before I waste my time pursuing the wrong soluton.
Am I correct in that the best way to do this is to write a migration file and use rake db:migrate ?
If so, my supplemental questions are then;
Once its all set up, if the database tables are changed (such as adding a new property to a class) is there an automatic way of updating the migration file, or do I need to make sure that the whole team is aware they are responsbile for the migration script ?
Apart from writing the create code in self.up, can I also add in code there to create the default records, or does that have to be done elsewhere ?
If there are multiple tables, am I better off having all the commands in a single migration file, or do I need one per class / table ?
(FWIW Im aware that I need to do more work around creating relations between the tables, but I figured I ought to check Im on the right path, and walking before I try and run..)
TIA
K