]> gitweb.mndrdr.org Git - arelpe.git/commitdiff
Reset encryption: cleaning up after making source available (nothing leaked, just...
authorAidan Cornelius-Bell <[email protected]>
Sun, 12 Jan 2025 05:50:51 +0000 (16:20 +1030)
committerAidan Cornelius-Bell <[email protected]>
Sun, 12 Jan 2025 05:50:51 +0000 (16:20 +1030)
db/migrate/20250112054949_reset_encrypted_passwords.rb [new file with mode: 0644]
db/schema.rb

diff --git a/db/migrate/20250112054949_reset_encrypted_passwords.rb b/db/migrate/20250112054949_reset_encrypted_passwords.rb
new file mode 100644 (file)
index 0000000..c412fe4
--- /dev/null
@@ -0,0 +1,9 @@
+class ResetEncryptedPasswords < ActiveRecord::Migration[8.0]
+  def up
+    # Create a temporary encrypted password - it won't be usable for login
+    temp_password = "RESET_REQUIRED_#{SecureRandom.hex(10)}"
+    User.find_each do |user|
+      user.update_column(:encrypted_password, temp_password)
+    end
+  end
+end
index 413bad77ffa19692fc9cee6060359dc652f8229a..88661c2dc7d8fa8dd4b6de2b6bd3f40b7ab25a5f 100644 (file)
@@ -10,7 +10,7 @@
 #
 # It's strongly recommended that you check this file into your version control system.
 
-ActiveRecord::Schema[7.2].define(version: 2025_01_10_225508) do
+ActiveRecord::Schema[8.0].define(version: 2025_01_12_054949) do
   create_table "api_keys", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
     t.string "key"
     t.datetime "created_at", null: false