Browse Source

Normalize migrations between Rails 4 and Rails 5

master
Ryan McGeary 7 years ago
parent
commit
f677f1fe30
  1. 2
      .travis.yml
  2. 2
      spec/rails_app/db/migrate/20140403184646_devise_create_users.rb
  3. 2
      spec/rails_app/db/migrate/20140407172619_two_factor_authentication_add_to_users.rb
  4. 2
      spec/rails_app/db/migrate/20140407215513_add_nickanme_to_users.rb
  5. 2
      spec/rails_app/db/migrate/20151224171231_add_encrypted_columns_to_user.rb
  6. 2
      spec/rails_app/db/migrate/20151224180310_populate_otp_column.rb
  7. 2
      spec/rails_app/db/migrate/20151228230340_remove_otp_secret_key_from_user.rb
  8. 2
      spec/rails_app/db/migrate/20160209032439_devise_create_admins.rb
  9. 55
      spec/rails_app/db/schema.rb

2
.travis.yml

@ -22,6 +22,6 @@ before_install:
- gem update bundler
before_script:
- bundle exec rake app:db:migrate
- bundle exec rake app:db:setup
script: bundle exec rake spec

2
spec/rails_app/db/migrate/20140403184646_devise_create_users.rb

@ -1,4 +1,4 @@
class DeviseCreateUsers < ActiveRecord::Migration
class DeviseCreateUsers < ActiveRecord::Migration[4.2]
def change
create_table(:users) do |t|
## Database authenticatable

2
spec/rails_app/db/migrate/20140407172619_two_factor_authentication_add_to_users.rb

@ -1,4 +1,4 @@
class TwoFactorAuthenticationAddToUsers < ActiveRecord::Migration
class TwoFactorAuthenticationAddToUsers < ActiveRecord::Migration[4.2]
def up
change_table :users do |t|
t.string :otp_secret_key

2
spec/rails_app/db/migrate/20140407215513_add_nickanme_to_users.rb

@ -1,4 +1,4 @@
class AddNickanmeToUsers < ActiveRecord::Migration
class AddNickanmeToUsers < ActiveRecord::Migration[4.2]
def change
change_table :users do |t|
t.column :nickname, :string, limit: 64

2
spec/rails_app/db/migrate/20151224171231_add_encrypted_columns_to_user.rb

@ -1,4 +1,4 @@
class AddEncryptedColumnsToUser < ActiveRecord::Migration
class AddEncryptedColumnsToUser < ActiveRecord::Migration[4.2]
def change
add_column :users, :encrypted_otp_secret_key, :string
add_column :users, :encrypted_otp_secret_key_iv, :string

2
spec/rails_app/db/migrate/20151224180310_populate_otp_column.rb

@ -1,4 +1,4 @@
class PopulateOtpColumn < ActiveRecord::Migration
class PopulateOtpColumn < ActiveRecord::Migration[4.2]
def up
User.reset_column_information

2
spec/rails_app/db/migrate/20151228230340_remove_otp_secret_key_from_user.rb

@ -1,4 +1,4 @@
class RemoveOtpSecretKeyFromUser < ActiveRecord::Migration
class RemoveOtpSecretKeyFromUser < ActiveRecord::Migration[4.2]
def change
remove_column :users, :otp_secret_key, :string
end

2
spec/rails_app/db/migrate/20160209032439_devise_create_admins.rb

@ -1,4 +1,4 @@
class DeviseCreateAdmins < ActiveRecord::Migration
class DeviseCreateAdmins < ActiveRecord::Migration[4.2]
def change
create_table(:admins) do |t|
## Database authenticatable

55
spec/rails_app/db/schema.rb

@ -1,4 +1,3 @@
# 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.
@ -14,45 +13,43 @@
ActiveRecord::Schema.define(version: 20160209032439) do
create_table "admins", force: :cascade do |t|
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false
t.string "reset_password_token"
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.string "current_sign_in_ip"
t.string "last_sign_in_ip"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["email"], name: "index_admins_on_email", unique: true
t.index ["reset_password_token"], name: "index_admins_on_reset_password_token", unique: true
end
add_index "admins", ["email"], name: "index_admins_on_email", unique: true
add_index "admins", ["reset_password_token"], name: "index_admins_on_reset_password_token", unique: true
create_table "users", force: :cascade do |t|
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false
t.string "reset_password_token"
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.integer "second_factor_attempts_count", default: 0
t.string "nickname", limit: 64
t.string "encrypted_otp_secret_key"
t.string "encrypted_otp_secret_key_iv"
t.string "encrypted_otp_secret_key_salt"
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.integer "second_factor_attempts_count", default: 0
t.string "nickname", limit: 64
t.string "encrypted_otp_secret_key"
t.string "encrypted_otp_secret_key_iv"
t.string "encrypted_otp_secret_key_salt"
t.index ["email"], name: "index_users_on_email", unique: true
t.index ["encrypted_otp_secret_key"], name: "index_users_on_encrypted_otp_secret_key", unique: true
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
end
add_index "users", ["email"], name: "index_users_on_email", unique: true
add_index "users", ["encrypted_otp_secret_key"], name: "index_users_on_encrypted_otp_secret_key", unique: true
add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
end

Loading…
Cancel
Save