use dnake;
set names gbk;

DROP TABLE types;
CREATE TABLE IF NOT EXISTS `types` (
	`id` INT PRIMARY KEY AUTO_INCREMENT,
	`tid` INT NOT NULL UNIQUE KEY,
	`name` VARCHAR(256) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

REPLACE INTO types(tid, name) VALUES(1, 'Monitor');
REPLACE INTO types(tid, name) VALUES(2, 'Panel');
REPLACE INTO types(tid, name) VALUES(3, 'Person');
REPLACE INTO types(tid, name) VALUES(4, 'Walls');
REPLACE INTO types(tid, name) VALUES(5, 'Center');
REPLACE INTO types(tid, name) VALUES(6, 'User');
REPLACE INTO types(tid, name) VALUES(7, 'Admin');

DROP TABLE alarm_sensor;
CREATE TABLE IF NOT EXISTS `alarm_sensor` (
	`id` INT PRIMARY KEY AUTO_INCREMENT,
	`sensor` INT DEFAULT 0,
	`name` VARCHAR(256) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

REPLACE INTO alarm_sensor(sensor, name) VALUES(0, 'Smoke');
REPLACE INTO alarm_sensor(sensor, name) VALUES(1, 'Gas');
REPLACE INTO alarm_sensor(sensor, name) VALUES(2, 'PIR');
REPLACE INTO alarm_sensor(sensor, name) VALUES(3, 'Door');
REPLACE INTO alarm_sensor(sensor, name) VALUES(4, 'Window');
REPLACE INTO alarm_sensor(sensor, name) VALUES(5, 'Panic');
REPLACE INTO alarm_sensor(sensor, name) VALUES(6, 'Flood');
REPLACE INTO alarm_sensor(sensor, name) VALUES(7, 'Pull Cord');
REPLACE INTO alarm_sensor(sensor, name) VALUES(8, 'Bed Mat');
REPLACE INTO alarm_sensor(sensor, name) VALUES(9, 'Tamper');
REPLACE INTO alarm_sensor(sensor, name) VALUES(10, 'AC/DC');
REPLACE INTO alarm_sensor(sensor, name) VALUES(11, 'Low Power');
