This is a properly typed and indexed column that is intended
to replace creation_ip to allow fast queries.
current_user.data_public = true
current_user.description = "" if current_user.description.nil?
current_user.creation_ip = request.remote_ip
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
current_user.languages = http_accept_language.user_preferred_languages
current_user.terms_agreed = Time.now.utc
current_user.tou_agreed = Time.now.utc
# tou_agreed :datetime
# diary_comments_count :integer default(0)
# note_comments_count :integer default(0)
# tou_agreed :datetime
# diary_comments_count :integer default(0)
# note_comments_count :integer default(0)
+# creation_address :inet
+# 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
# 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
--- /dev/null
+class AddUserCreationAddress < ActiveRecord::Migration[7.1]
+ disable_ddl_transaction!
+
+ def change
+ add_column :users, :creation_address, :inet
+ add_index :users, :creation_address, :using => :gist, :opclass => :inet_ops, :algorithm => :concurrently
+ end
+end
home_tile bigint,
tou_agreed timestamp without time zone,
diary_comments_count integer DEFAULT 0,
home_tile bigint,
tou_agreed timestamp without time zone,
diary_comments_count integer DEFAULT 0,
- note_comments_count integer DEFAULT 0
+ note_comments_count integer DEFAULT 0,
+ creation_address inet
CREATE UNIQUE INDEX index_user_mutes_on_owner_id_and_subject_id ON public.user_mutes USING btree (owner_id, subject_id);
CREATE UNIQUE INDEX index_user_mutes_on_owner_id_and_subject_id ON public.user_mutes USING btree (owner_id, subject_id);
+--
+-- Name: index_users_on_creation_address; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX index_users_on_creation_address ON public.users USING gist (creation_address inet_ops);
+
+
--
-- Name: messages_from_user_id_idx; Type: INDEX; Schema: public; Owner: -
--
--
-- Name: messages_from_user_id_idx; Type: INDEX; Schema: public; Owner: -
--
('20240822121603'),
('20240813070506'),
('20240724194738'),
('20240822121603'),
('20240813070506'),
('20240724194738'),