Created role model
This commit is contained in:
9
db/migrate/20130128051640_create_roles.rb
Normal file
9
db/migrate/20130128051640_create_roles.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
class CreateRoles < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :roles do |t|
|
||||
t.string :name
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
5
db/migrate/20130128051658_add_role_id_to_user.rb
Normal file
5
db/migrate/20130128051658_add_role_id_to_user.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class AddRoleIdToUser < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :users, :role_id, :integer
|
||||
end
|
||||
end
|
||||
@@ -11,7 +11,7 @@
|
||||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20130114162614) do
|
||||
ActiveRecord::Schema.define(:version => 20130128051658) do
|
||||
|
||||
create_table "categories", :force => true do |t|
|
||||
t.string "title"
|
||||
@@ -42,6 +42,12 @@ ActiveRecord::Schema.define(:version => 20130114162614) do
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "roles", :force => true do |t|
|
||||
t.string "name"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "topics", :force => true do |t|
|
||||
t.string "title"
|
||||
t.integer "hits", :default => 0
|
||||
@@ -71,6 +77,7 @@ ActiveRecord::Schema.define(:version => 20130114162614) do
|
||||
t.integer "posts_count", :default => 0
|
||||
t.string "username"
|
||||
t.boolean "is_admin"
|
||||
t.integer "role_id"
|
||||
end
|
||||
|
||||
add_index "users", ["email"], :name => "index_users_on_email", :unique => true
|
||||
|
||||
Reference in New Issue
Block a user