-- --------------------------------------------------------

CREATE TABLE `del` (
  `num` int(11) NOT NULL,
  `id` varchar(11) NOT NULL DEFAULT '',
  `user_id` varchar(15) NOT NULL DEFAULT '',
  `message_id` varchar(20) NOT NULL DEFAULT '',
  `timeDel` int(20) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

CREATE TABLE `file` (
  `num` int(11) NOT NULL,
  `id` varchar(20) NOT NULL DEFAULT 'none',
  `type` varchar(50) NOT NULL DEFAULT 'none',
  `file_id` varchar(255) NOT NULL DEFAULT 'none',
  `caption` varchar(10000) NOT NULL DEFAULT '',
  `password` varchar(255) NOT NULL DEFAULT '',
  `user_id` varchar(20) NOT NULL DEFAULT '',
  `file_size` bigint(20) NOT NULL DEFAULT 0,
  `downloads` int(11) NOT NULL DEFAULT 0,
  `date` char(200) NOT NULL DEFAULT '0',
  `time` char(200) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

CREATE TABLE `send` (
  `step` varchar(50) NOT NULL,
  `text` text NOT NULL,
  `from` varchar(20) NOT NULL DEFAULT '0',
  `user` int(11) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

CREATE TABLE `settings` (
  `id` int(11) NOT NULL,
  `type` varchar(50) NOT NULL,
  `type_id` varchar(50) NOT NULL,
  `columnOne` varchar(10000) NOT NULL DEFAULT '',
  `columnTwo` varchar(10000) NOT NULL DEFAULT ''
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO `settings` (`id`, `type`, `type_id`, `columnOne`, `columnTwo`) VALUES
(1, 'del', '1', '', ''),
(2, 'admin', 'ADMIN', 'main', '');

-- --------------------------------------------------------

CREATE TABLE `user` (
  `id` int(11) NOT NULL,
  `from_id` varchar(20) NOT NULL,
  `step` varchar(50) NOT NULL DEFAULT 'none',
  `downloads` int(20) NOT NULL DEFAULT 0,
  `getFile` varchar(255) NOT NULL DEFAULT 'none',
  `status` varchar(40) NOT NULL DEFAULT 'active',
  `update_at` int(20) DEFAULT NULL,
  `create_at` int(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ------------------------------
ALTER TABLE `del`
  ADD PRIMARY KEY (`num`);

-- ------------------------------
ALTER TABLE `file`
  ADD PRIMARY KEY (`num`);

-- ------------------------------
ALTER TABLE `settings`
  ADD PRIMARY KEY (`id`);

-- ------------------------------
ALTER TABLE `user`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `from_id` (`from_id`);

-- ------------------------------
ALTER TABLE `del`
  MODIFY `num` int(11) NOT NULL AUTO_INCREMENT;

-- ------------------------------
ALTER TABLE `file`
  MODIFY `num` int(11) NOT NULL AUTO_INCREMENT;

-- ------------------------------
ALTER TABLE `settings`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

-- ------------------------------
ALTER TABLE `user`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
