ms wrote:
> Thanks for your answer, I'll explain: I've got my migrations where I
> can set up the table layout. Afterwards I want to fill this database
> with some predefined records. These records should lay somewhere else
> in simple text files, CSV, XML or whatever. It's just about to divide
> the table definitions and the data I want to add directly after the
> creation.
> 
> Thanks for your help,
> ms

You can create a database anyway you like and use it to replace the 
(empty) one initially created -- as long as all the table and column 
names match, of course.  You can even do that while the server is 
running. Also, every table must have a column "id" which is the INTEGER 
PRIMARY KEY, and this should be a unique number for each row.  Table 
names should correspond to controller class names.  They should be 
plural and capitalized*, eg, if you have an app/views/document (and an 
app/controllers/document_controller.rb), you will need a table in your 
database called Documents which corresponds to the entry in 
db/schema.rb.

Is that what you mean?


*they may not have to be since they are not in the schema -- anyway, 
when I've done this they were capitalized and it works fine.
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to