Skip to content

Instantly share code, notes, and snippets.

@alyphen
Created September 14, 2015 12:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alyphen/e79089dc4913e21dc03b to your computer and use it in GitHub Desktop.
Save alyphen/e79089dc4913e21dc03b to your computer and use it in GitHub Desktop.
SQL for LD33 entry tables
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