[mythtv-users] recreate dropped MySQL tables (mythweather)

Joe Ripley vitaminjoe at gmail.com
Wed Jan 30 14:04:15 UTC 2008


On Jan 30, 2008 6:38 AM, Preston Crow <pc-mythtv07a at crowcastle.net> wrote:
> I had corrupted tables for mythweather, so I dropped them, assuming that
> Myth would recreate them when it started up, giving me a fresh start
> with mythweather.  I'm running new svn code.
>
> Is there a simple trick to recreating these tables?

Assuming you're running an SVN release of MythTV, here are the table
definitions:

DROP TABLE IF EXISTS `weathersourcesettings`;
CREATE TABLE `weathersourcesettings` (
  `sourceid` int(10) unsigned NOT NULL auto_increment,
  `source_name` varchar(64) NOT NULL,
  `update_timeout` int(10) unsigned NOT NULL default '600',
  `retrieve_timeout` int(10) unsigned NOT NULL default '60',
  `hostname` varchar(255) default NULL,
  `path` varchar(255) default NULL,
  `author` varchar(128) default NULL,
  `version` varchar(32) default NULL,
  `email` varchar(255) default NULL,
  `types` mediumtext,
  PRIMARY KEY  (`sourceid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `weatherscreens`;
CREATE TABLE `weatherscreens` (
  `screen_id` int(10) unsigned NOT NULL auto_increment,
  `draworder` int(10) unsigned NOT NULL,
  `container` varchar(64) NOT NULL,
  `hostname` varchar(255) default NULL,
  `units` tinyint(3) unsigned NOT NULL,
  PRIMARY KEY  (`screen_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `weatherdatalayout`;
CREATE TABLE `weatherdatalayout` (
  `location` varchar(64) NOT NULL,
  `dataitem` varchar(64) NOT NULL,
  `weatherscreens_screen_id` int(10) unsigned NOT NULL,
  `weathersourcesettings_sourceid` int(10) unsigned NOT NULL,
  PRIMARY KEY  (`location`,`dataitem`,`weatherscreens_screen_id`,`weathersourcesettings_sourceid`),
  KEY `weatherdatalayout_FKIndex1` (`weatherscreens_screen_id`),
  KEY `weatherdatalayout_FKIndex2` (`weathersourcesettings_sourceid`),
  CONSTRAINT `weatherdatalayout_ibfk_1` FOREIGN KEY
(`weatherscreens_screen_id`) REFERENCES `weatherscreens` (`screen_id`)
ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `weatherdatalayout_ibfk_2` FOREIGN KEY
(`weathersourcesettings_sourceid`) REFERENCES `weathersourcesettings`
(`sourceid`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

Enjoy!

-- 
Joe Ripley
vitaminjoe at gmail.com


More information about the mythtv-users mailing list