adds migrations
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
class AddSmsVerificationCodeToUsers < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :users, :sms_verification_code, :string
|
||||
add_column :users, :sms_verified_at, :datetime
|
||||
end
|
||||
end
|
||||
5
db/migrate/20150819203410_add_phone_to_users.rb
Normal file
5
db/migrate/20150819203410_add_phone_to_users.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class AddPhoneToUsers < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :users, :phone, :string
|
||||
end
|
||||
end
|
||||
14
db/migrate/20150822095305_create_verified_users.rb
Normal file
14
db/migrate/20150822095305_create_verified_users.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
class CreateVerifiedUsers < ActiveRecord::Migration
|
||||
def change
|
||||
unless ActiveRecord::Base.connection.table_exists? 'verified_users'
|
||||
create_table :verified_users do |t|
|
||||
t.string :document_number
|
||||
t.string :document_type
|
||||
t.string :phone
|
||||
t.string :email
|
||||
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
6
db/migrate/20150822100557_add_document_to_users.rb
Normal file
6
db/migrate/20150822100557_add_document_to_users.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
class AddDocumentToUsers < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :users, :document_number, :string
|
||||
add_column :users, :document_type, :string
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddResidenceVerifiedAtToUsers < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :users, :residence_verified_at, :datetime
|
||||
end
|
||||
end
|
||||
6
db/migrate/20150823111403_add_letter_to_users.rb
Normal file
6
db/migrate/20150823111403_add_letter_to_users.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
class AddLetterToUsers < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :users, :letter_requested, :boolean, default: false
|
||||
add_column :users, :letter_sent_at, :datetime
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddEmailVerifiedAtToUsers < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :users, :email_verified_at, :datetime
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,6 @@
|
||||
class AddEmailVerificationToUsers < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :users, :email_verification_token, :string
|
||||
add_column :users, :email_for_verification, :string
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddVerifiedUserSmsVerifiedAtToUsers < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :users, :verified_user_sms_verified_at, :datetime
|
||||
end
|
||||
end
|
||||
5
db/migrate/20150825165517_add_sms_tried_to_users.rb
Normal file
5
db/migrate/20150825165517_add_sms_tried_to_users.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class AddSmsTriedToUsers < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :users, :sms_tries, :integer, default: 0
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddResidenceVerificationTriesToUsers < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :users, :residence_verification_tries, :integer, default: 0
|
||||
end
|
||||
end
|
||||
23
db/migrate/20150825201922_create_addresses.rb
Normal file
23
db/migrate/20150825201922_create_addresses.rb
Normal file
@@ -0,0 +1,23 @@
|
||||
class CreateAddresses < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :addresses do |t|
|
||||
t.integer :user_id
|
||||
t.string :street
|
||||
t.string :street_type
|
||||
t.string :number
|
||||
t.string :number_type
|
||||
t.string :letter
|
||||
t.string :portal
|
||||
t.string :stairway
|
||||
t.string :floor
|
||||
t.string :door
|
||||
t.string :km
|
||||
t.string :neighbourhood
|
||||
t.string :district
|
||||
t.string :postal_code
|
||||
t.string :toponymy
|
||||
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
20
db/migrate/20150826182010_refactor_verification_columns.rb
Normal file
20
db/migrate/20150826182010_refactor_verification_columns.rb
Normal file
@@ -0,0 +1,20 @@
|
||||
class RefactorVerificationColumns < ActiveRecord::Migration
|
||||
def change
|
||||
rename_column :users, :sms_verification_code, :sms_confirmation_code
|
||||
|
||||
remove_column :users, :sms_verified_at
|
||||
remove_column :users, :email_verified_at
|
||||
remove_column :users, :email_for_verification
|
||||
remove_column :users, :verified_user_sms_verified_at
|
||||
add_column :users, :verified_at, :datetime
|
||||
|
||||
remove_column :users, :phone
|
||||
add_column :users, :unconfirmed_phone, :string
|
||||
add_column :users, :confirmed_phone, :string
|
||||
|
||||
remove_column :users, :letter_requested
|
||||
add_column :users, :letter_requested_at, :datetime
|
||||
|
||||
rename_column :users, :sms_tries, :sms_confirmation_tries
|
||||
end
|
||||
end
|
||||
75
db/schema.rb
75
db/schema.rb
@@ -11,11 +11,31 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20150826112500) do
|
||||
ActiveRecord::Schema.define(version: 20150826182010) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
||||
create_table "addresses", force: :cascade do |t|
|
||||
t.integer "user_id"
|
||||
t.string "street"
|
||||
t.string "street_type"
|
||||
t.string "number"
|
||||
t.string "number_type"
|
||||
t.string "letter"
|
||||
t.string "portal"
|
||||
t.string "stairway"
|
||||
t.string "floor"
|
||||
t.string "door"
|
||||
t.string "km"
|
||||
t.string "neighbourhood"
|
||||
t.string "district"
|
||||
t.string "postal_code"
|
||||
t.string "toponymy"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
end
|
||||
|
||||
create_table "administrators", force: :cascade do |t|
|
||||
t.integer "user_id"
|
||||
end
|
||||
@@ -41,14 +61,14 @@ ActiveRecord::Schema.define(version: 20150826112500) do
|
||||
t.string "title"
|
||||
t.text "body"
|
||||
t.string "subject"
|
||||
t.integer "user_id", null: false
|
||||
t.integer "user_id", null: false
|
||||
t.integer "parent_id"
|
||||
t.integer "lft"
|
||||
t.integer "rgt"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.integer "children_count", default: 0
|
||||
t.datetime "hidden_at"
|
||||
t.integer "children_count", default: 0
|
||||
t.datetime "flagged_as_inappropiate_at"
|
||||
t.integer "inappropiate_flags_count", default: 0
|
||||
t.datetime "archived_at"
|
||||
@@ -70,16 +90,16 @@ ActiveRecord::Schema.define(version: 20150826112500) do
|
||||
t.string "title", limit: 80
|
||||
t.text "description"
|
||||
t.integer "author_id"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.datetime "hidden_at"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.string "visit_id"
|
||||
t.datetime "hidden_at"
|
||||
t.datetime "flagged_as_inappropiate_at"
|
||||
t.integer "inappropiate_flags_count", default: 0
|
||||
t.datetime "archived_at"
|
||||
t.integer "cached_votes_total", default: 0
|
||||
t.integer "cached_votes_up", default: 0
|
||||
t.integer "cached_votes_down", default: 0
|
||||
t.datetime "archived_at"
|
||||
t.integer "comments_count", default: 0
|
||||
end
|
||||
|
||||
@@ -161,29 +181,41 @@ ActiveRecord::Schema.define(version: 20150826112500) do
|
||||
add_index "tags", ["name"], name: "index_tags_on_name", unique: true, using: :btree
|
||||
|
||||
create_table "users", force: :cascade do |t|
|
||||
t.string "email", default: "", null: false
|
||||
t.string "encrypted_password", 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, null: false
|
||||
t.integer "sign_in_count", default: 0, null: false
|
||||
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", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.string "confirmation_token"
|
||||
t.datetime "confirmed_at"
|
||||
t.datetime "confirmation_sent_at"
|
||||
t.string "unconfirmed_email"
|
||||
t.boolean "email_on_debate_comment", default: false
|
||||
t.boolean "email_on_comment_reply", default: false
|
||||
t.boolean "email_on_debate_comment", default: false
|
||||
t.boolean "email_on_comment_reply", default: false
|
||||
t.string "phone_number", limit: 30
|
||||
t.string "official_position"
|
||||
t.integer "official_level", default: 0
|
||||
t.integer "official_level", default: 0
|
||||
t.datetime "hidden_at"
|
||||
t.string "phone_number", limit: 30
|
||||
t.string "sms_confirmation_code"
|
||||
t.string "username"
|
||||
t.string "document_number"
|
||||
t.string "document_type"
|
||||
t.datetime "residence_verified_at"
|
||||
t.datetime "letter_sent_at"
|
||||
t.string "email_verification_token"
|
||||
t.integer "sms_confirmation_tries", default: 0
|
||||
t.integer "residence_verification_tries", default: 0
|
||||
t.datetime "verified_at"
|
||||
t.string "unconfirmed_phone"
|
||||
t.string "confirmed_phone"
|
||||
t.datetime "letter_requested_at"
|
||||
end
|
||||
|
||||
add_index "users", ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true, using: :btree
|
||||
@@ -191,6 +223,15 @@ ActiveRecord::Schema.define(version: 20150826112500) do
|
||||
add_index "users", ["hidden_at"], name: "index_users_on_hidden_at", using: :btree
|
||||
add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree
|
||||
|
||||
create_table "verified_users", force: :cascade do |t|
|
||||
t.string "document_number"
|
||||
t.string "document_type"
|
||||
t.string "phone"
|
||||
t.string "email"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
end
|
||||
|
||||
create_table "visits", id: :uuid, default: nil, force: :cascade do |t|
|
||||
t.uuid "visitor_id"
|
||||
t.string "ip"
|
||||
@@ -241,4 +282,4 @@ ActiveRecord::Schema.define(version: 20150826112500) do
|
||||
add_foreign_key "inappropiate_flags", "users"
|
||||
add_foreign_key "moderators", "users"
|
||||
add_foreign_key "organizations", "users"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user