Skip to content

database: No longer store or retrieve InitialIP#7942

Merged
beautifulentropy merged 5 commits into
mainfrom
remove-initial-ip-part-1
Jan 13, 2025
Merged

database: No longer store or retrieve InitialIP#7942
beautifulentropy merged 5 commits into
mainfrom
remove-initial-ip-part-1

Conversation

@beautifulentropy

@beautifulentropy beautifulentropy commented Jan 13, 2025

Copy link
Copy Markdown
Member

The initialIP column has been defaulted to 0.0.0.0 since #7760. Remove this field from the all structs while leaving the schema itself intact.

Part of #7917

@beautifulentropy beautifulentropy marked this pull request as ready for review January 13, 2025 16:41
@beautifulentropy beautifulentropy requested a review from a team as a code owner January 13, 2025 16:41
Comment thread core/proto/core.proto
@jprenken jprenken requested review from a team and jsha and removed request for a team January 13, 2025 18:59

@aarongable aarongable left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Naively I'd expect this change to include a db schema change that drops this column from db-next -- is there a reason we're not doing that yet?

@beautifulentropy

Copy link
Copy Markdown
Member Author

LGTM. Naively I'd expect this change to include a db schema change that drops this column from db-next -- is there a reason we're not doing that yet?

The path forward for removing the column didn’t feel solid enough to justify a schema change at this time. However, if you support modifying the table now, I’m happy to create another PR with the following migration:

-- +migrate Up
-- SQL in section 'Up' is executed when this migration is applied

ALTER TABLE `registrations`
DROP COLUMN `initialIP`,
DROP KEY `initialIP_createdAt`;

-- +migrate Down
-- SQL section 'Down' is executed when this migration is rolled back

ALTER TABLE `registrations`
ADD COLUMN `initialIP` binary(16) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
ADD KEY `initialIP_createdAt` (`initialIP`, `createdAt`);

@beautifulentropy beautifulentropy merged commit 45a56ae into main Jan 13, 2025
@beautifulentropy beautifulentropy deleted the remove-initial-ip-part-1 branch January 13, 2025 22:34
@aarongable

Copy link
Copy Markdown
Contributor

Yeah, I think doing that schema change now would be good, as "proof" that it's safe for SRE to drop the column (however they choose to do so) in Staging and then in Prod.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants