This repository has been archived on 2020-05-27. You can view files and clone it, but cannot push or open issues/pull-requests.
2008-01-02 02:58:03 -05:00
|
|
|
class CreatePeoples < ActiveRecord::Migration
|
|
|
|
def self.up
|
|
|
|
create_table :peoples do |t|
|
|
|
|
t.column :title, :string
|
|
|
|
t.column :role_id, :integer
|
2008-01-07 02:32:07 -05:00
|
|
|
t.column :encrypted_password, :string, :limit => 512
|
|
|
|
t.column :salt, :string, :limit => 512
|
2008-02-03 00:50:41 -05:00
|
|
|
t.column :created_at, :timestamp
|
2008-01-02 02:58:03 -05:00
|
|
|
end
|
|
|
|
add_index :peoples, :title
|
|
|
|
add_index :peoples, :role_id
|
2008-01-07 02:32:07 -05:00
|
|
|
p = People.new :title => 'PenguinCoder', :page => Page.new,
|
|
|
|
:password => 'new_password', :password_confirmation => 'new_password'
|
2008-01-02 02:58:03 -05:00
|
|
|
p.role = Role.admin_role
|
|
|
|
p.save
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.down
|
|
|
|
drop_table :peoples
|
|
|
|
end
|
|
|
|
end
|