CREATE TABLE `metadata` (
  `norad` int(10) unsigned NOT NULL,
  `epoch` datetime NOT NULL,
  `obj_id` varchar(20) DEFAULT NULL,
  `id_short` varchar(20) DEFAULT NULL,
  `name` varchar(100) DEFAULT NULL,
  `center_name` varchar(10) DEFAULT NULL,
  `ref_frame` varchar(20) DEFAULT NULL,
  `mean_element_theory` varchar(20) DEFAULT NULL,
  `classification_type` char(1) DEFAULT NULL,
  `obj_type` varchar(20) DEFAULT NULL,
  `rcs_size` varchar(20) DEFAULT NULL,
  `country_code` varchar(4) DEFAULT NULL,
  `launch_date` datetime DEFAULT NULL,
  `site` varchar(20) DEFAULT NULL,
  `decay_date` datetime DEFAULT NULL,
  `created` datetime DEFAULT NULL,
  PRIMARY KEY (`norad`,`epoch`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE `orbelem` (
  `norad` int(10) unsigned NOT NULL,
  `epoch` datetime NOT NULL,
  `mean_motion` double DEFAULT '0',
  `eccentricity` double DEFAULT '0',
  `inclination` double DEFAULT '0',
  `raan` double DEFAULT '0',
  `arg_of_pericenter` double DEFAULT '0',
  `mean_anomaly` double DEFAULT '0',
  `ephemeris_type` tinyint(3) unsigned DEFAULT '0',
  `classification_type` char(1) DEFAULT NULL,
  `element_set_no` smallint(5) unsigned DEFAULT '0',
  `rev_at_epoch` float DEFAULT '0',
  `bstar` double DEFAULT '0',
  `mean_motion_dot` double DEFAULT '0',
  `mean_motion_ddot` double DEFAULT '0',
  `tle_line0` char(30) DEFAULT NULL,
  `tle_line1` char(71) DEFAULT NULL,
  `tle_line2` char(71) DEFAULT NULL,
  `semimajor_axis` double(20,3) DEFAULT '0.000',
  `period` double(20,3) DEFAULT NULL,
  `apoapsis` double(20,3) DEFAULT '0.000',
  `periapsis` double(20,3) DEFAULT '0.000',
  `originator` varchar(20) DEFAULT NULL,
  `data_created` datetime DEFAULT NULL,
  `originator_comment` varchar(50) DEFAULT NULL,
  `created` datetime DEFAULT NULL,
  PRIMARY KEY (`norad`,`epoch`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
