Commit 03539fc0 authored by nextime's avatar nextime

Fix a little bug in thermostats table creation script

parent 11da4ace
......@@ -47,9 +47,6 @@ CREATE TABLE IF NOT EXISTS `thermostats_progs` (
KEY `active` (`day`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
ALTER TABLE `thermostats_progs`
ADD CONSTRAINT `thermostats_progs_ibfk_1` FOREIGN KEY (`thermostat_name`) REFERENCES `thermostats` (`name`) ON DELETE CASCADE ON UPDATE CASCADE;
CREATE TABLE IF NOT EXISTS `thermostats` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
......@@ -70,3 +67,7 @@ CREATE TABLE IF NOT EXISTS `thermostats` (
KEY `function` (`function`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
ALTER TABLE `thermostats_progs`
ADD CONSTRAINT `thermostats_progs_ibfk_1` FOREIGN KEY (`thermostat_name`) REFERENCES `thermostats` (`name`) ON DELETE CASCADE ON UPDATE CASCADE;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment