ahh security

modified:   main/db.sql
This commit is contained in:
Lain Iwakura 2025-06-16 01:50:13 +03:00
parent a4f57efde7
commit 596ce57099
No known key found for this signature in database
GPG Key ID: C7C18257F2ADC6F8

View File

@ -26,20 +26,4 @@ CREATE TABLE registrations (
id INT AUTO_INCREMENT PRIMARY KEY,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
INDEX idx_created_at (created_at)
);
DELIMITER //
CREATE PROCEDURE migrate_if_needed()
BEGIN
IF EXISTS (
SELECT * FROM information_schema.columns
WHERE table_name = 'registrations' AND column_name = 'ip'
) THEN
DROP INDEX IF EXISTS idx_ip_created ON registrations;
ALTER TABLE registrations DROP COLUMN ip;
END IF;
END //
DELIMITER ;
CALL migrate_if_needed();
DROP PROCEDURE migrate_if_needed();
);