mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-10 01:01:39 -05:00
Add active_until to users
This commit is contained in:
parent
af8af43bcd
commit
2f41b0dd57
4 changed files with 25 additions and 2 deletions
|
|
@ -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 @@
|
|||
DataMigrate::Data.define(version: 20250403204658)
|
||||
DataMigrate::Data.define(version: 20250404182629)
|
||||
|
|
|
|||
7
db/migrate/20250404182437_add_active_until_to_users.rb
Normal file
7
db/migrate/20250404182437_add_active_until_to_users.rb
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddActiveUntilToUsers < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
add_column :users, :active_until, :datetime
|
||||
end
|
||||
end
|
||||
3
db/schema.rb
generated
3
db/schema.rb
generated
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue