CREATE TABLE phpgw_weather_admin (
  admin_gdlib_e    tinyint(4) DEFAULT '0' NOT NULL,
  admin_gdtype     tinyint(4) DEFAULT '0' NOT NULL,
  admin_imgsrc     tinyint(4) DEFAULT '0' NOT NULL,
  admin_remote_e   tinyint(4) DEFAULT '0' NOT NULL,
  admin_filesize   int(11) DEFAULT '120000' NOT NULL,
  PRIMARY KEY (admin_gdlib_e)
);

CREATE TABLE phpgw_weather (
  weather_id       int(11) DEFAULT '0' NOT NULL auto_increment,
  weather_owner    varchar(32) DEFAULT '' NOT NULL,
  weather_metar    varchar(255) DEFAULT '' NOT NULL,
  weather_links    varchar(255) DEFAULT '' NOT NULL,
  weather_title_e  tinyint(4) DEFAULT '0' NOT NULL,
  weather_observ_e tinyint(4) DEFAULT '0' NOT NULL,
  weather_foreca_e tinyint(4) DEFAULT '0' NOT NULL,
  weather_links_e  tinyint(4) DEFAULT '0' NOT NULL,
  weather_wunder_e tinyint(4) DEFAULT '0' NOT NULL,
  weather_fpage_e  tinyint(4) DEFAULT '0' NOT NULL,
  weather_template tinyint(4) DEFAULT '0' NOT NULL,
  weather_city     varchar(50) DEFAULT '' NOT NULL,
  weather_country  varchar(50) DEFAULT '' NOT NULL,
  weather_gstation varchar(25) DEFAULT '' NOT NULL,
  weather_sticker  tinyint(4) DEFAULT '0' NOT NULL,
  weather_tmetar   varchar(25) DEFAULT '' NOT NULL,
  weather_tsize    tinyint(4) DEFAULT '0' NOT NULL,
  weather_fpmetar  varchar(25) DEFAULT '' NOT NULL,
  weather_fpsize   tinyint(4) DEFAULT '1' NOT NULL,
  state_id         int(11) DEFAULT '0' NOT NULL,
  PRIMARY KEY (weather_id)
);

CREATE TABLE phpgw_weather_links (
  links_id         int(11) DEFAULT '0' NOT NULL auto_increment,
  links_name       varchar(35) DEFAULT '' NOT NULL,
  links_timetag    int(11) DEFAULT '0' NOT NULL,
  links_refresh    int(11) DEFAULT '0' NOT NULL,
  links_linkurl    varchar(255) DEFAULT '' NOT NULL,
  links_baseurl    varchar(255) DEFAULT '' NOT NULL,
  links_parseurl   varchar(255) DEFAULT '' NOT NULL,
  links_parseexpr  varchar(255) DEFAULT '' NOT NULL,
  links_imageurl   varchar(255) DEFAULT '' NOT NULL,
  links_comment    varchar(255) DEFAULT '' NOT NULL,
  links_type       varchar(255) DEFAULT '' NOT NULL,
  PRIMARY KEY (links_id)
);

CREATE TABLE phpgw_weather_metar (
  metar_id         int(11) DEFAULT '0' NOT NULL auto_increment,
  metar_weather    varchar(255) DEFAULT '' NOT NULL,
  metar_timestamp  timestamp(14),
  metar_station    varchar(4) DEFAULT '' NOT NULL,
  metar_city       varchar(128) DEFAULT '' NOT NULL,
  metar_forecast   varchar(6) DEFAULT '' NOT NULL,
  metar_map        char(3) DEFAULT '' NOT NULL,
  region_id        int(11) DEFAULT '0' NOT NULL,
  PRIMARY KEY (metar_id),
  UNIQUE metar_station (metar_station)
);

CREATE TABLE phpgw_weather_region (
  region_id        int(11) DEFAULT '0' NOT NULL auto_increment,
  region_name      varchar(50) DEFAULT '' NOT NULL,
  PRIMARY KEY (region_id)
);

CREATE TABLE phpgw_us_states (
  state_id         int(11) DEFAULT '0' NOT NULL auto_increment,
  state_code       char(2) DEFAULT '' NOT NULL,
  state_name       varchar(50) DEFAULT '' NOT NULL,
  PRIMARY KEY (state_id)
);
