4 ms·
Ok, obviously I never done web development, but why you would want declare schema from rails? And ActiveRecord is some kind of ORM (the buzzword I was hearing l
by stplsd 13y ago
Ok, obviously I never done web development, but why you would want declare schema from rails? And ActiveRecord is some kind of ORM (the buzzword I was hearing lately, but never actually care to fully understand it)?
Now I am reading book High Performance MySQL: Optimization, Backups, and Replication (yes, I know this post about PostgreSQL) and there are so much stuff to know, so this ORM thing seems like a toy.
So what is wrong to creating schema with plain old (database specific) SQL?
- gerjomarty 13y agoRails creates the database tables for whatever ORM you're using using its Migrations. Rails keeps track of which migration files have been run. The usual syntax for creating these migration files is in Ruby, as this makes them database-independent, arguably more easily readable, and in newer versions of Rails, reversible. Of course, you can put plain old SQL in these migrations if you want to as well.