CREATE TABLE `charges` (
  `id` int NOT NULL,
  `customer_id` int NOT NULL,
  `charge` varchar(50) NOT NULL,
  `name` varchar(100) NOT NULL,
  `price` float(10,2) NOT NULL,
  `status` varchar(50) NOT NULL,
  `api_client_id` int NOT NULL,
  `return_url` varchar(500) DEFAULT NULL,
  `billing_on` varchar(150) DEFAULT NULL,
  `activated_on` varchar(150) DEFAULT NULL,
  `cancelled_on` varchar(150) DEFAULT NULL,
  `trial_ends_on` varchar(150) DEFAULT NULL,
  `decorated_return_url` varchar(250) NOT NULL,
  `updated` datetime NOT NULL,
  `created` datetime NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE `customers` (
  `id` int NOT NULL,
  `charge_id` varchar(50) DEFAULT NULL,
  `shop_name` varchar(150) NOT NULL,
  `email` varchar(100) DEFAULT NULL,
  `country` varchar(5) DEFAULT NULL,
  `phone` varchar(20) DEFAULT NULL,
  `domaine` varchar(150) DEFAULT NULL,
  `token` varchar(250) NOT NULL,
  `paid` int DEFAULT '0',
  `auto` int DEFAULT '0',
  `firstrow` int DEFAULT NULL,
  `dateformat` varchar(20) DEFAULT NULL,
  `timeformat` varchar(20) DEFAULT NULL,
  `allproduct` int DEFAULT NULL,
  `fields` varchar(5000) DEFAULT NULL,
  `labels` varchar(10000) DEFAULT NULL,
  `title` varchar(2000) DEFAULT NULL,
  `already` int DEFAULT NULL,
  `number_format` varchar(1) DEFAULT ',',
  `language` varchar(10) DEFAULT NULL,
  `json` longtext,
  `timezone` varchar(150) DEFAULT NULL,
  `store_json` text,
  `webhooks` int DEFAULT NULL,
  `errors` text,
  `updated` datetime DEFAULT NULL,
  `created` datetime NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE `googles` (
  `id` int NOT NULL,
  `customer_id` int NOT NULL,
  `refresh_token` varchar(250) NOT NULL,
  `created` date NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE `googles_fields` (
  `id` int NOT NULL,
  `name` varchar(250) NOT NULL,
  `title` varchar(250) DEFAULT NULL,
  `type` varchar(20) DEFAULT NULL,
  `color` varchar(20) DEFAULT NULL,
  `created` datetime NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE `googles_sheets` (
  `id` int NOT NULL,
  `google_id` int DEFAULT NULL,
  `customer_id` int DEFAULT NULL,
  `name` varchar(250) NOT NULL,
  `sheet_id` varchar(250) NOT NULL,
  `main` int DEFAULT NULL,
  `product_id` int DEFAULT NULL,
  `target` varchar(500) DEFAULT NULL,
  `updated` datetime NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE `orders` (
  `id` int NOT NULL,
  `customer_id` int NOT NULL,
  `name` varchar(20) NOT NULL,
  `order_id` varchar(100) NOT NULL,
  `type` varchar(20) NOT NULL,
  `json` text,
  `created` datetime NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE `products` (
  `id` int NOT NULL,
  `customer_id` int NOT NULL,
  `product_id` varchar(250) DEFAULT NULL,
  `product_title` text NOT NULL,
  `product_image` text,
  `product_handle` varchar(250) DEFAULT NULL,
  `sheet_id` varchar(100) DEFAULT NULL,
  `sheet_name` text,
  `created` datetime NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE `timezones` (
  `id` int NOT NULL,
  `name` varchar(150) NOT NULL,
  `gmt` int DEFAULT NULL,
  `created` datetime NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE `users` (
  `id` int NOT NULL,
  `nom` varchar(50) NOT NULL,
  `prenom` varchar(50) NOT NULL,
  `email` varchar(100) DEFAULT NULL,
  `username` varchar(50) NOT NULL,
  `password` varchar(255) NOT NULL,
  `lien` varchar(50) DEFAULT NULL,
  `created` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

CREATE TABLE `visitors` (
  `id` int NOT NULL,
  `ip` varchar(50) DEFAULT NULL,
  `city` varchar(100) DEFAULT NULL,
  `created` datetime NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE `webhooks` (
  `id` int NOT NULL,
  `customer_id` int NOT NULL,
  `type_id` int NOT NULL,
  `json` varchar(2000) DEFAULT NULL,
  `status` int DEFAULT NULL,
  `created` datetime NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

