--liquibase formatted sql

--changeset matthew:create_mqtt_table
CREATE TABLE `mqtt_source_data` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `topic` varchar(30) DEFAULT NULL,
  `qos` int(11) NOT NULL DEFAULT '0',
  `payload` varchar(1000) DEFAULT NULL,
  PRIMARY KEY (`id`)
);

--changeset matthew:create_mqtt_tablev2
DROP TABLE IF EXISTS `mqtt_source_data`;
CREATE TABLE `mqtt_source_data` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `topic` varchar(30) DEFAULT NULL,
  `qos` int(11) NOT NULL DEFAULT '0',
  `payload` varchar(1000) DEFAULT NULL,
  `customerId` varchar(30) DEFAULT NULL,
  `facilityId` varchar(30) DEFAULT NULL,
  `equipmentType` varchar(30) DEFAULT NULL,
  `equipmentId` varchar(30) DEFAULT NULL,
  `gasRating` FLOAT DEFAULT NULL,
  `pilot` FLOAT DEFAULT NULL,
  `timestamp` BIGINT DEFAULT NULL,
  PRIMARY KEY (`id`)
);
