-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change the way triggers are added to World Database (#50)
* Change the way triggers are added to World Database This sets up the export to use the correct definer user for triggers * Update WorldTriggers.sql
- Loading branch information
1 parent
a6d30cb
commit 81babf6
Showing
4 changed files
with
43 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
USE `ace_world`; | ||
|
||
DROP TRIGGER IF EXISTS `landblock_instance_BEFORE_INSERT`; | ||
|
||
DELIMITER $$ | ||
CREATE DEFINER = CURRENT_USER TRIGGER `landblock_instance_BEFORE_INSERT` BEFORE INSERT ON `landblock_instance` FOR EACH ROW | ||
BEGIN | ||
IF !(NEW.guid >= 0x70000000 && NEW.guid <= 0x7FFFFFFF) | ||
THEN | ||
-- don't allow the insert to happen | ||
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = "Cannot add row: guid column value must be between 0x70000000 and 0x7FFFFFFF"; | ||
END IF; | ||
END$$ | ||
DELIMITER ; | ||
|
||
DROP TRIGGER IF EXISTS `landblock_instance_BEFORE_UPDATE`; | ||
|
||
DELIMITER $$ | ||
CREATE DEFINER = CURRENT_USER TRIGGER `landblock_instance_BEFORE_UPDATE` BEFORE UPDATE ON `landblock_instance` FOR EACH ROW | ||
BEGIN | ||
IF !(NEW.guid >= 0x70000000 && NEW.guid <= 0x7FFFFFFF) | ||
THEN | ||
-- don't allow the update to happen | ||
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = "Cannot update row: guid column value must be between 0x70000000 and 0x7FFFFFFF"; | ||
END IF; | ||
END$$ | ||
DELIMITER ; |
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 |
---|---|---|
@@ -1,3 +1,8 @@ | ||
set /p password=<password.txt | ||
del 16PY-db.sql | ||
"C:\Program Files\MySql\MySQL Server 8.0\bin\mysqldump.exe" --user=root --password=%password% --databases ace_world --add-drop-database --add-drop-table --create-options --quote-names --lock-tables --dump-date --flush-privileges --set-gtid-purged=AUTO --disable-keys --tz-utc --add-locks --extended-insert --opt > 16PY-db.sql | ||
"C:\Program Files\MySql\MySQL Server 8.0\bin\mysqldump.exe" --user=root --password=%password% --databases ace_world --add-drop-database --add-drop-table --create-options --quote-names --lock-tables --dump-date --flush-privileges --set-gtid-purged=AUTO --disable-keys --tz-utc --add-locks --extended-insert --opt --skip-triggers > 16PY-db.sql | ||
@echo off | ||
echo. >> 16PY-db.sql | ||
copy /b 16PY-db.sql + ..\1-Base\WorldTriggers.sql 16PY-db.sql | ||
echo. >> 16PY-db.sql | ||
@echo on |
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
@echo off | ||
set /p password=<password.txt | ||
del ..\1-Base\WorldBase.sql | ||
"C:\Program Files\MySql\MySQL Server 8.0\bin\mysqldump.exe" --user=root --password=%password% --databases ace_world --add-drop-database --add-drop-table --create-options --quote-names --lock-tables --dump-date --flush-privileges --set-gtid-purged=AUTO --disable-keys --tz-utc --add-locks --extended-insert --opt > ..\1-Base\WorldBase.sql | ||
"C:\Program Files\MySql\MySQL Server 8.0\bin\mysqldump.exe" --user=root --password=%password% --databases ace_world --add-drop-database --add-drop-table --create-options --quote-names --lock-tables --dump-date --flush-privileges --set-gtid-purged=AUTO --disable-keys --tz-utc --add-locks --extended-insert --opt --skip-triggers > ..\1-Base\WorldBase.sql | ||
echo. >> ..\1-Base\WorldBase.sql | ||
copy /b ..\1-Base\WorldBase.sql + ..\1-Base\WorldTriggers.sql ..\1-Base\WorldBase.sql | ||
echo. >> ..\1-Base\WorldBase.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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
@echo off | ||
set /p password=<password.txt | ||
del ..\1-Base\WorldBase.sql | ||
"C:\Program Files\MySql\MySQL Server 8.0\bin\mysqldump.exe" --user=root --password=%password% --databases ace_world --add-drop-database --add-drop-table --create-options --quote-names --lock-tables --dump-date --flush-privileges --set-gtid-purged=AUTO --disable-keys --tz-utc --add-locks --extended-insert --opt --no-data | sed\sed "s/ AUTO_INCREMENT=[0-9]*\b//g" > ..\1-Base\WorldBase.sql | ||
"C:\Program Files\MySql\MySQL Server 8.0\bin\mysqldump.exe" --user=root --password=%password% --databases ace_world --add-drop-database --add-drop-table --create-options --quote-names --lock-tables --dump-date --flush-privileges --set-gtid-purged=AUTO --disable-keys --tz-utc --add-locks --extended-insert --opt --no-data --skip-triggers | sed\sed "s/ AUTO_INCREMENT=[0-9]*\b//g" > ..\1-Base\WorldBase.sql | ||
echo. >> ..\1-Base\WorldBase.sql | ||
copy /b ..\1-Base\WorldBase.sql + ..\1-Base\WorldTriggers.sql ..\1-Base\WorldBase.sql | ||
echo. >> ..\1-Base\WorldBase.sql |