File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
bukkit/src/main/kotlin/io/github/rothes/esu/bukkit/module/chatantispam/user Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -51,8 +51,8 @@ object CasDataManager {
5151 init {
5252 transaction(database) {
5353 // <editor-fold desc="TableUpgrader">
54- TableUpgrader (ChatSpamTable , 2 , {
55- println (" Upgrading ChatSpamDataTable" )
54+ TableUpgrader (ChatSpamTable , 3 , {
55+ println (" Upgrading ChatSpamDataTable to 2 " )
5656 fun alter (column : String , type : String ) {
5757 exec(" ALTER TABLE `$tableName ` MODIFY COLUMN `$column ` $type " )
5858 }
@@ -62,6 +62,10 @@ object CasDataManager {
6262 alter(" data" , " TEXT NOT NULL COLLATE utf8mb4_bin" )
6363 exec(" ALTER TABLE `$tableName ` ADD CONSTRAINT `fk_chat_spam_data_user__id` FOREIGN KEY (`user`) REFERENCES `users` (`id`) ON UPDATE CASCADE ON DELETE NO ACTION" )
6464 exec(" ALTER TABLE `$tableName ` ADD CONSTRAINT `data` CHECK (json_valid(`data`))" )
65+ }, {
66+ println (" Upgrading ChatSpamDataTable to 3" )
67+ exec(" ALTER TABLE `$tableName ` DROP FOREIGN KEY `fk_chat_spam_data_user__id`" )
68+ exec(" ALTER TABLE `$tableName ` ADD CONSTRAINT `fk_chat_spam_data_user__id` FOREIGN KEY (`user`) REFERENCES `users` (`id`) ON UPDATE NO ACTION ON DELETE CASCADE" )
6569 })
6670 // </editor-fold>
6771 SchemaUtils .create(ChatSpamTable )
You can’t perform that action at this time.
0 commit comments