-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Database refactor #63
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
CREATE TABLE IF NOT EXISTS `players` ( | ||
`id` int(11) NOT NULL AUTO_INCREMENT, | ||
`citizenid` varchar(50) NOT NULL, | ||
`license` varchar(255) NOT NULL, | ||
`name` varchar(255) NOT NULL, | ||
`money` text NOT NULL, | ||
`userid` MEDIUMINT UNSIGNED NOT NULL, | ||
`citizenid` INT NOT NULL AUTO_INCREMENT, | ||
`charinfo` text DEFAULT NULL, | ||
`job` text NOT NULL, | ||
`gang` text DEFAULT NULL, | ||
|
@@ -12,32 +9,16 @@ CREATE TABLE IF NOT EXISTS `players` ( | |
`inventory` longtext DEFAULT NULL, | ||
`last_updated` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), | ||
PRIMARY KEY (`citizenid`), | ||
KEY `id` (`id`), | ||
FOREIGN KEY (`userid`) REFERENCES `users` (`userid`) ON DELETE CASCADE ON UPDATE CASCADE, | ||
KEY `last_updated` (`last_updated`), | ||
KEY `license` (`license`) | ||
) ENGINE=InnoDB AUTO_INCREMENT=1; | ||
|
||
CREATE TABLE IF NOT EXISTS `bans` ( | ||
`id` int(11) NOT NULL AUTO_INCREMENT, | ||
`name` varchar(50) DEFAULT NULL, | ||
`license` varchar(50) DEFAULT NULL, | ||
`discord` varchar(50) DEFAULT NULL, | ||
`ip` varchar(50) DEFAULT NULL, | ||
`reason` text DEFAULT NULL, | ||
`expire` int(11) DEFAULT NULL, | ||
`bannedby` varchar(255) NOT NULL DEFAULT 'LeBanhammer', | ||
PRIMARY KEY (`id`), | ||
KEY `license` (`license`), | ||
KEY `discord` (`discord`), | ||
KEY `ip` (`ip`) | ||
) ENGINE=InnoDB AUTO_INCREMENT=1; | ||
Comment on lines
-20
to
-33
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what happened to bans? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i guess we really shouldn't manage that ourselves and use txadmin's bans instead cauz txadmin actually maintains that system There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah bans should not be handled in the core cuz FUCK me that was a shit system, hopefully TXAdmin intergrates a ban so we can run it through txadmin completely There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
shouldn't be hard to pr exports for their moderation tools 🤔 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The hard part is always getting the PR approved There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i have experienced that part |
||
|
||
CREATE TABLE IF NOT EXISTS `player_contacts` ( | ||
`id` int(11) NOT NULL AUTO_INCREMENT, | ||
`citizenid` varchar(50) DEFAULT NULL, | ||
`name` varchar(50) DEFAULT NULL, | ||
`number` varchar(50) DEFAULT NULL, | ||
`iban` varchar(50) NOT NULL DEFAULT '0', | ||
PRIMARY KEY (`id`), | ||
KEY `citizenid` (`citizenid`) | ||
) ENGINE=InnoDB AUTO_INCREMENT=1; | ||
CREATE TABLE IF NOT EXISTS `users` ( | ||
`userid` MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT, | ||
`username` VARCHAR(50) DEFAULT NULL, | ||
`license2` VARCHAR(50) DEFAULT NULL, | ||
`steam` VARCHAR(20) DEFAULT NULL, | ||
`fivem` VARCHAR(10) DEFAULT NULL, | ||
`discord` VARCHAR(20) DEFAULT NULL, | ||
PRIMARY KEY (`userid`) | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting discussion was had last night regarding updating cached values when deletes/updates are cascaded. While the FK constraint is great, we need to have a discussion on whether we want to cascade deletes/updates on the DB and figure out an alternate cache solution, or otherwise keep the cascades within lua code so that the cache can be easily updated.