mirror of
https://github.com/Freika/dawarich.git
synced 2026-05-05 03:59:24 -05:00
Add active_until to users
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class SetActiveUntilForSelfhostedUsers < ActiveRecord::Migration[8.0]
|
||||
def up
|
||||
return unless DawarichSettings.self_hosted?
|
||||
|
||||
# rubocop:disable Rails/SkipsModelValidations
|
||||
User.where(active_until: nil).update_all(active_until: 1000.years.from_now)
|
||||
# rubocop:enable Rails/SkipsModelValidations
|
||||
end
|
||||
|
||||
def down
|
||||
raise ActiveRecord::IrreversibleMigration
|
||||
end
|
||||
end
|
||||
+1
-1
@@ -1 +1 @@
|
||||
DataMigrate::Data.define(version: 20250403204658)
|
||||
DataMigrate::Data.define(version: 20250404182629)
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddActiveUntilToUsers < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
add_column :users, :active_until, :datetime
|
||||
end
|
||||
end
|
||||
Generated
+2
-1
@@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[8.0].define(version: 2025_03_24_180755) do
|
||||
ActiveRecord::Schema[8.0].define(version: 2025_04_04_182437) do
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "pg_catalog.plpgsql"
|
||||
enable_extension "postgis"
|
||||
@@ -230,6 +230,7 @@ ActiveRecord::Schema[8.0].define(version: 2025_03_24_180755) do
|
||||
t.string "current_sign_in_ip"
|
||||
t.string "last_sign_in_ip"
|
||||
t.integer "status", default: 0
|
||||
t.datetime "active_until"
|
||||
t.index ["email"], name: "index_users_on_email", unique: true
|
||||
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user