-- Drop the table if it already exists
DROP TABLE IF EXISTS `vpn_sites`;

-- Create table in MariaDB, mapping SQLite types to appropriate MySQL types
CREATE TABLE `vpn_sites` (
  `site_name`             VARCHAR(255)      NOT NULL,
  `remote_ip`             VARCHAR(45)       DEFAULT NULL,
  `remote_port`           INT               DEFAULT NULL,
  `my_local_udp_port`     INT               NOT NULL,
  `my_ip_in_tunnel`       VARCHAR(45)       NOT NULL,
  `remote_ip_in_tunnel`   VARCHAR(45)       NOT NULL,
  `remote_ip_net_addr`    VARCHAR(45)       DEFAULT NULL,
  `route_mask`            VARCHAR(45)       DEFAULT NULL,
  `route_gw`              VARCHAR(45)       DEFAULT NULL,
  `key`                   TEXT              NOT NULL,
  `cipher`                VARCHAR(100)      DEFAULT NULL,
  `mtu`                   INT               DEFAULT NULL,
  `float`                 TINYINT(1)        DEFAULT NULL,
  PRIMARY KEY (`site_name`)
) ENGINE=InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_unicode_ci;