--
-- Tables
--
CREATE TABLE IF NOT EXISTS `usr_users` (
  `id` int(10) NOT NULL,
  `username` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `email` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `password` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `remember_token` varchar(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `usr_details` (
  `user_id` int(10) NOT NULL,
  `total_posts` int(10) NOT NULL,
  `total_threads` int(10) NOT NULL,
  `reg_date` int(10) NOT NULL,
  `last_post_date` int(10) NOT NULL,
  `last_post_location` int(10) NOT NULL,
  `ontime` int(10) NOT NULL,
  `strikes` int(1) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `usr_profile` (
  `user_id` int(10) NOT NULL,
  `gender` int(1) NOT NULL,
  `member_title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `website_address` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `website_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `location` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `birthday` int(10) NOT NULL,
  `bio` text COLLATE utf8_unicode_ci NOT NULL,
  `ip_address` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
  `avatar` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `ostatus` int(1) NOT NULL DEFAULT 1,
  `header` text COLLATE utf8_unicode_ci NOT NULL,
  `footer` text COLLATE utf8_unicode_ci NOT NULL,
  `post_style` text COLLATE utf8_unicode_ci NOT NULL,
  `signature` text COLLATE utf8_unicode_ci NOT NULL,
  `name_style` varchar(500) COLLATE utf8_unicode_ci NOT NULL,
  `display_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `yt_channel` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `country` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `date_format` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `isClock24` int(1) NOT NULL DEFAULT 1,
  `isShowSeconds` int(1) NOT NULL,
  `isShowTimezone` int(1) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `usr_perm_id` (
  `user_id` int(10) NOT NULL,
  `perm_id` int(10) NOT NULL,
  `usr_per_id` int(10) NOT NULL DEFAULT 4,
  `blg_per_id` int(10) NOT NULL DEFAULT 4,
  `for_per_id` int(10) NOT NULL DEFAULT 4,
  `sbx_per_id` int(10) NOT NULL DEFAULT 4,
  `str_per_id` int(10) NOT NULL DEFAULT 4,
  `doc_per_id` int(10) NOT NULL DEFAULT 4,
  `odb_per_id` int(10) NOT NULL DEFAULT 4
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Data
--
INSERT INTO `usr_users` SELECT `id`, `username`, `email`, `password`, NULL, NULL, NULL FROM `for_users`;
INSERT INTO `usr_details` SELECT `id`, `total_posts`, `total_threads`, `reg_date`, `last_post_date`, `last_post_location`, `ontime`, `strikes` FROM `for_users`;
INSERT INTO `usr_profile` SELECT `id`, `gender`, `member_title`, `website_address`, `website_name`, `location`, `birthday`, `bio`, `ip_address`, `avatar`, `ostatus`, `header`, `footer`, NULL, NULL, `name_colour`, `display_name`, `yt_channel`, `country`, `curDF`, NULL, NULL, NULL FROM `for_users`;
INSERT INTO `usr_perm_id` SELECT `id`, `perm_id`, `usr_per_id`, `blg_per_id`, `for_per_id`, `sbx_per_id`, `str_per_id`, `doc_per_id`, `odb_per_id` FROM `for_users`;

--
-- Indexes
--
ALTER TABLE `usr_users`
  ADD PRIMARY KEY (`id`),
  ADD KEY `email` (`email`);
ALTER TABLE `usr_details`
  ADD PRIMARY KEY (`user_id`);
ALTER TABLE `usr_profile`
  ADD PRIMARY KEY (`user_id`);
ALTER TABLE `usr_perm_id`
  ADD PRIMARY KEY (`user_id`);