Upsert monsterbook cards instead of delete -> insert

Also use existing connection during character saving for proper rollback.
This commit is contained in:
P0nk
2022-01-19 17:55:23 +01:00
parent 507ab06721
commit d6192385dd
4 changed files with 27 additions and 58 deletions

View File

@@ -15978,9 +15978,11 @@ CREATE TABLE IF NOT EXISTS `medalmaps` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `monsterbook` (
`charid` int(11) unsigned NOT NULL,
`charid` int(11) NOT NULL,
`cardid` int(11) NOT NULL,
`level` int(1) DEFAULT '1'
`level` int(1) NOT NULL DEFAULT '1',
PRIMARY KEY (`charid`, `cardid`),
CONSTRAINT `FK_monsterbook_characters` FOREIGN KEY (`charid`) REFERENCES `characters`(`id`) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE IF NOT EXISTS `monstercarddata` (