Add creation_address column to users

This is a properly typed and indexed column that is intended
to replace creation_ip to allow fast queries.
This commit is contained in:
Tom Hughes 2024-09-10 19:16:03 +01:00
parent 1a5fb52c28
commit 336ad6db03
4 changed files with 21 additions and 1 deletions

View file

@ -267,6 +267,7 @@ class UsersController < ApplicationController
current_user.data_public = true
current_user.description = "" if current_user.description.nil?
current_user.creation_ip = request.remote_ip
current_user.creation_address = request.remote_ip
current_user.languages = http_accept_language.user_preferred_languages
current_user.terms_agreed = Time.now.utc
current_user.tou_agreed = Time.now.utc

View file

@ -33,9 +33,11 @@
# tou_agreed :datetime
# diary_comments_count :integer default(0)
# note_comments_count :integer default(0)
# creation_address :inet
#
# Indexes
#
# index_users_on_creation_address (creation_address) USING gist
# users_auth_idx (auth_provider,auth_uid) UNIQUE
# users_display_name_canonical_idx (lower(NORMALIZE(display_name, NFKC)))
# users_display_name_idx (display_name) UNIQUE