mirror of
https://github.com/ShaYmez/FreeSTAR-Status-Engine.git
synced 2024-11-08 04:26:00 -05:00
Changes to SQL schema
In order to handle multiple subscription types using the same tables some changes from the schema as implemented by PR #1 are needed. A typeID field will be the indicator for which type of notification to use. Additional notification types must be assinged unique typeIDs. Assigned typeID for now are: - 1 = Telegram - 2 = email
This commit is contained in:
parent
fe812d5b78
commit
b90fab434c
13
install.sql
13
install.sql
@ -91,3 +91,16 @@ ALTER TABLE `services_subscriber`
|
||||
ADD CONSTRAINT `services_subscriber_ibfk_1` FOREIGN KEY (`subscriberIDFK`) REFERENCES `subscribers` (`subscriberID`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
ADD CONSTRAINT `services_subscriber_ibfk_2` FOREIGN KEY (`serviceIDFK`) REFERENCES `services` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
COMMIT;
|
||||
|
||||
ALTER TABLE `subscribers` CHANGE COLUMN lastname lastname varchar(255) DEFAULT NULL; # was varchar(255) NOT NULL
|
||||
ALTER TABLE `subscribers` CHANGE COLUMN firstname firstname varchar(255) DEFAULT NULL; # was varchar(255) NOT NULL
|
||||
ALTER TABLE `subscribers` CHANGE COLUMN telegramID userID varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL;
|
||||
ALTER TABLE `subscribers` ADD COLUMN typeID tinyint(1) NOT NULL AFTER subscriberID;
|
||||
ALTER TABLE `subscribers` ADD COLUMN token varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL AFTER lastname;
|
||||
ALTER TABLE `subscribers` ADD COLUMN expires int(11) DEFAULT NULL;
|
||||
ALTER TABLE `subscribers` ADD COLUMN active tinyint(1) DEFAULT NULL;
|
||||
ALTER TABLE `subscribers` ADD COLUMN create_time int(11) DEFAULT NULL;
|
||||
ALTER TABLE `subscribers` ADD COLUMN update_time int(11) DEFAULT NULL;
|
||||
ALTER TABLE `subscribers` DROP INDEX telegramID; # was UNIQUE (telegramID)
|
||||
ALTER TABLE `subscribers` ADD UNIQUE userID (userID);
|
||||
COMMIT;
|
||||
|
Loading…
Reference in New Issue
Block a user