Skip to content

Instantly share code, notes, and snippets.

@s884812
Created April 24, 2018 10:42
Show Gist options
  • Save s884812/ac6521f7221f60fe788a464477a4ba1a to your computer and use it in GitHub Desktop.
Save s884812/ac6521f7221f60fe788a464477a4ba1a to your computer and use it in GitHub Desktop.
CREATE TABLE `donate` (
`id` int(11) NOT NULL,
`username` text NOT NULL,
`amount` text NOT NULL,
`paymentMethod` text NOT NULL,
`date` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `gashapons` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`npcId` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id_npcId` (`id`,`npcId`),
KEY `npcId` (`npcId`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
CREATE TABLE `gashapon_items` (
`gashaponsid` int(11) NOT NULL,
`itemid` int(11) NOT NULL,
`chance` int(11) NOT NULL,
`showmsg` tinyint(1) NOT NULL DEFAULT '0',
`name` varchar(255) NOT NULL,
UNIQUE KEY `gashaponsid_itemid` (`gashaponsid`,`itemid`),
KEY `itemid` (`itemid`),
CONSTRAINT `gashapon_items_ibfk_1` FOREIGN KEY (`gashaponsid`) REFERENCES `gashapons` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment