Remove leftover database columns from Devise::Models::Rememberable (#17191)
* Remove leftover database columns from Devise::Models::Rememberable * Update fix-duplication maintenance script * Improve errors/warnings in the fix-duplicates maintenance script
This commit is contained in:
		@@ -0,0 +1,13 @@
 | 
			
		||||
# frozen_string_literal: true
 | 
			
		||||
 | 
			
		||||
class RemoveIndexUsersOnRememberToken < ActiveRecord::Migration[6.1]
 | 
			
		||||
  disable_ddl_transaction!
 | 
			
		||||
 | 
			
		||||
  def up
 | 
			
		||||
    remove_index :users, name: :index_users_on_remember_token
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def down
 | 
			
		||||
    add_index :users, :remember_token, algorithm: :concurrently, unique: true, name: :index_users_on_remember_token
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
@@ -0,0 +1,8 @@
 | 
			
		||||
class RemoveRememberableFromUsers < ActiveRecord::Migration[6.1]
 | 
			
		||||
  def change
 | 
			
		||||
    safety_assured do
 | 
			
		||||
      remove_column :users, :remember_token, :string, null: true, default: nil
 | 
			
		||||
      remove_column :users, :remember_created_at, :datetime, null: true, default: nil
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
@@ -10,7 +10,7 @@
 | 
			
		||||
#
 | 
			
		||||
# It's strongly recommended that you check this file into your version control system.
 | 
			
		||||
 | 
			
		||||
ActiveRecord::Schema.define(version: 2022_01_16_202951) do
 | 
			
		||||
ActiveRecord::Schema.define(version: 2022_01_18_183123) do
 | 
			
		||||
 | 
			
		||||
  # These are extensions that must be enabled in order to support this database
 | 
			
		||||
  enable_extension "plpgsql"
 | 
			
		||||
@@ -937,7 +937,6 @@ ActiveRecord::Schema.define(version: 2022_01_16_202951) do
 | 
			
		||||
    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.datetime "current_sign_in_at"
 | 
			
		||||
    t.datetime "last_sign_in_at"
 | 
			
		||||
@@ -959,7 +958,6 @@ ActiveRecord::Schema.define(version: 2022_01_16_202951) do
 | 
			
		||||
    t.boolean "disabled", default: false, null: false
 | 
			
		||||
    t.boolean "moderator", default: false, null: false
 | 
			
		||||
    t.bigint "invite_id"
 | 
			
		||||
    t.string "remember_token"
 | 
			
		||||
    t.string "chosen_languages", array: true
 | 
			
		||||
    t.bigint "created_by_application_id"
 | 
			
		||||
    t.boolean "approved", default: true, null: false
 | 
			
		||||
@@ -972,7 +970,6 @@ ActiveRecord::Schema.define(version: 2022_01_16_202951) do
 | 
			
		||||
    t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true
 | 
			
		||||
    t.index ["created_by_application_id"], name: "index_users_on_created_by_application_id"
 | 
			
		||||
    t.index ["email"], name: "index_users_on_email", unique: true
 | 
			
		||||
    t.index ["remember_token"], name: "index_users_on_remember_token", unique: true
 | 
			
		||||
    t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user