This repository has been archived on 2020-05-27. You can view files and clone it, but cannot push or open issues/pull-requests.
barleysodas/db/migrate/008_create_peoples.rb

18 lines
390 B
Ruby

class CreatePeoples < ActiveRecord::Migration
def self.up
create_table :peoples do |t|
t.column :title, :string
t.column :role_id, :integer
end
add_index :peoples, :title
add_index :peoples, :role_id
p = People.new :title => 'PenguinCoder', :page => Page.new
p.role = Role.admin_role
p.save
end
def self.down
drop_table :peoples
end
end