Started inital migration to rails 3.2
This commit is contained in:
@@ -1,16 +1,43 @@
|
||||
class DeviseCreateUsers < ActiveRecord::Migration
|
||||
def self.up
|
||||
create_table(:users) do |t|
|
||||
t.database_authenticatable :null => false
|
||||
t.recoverable
|
||||
t.rememberable
|
||||
t.trackable
|
||||
## Database authenticatable
|
||||
t.string :email, :null => false, :default => ""
|
||||
t.string :encrypted_password, :null => false, :default => ""
|
||||
|
||||
# t.encryptable
|
||||
# t.confirmable
|
||||
# t.lockable :lock_strategy => :failed_attempts, :unlock_strategy => :both
|
||||
# t.token_authenticatable
|
||||
## Recoverable
|
||||
t.string :reset_password_token
|
||||
t.datetime :reset_password_sent_at
|
||||
|
||||
## Rememberable
|
||||
t.datetime :remember_created_at
|
||||
|
||||
## Trackable
|
||||
t.integer :sign_in_count, :default => 0
|
||||
t.datetime :current_sign_in_at
|
||||
t.datetime :last_sign_in_at
|
||||
t.string :current_sign_in_ip
|
||||
t.string :last_sign_in_ip
|
||||
|
||||
## Encryptable
|
||||
# t.string :password_salt
|
||||
|
||||
## Confirmable
|
||||
# t.string :confirmation_token
|
||||
# t.datetime :confirmed_at
|
||||
# t.datetime :confirmation_sent_at
|
||||
# t.string :unconfirmed_email # Only if using reconfirmable
|
||||
|
||||
## Lockable
|
||||
# t.integer :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts
|
||||
# t.string :unlock_token # Only if unlock strategy is :email or :both
|
||||
# t.datetime :locked_at
|
||||
|
||||
# Token authenticatable
|
||||
# t.string :authentication_token
|
||||
|
||||
## Invitable
|
||||
# t.string :invitation_token
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
9
db/migrate/20130114162614_add_is_admin_to_users.rb
Normal file
9
db/migrate/20130114162614_add_is_admin_to_users.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
class AddIsAdminToUsers < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column :users, :is_admin, :boolean
|
||||
end
|
||||
|
||||
def self.down
|
||||
remove_column :users, :is_admin
|
||||
end
|
||||
end
|
||||
34
db/schema.rb
34
db/schema.rb
@@ -1,3 +1,4 @@
|
||||
# encoding: UTF-8
|
||||
# This file is auto-generated from the current state of the database. Instead
|
||||
# of editing this file, please use the migrations feature of Active Record to
|
||||
# incrementally modify your database, and then regenerate this schema definition.
|
||||
@@ -10,14 +11,14 @@
|
||||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20110808221332) do
|
||||
ActiveRecord::Schema.define(:version => 20130114162614) do
|
||||
|
||||
create_table "categories", :force => true do |t|
|
||||
t.string "title"
|
||||
t.boolean "state", :default => true
|
||||
t.integer "position", :default => 0
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "forums", :force => true do |t|
|
||||
@@ -28,8 +29,8 @@ ActiveRecord::Schema.define(:version => 20110808221332) do
|
||||
t.integer "posts_count", :default => 0
|
||||
t.integer "position", :default => 0
|
||||
t.integer "category_id"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "posts", :force => true do |t|
|
||||
@@ -37,8 +38,8 @@ ActiveRecord::Schema.define(:version => 20110808221332) do
|
||||
t.integer "forum_id"
|
||||
t.integer "topic_id"
|
||||
t.integer "user_id"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "topics", :force => true do |t|
|
||||
@@ -49,26 +50,27 @@ ActiveRecord::Schema.define(:version => 20110808221332) do
|
||||
t.integer "posts_count"
|
||||
t.integer "forum_id"
|
||||
t.integer "user_id"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "users", :force => true do |t|
|
||||
t.string "email", :default => "", :null => false
|
||||
t.string "encrypted_password", :limit => 128, :default => "", :null => false
|
||||
t.string "email", :default => "", :null => false
|
||||
t.string "encrypted_password", :default => "", :null => false
|
||||
t.string "reset_password_token"
|
||||
t.datetime "reset_password_sent_at"
|
||||
t.datetime "remember_created_at"
|
||||
t.integer "sign_in_count", :default => 0
|
||||
t.integer "sign_in_count", :default => 0
|
||||
t.datetime "current_sign_in_at"
|
||||
t.datetime "last_sign_in_at"
|
||||
t.string "current_sign_in_ip"
|
||||
t.string "last_sign_in_ip"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.integer "topics_count", :default => 0
|
||||
t.integer "posts_count", :default => 0
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.integer "topics_count", :default => 0
|
||||
t.integer "posts_count", :default => 0
|
||||
t.string "username"
|
||||
t.boolean "is_admin"
|
||||
end
|
||||
|
||||
add_index "users", ["email"], :name => "index_users_on_email", :unique => true
|
||||
|
||||
Reference in New Issue
Block a user