-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: record signup metadata for abuse prevention
- Loading branch information
Showing
3 changed files
with
36 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/backend/src/services/database/sqlite_setup/0032_signup_metadata.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
-- Store IP and request data as TEXT (for JSON strings) | ||
ALTER TABLE `user` ADD COLUMN `signup_ip` TEXT DEFAULT NULL; | ||
ALTER TABLE `user` ADD COLUMN `signup_ip_forwarded` TEXT DEFAULT NULL; | ||
ALTER TABLE `user` ADD COLUMN `signup_user_agent` TEXT DEFAULT NULL; | ||
ALTER TABLE `user` ADD COLUMN `signup_origin` TEXT DEFAULT NULL; | ||
ALTER TABLE `user` ADD COLUMN `signup_server` TEXT DEFAULT NULL; | ||
|
||
-- Add indexes for columns likely to be searched | ||
CREATE INDEX idx_user_signup_ip ON user(signup_ip); | ||
CREATE INDEX idx_user_signup_ip_forwarded ON user(signup_ip_forwarded); | ||
CREATE INDEX idx_user_signup_user_agent ON user(signup_user_agent); | ||
CREATE INDEX idx_user_signup_origin ON user(signup_origin); | ||
CREATE INDEX idx_user_signup_server ON user(signup_server); |