-- +goose Up
-- Prepare staging tables for legacy helicopter dump import.

CREATE TABLE IF NOT EXISTS helicopter_old_import (
  id int(11) NOT NULL,
  name varchar(50) NOT NULL,
  type varchar(20) DEFAULT NULL,
  counter int(11) DEFAULT NULL,
  engine1 varchar(50) DEFAULT NULL,
  engine2 varchar(50) DEFAULT NULL,
  consumption double(10,2) DEFAULT NULL,
  service varchar(255) DEFAULT NULL,
  nr1 tinyint(1) DEFAULT 0,
  nr2 tinyint(1) DEFAULT 0,
  lh tinyint(1) DEFAULT 0,
  rh tinyint(1) DEFAULT 0,
  mgb tinyint(1) DEFAULT 0,
  igb tinyint(1) DEFAULT 0,
  tgb tinyint(1) DEFAULT 0,
  utc varchar(10) DEFAULT NULL,
  disabled tinyint(1) DEFAULT 0,
  visible tinyint(1) DEFAULT 1,
  dry tinyint(1) DEFAULT 0,
  docs text,
  PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

CREATE TABLE IF NOT EXISTS helicopter_old_id_map (
  old_id int(11) NOT NULL,
  new_id binary(16) NOT NULL,
  PRIMARY KEY (old_id),
  UNIQUE KEY uq_helicopter_old_id_map_new_id (new_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

-- +goose Down
DROP TABLE IF EXISTS helicopter_old_id_map;
DROP TABLE IF EXISTS helicopter_old_import;
