1
0
mirror of https://github.com/moparisthebest/xAuth synced 2024-08-13 16:53:52 -04:00
xAuth/sql/h2/0001_original_tables.sql
Zach Iverson 06b56509ff 1. Major refactor of database related classes.
2. Added global teleport locations
2011-07-29 17:29:51 -04:00

44 lines
1.2 KiB
SQL

CREATE TABLE IF NOT EXISTS `{TABLE_ACCOUNT}` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`playername` VARCHAR(255) NOT NULL,
`password` CHAR(255) NOT NULL,
`email` VARCHAR(100) NULL,
`registerdate` DATETIME NULL,
`registerip` CHAR(15) NULL,
`lastlogindate` DATETIME NULL,
`lastloginip` CHAR(15) NULL,
`active` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY(`id`)
);
CREATE TABLE IF NOT EXISTS `{TABLE_SESSION}` (
`accountid` INT UNSIGNED NOT NULL,
`host` CHAR(15) NOT NULL,
`logintime` DATETIME NOT NULL,
PRIMARY KEY(`accountid`),
FOREIGN KEY (`accountid`) REFERENCES `{TABLE_ACCOUNT}`(`id`) ON DELETE CASCADE
);
CREATE TABLE IF NOT EXISTS `{TABLE_LOCATION}` (
`worldname` VARCHAR(255) NOT NULL,
`x` DOUBLE NOT NULL,
`y` DOUBLE NOT NULL,
`z` DOUBLE NOT NULL,
`yaw` FLOAT NOT NULL,
`pitch` FLOAT NOT NULL,
PRIMARY KEY(`worldname`)
);
CREATE TABLE IF NOT EXISTS `{TABLE_STRIKE}` (
`host` CHAR(15) NOT NULL,
`bantime` DATETIME NOT NULL,
PRIMARY KEY(`host`)
);
CREATE TABLE IF NOT EXISTS `{TABLE_INVENTORY}` (
`playername` VARCHAR(255) NOT NULL,
`itemid` TEXT NOT NULL,
`amount` TEXT NOT NULL,
`durability` TEXT NOT NULL,
PRIMARY KEY (`playername`)
);