Created
September 14, 2015 12:09
-
-
Save alyphen/e79089dc4913e21dc03b to your computer and use it in GitHub Desktop.
SQL for LD33 entry tables
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
CREATE DATABASE IF NOT EXISTS `ld33` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; | |
USE `ld33`; | |
CREATE TABLE IF NOT EXISTS `player` ( | |
`uuid` varchar(36) NOT NULL, | |
`name` varchar(256) NOT NULL, | |
`password_hash` varchar(256) NOT NULL, | |
`password_salt` varchar(256) NOT NULL, | |
`resources` int(11) NOT NULL | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
CREATE TABLE IF NOT EXISTS `unit` ( | |
`uuid` varchar(36) DEFAULT NULL, | |
`player_uuid` varchar(36) DEFAULT NULL, | |
`health` int(11) DEFAULT NULL, | |
`max_health` int(11) DEFAULT NULL, | |
`solid` tinyint(1) DEFAULT NULL, | |
`x` int(11) DEFAULT NULL, | |
`y` int(11) DEFAULT NULL, | |
`type` varchar(256) DEFAULT NULL, | |
`completion_time` bigint(20) NOT NULL | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
ALTER TABLE `player` | |
ADD PRIMARY KEY (`uuid`); | |
ALTER TABLE `unit` | |
ADD KEY `player_uuid` (`player_uuid`); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment