Created role model

This commit is contained in:
2013-01-28 00:18:36 -05:00
parent d9e9814823
commit b3177c8889
6 changed files with 39 additions and 1 deletions

View File

@@ -0,0 +1,9 @@
class CreateRoles < ActiveRecord::Migration
def change
create_table :roles do |t|
t.string :name
t.timestamps
end
end
end

View File

@@ -0,0 +1,5 @@
class AddRoleIdToUser < ActiveRecord::Migration
def change
add_column :users, :role_id, :integer
end
end

View File

@@ -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