First page Back Continue Last page Overview Graphics

ActiveRecord Database Migrations

In file db/migrations/005_news_articles.rb:

create_table :news_articles do |t|

t.string :title

t.text :body

t.integer :score

t.timestamps

end

drop_table :news_articles

Notes:

You do not need to be a DBA in order to create a new database.

You can guess by the number that there will typically be many of these small files. They are executed in order to bring the database up and in reverse to back out changes during development.