-- https://www.phpmyadmin.net/
--

START TRANSACTION;



--
-- Database: `wifisocial`
--

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

--
-- Table structure for table `advertisings`
--

CREATE TABLE `advertisings` (
  `id_advertising` int(10) UNSIGNED NOT NULL,
  `keyword` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `type` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `media_file` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `position` int(11) NOT NULL,
  `id_device` int(11) NOT NULL,
  `id_user` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `advertisings`
--

INSERT INTO `advertisings` (`id_advertising`, `keyword`, `type`, `media_file`, `position`, `id_device`, `id_user`, `created_at`, `updated_at`) VALUES
(7, 'Banner de Bienvenida', '0', '56052.jpg', 1, 2, 2, '2016-11-16 05:48:14', '2018-06-09 22:23:29'),
(8, 'first', '0', '75471.jpg', 2, 2, 2, '2016-11-16 22:07:26', '2016-12-01 00:25:18'),
(9, 'second', '0', '34624.jpg', 2, 2, 2, '2016-11-16 22:07:50', '2016-12-01 00:42:04'),
(10, 'Fondo de pagina', '0', '52255.jpg', 3, 2, 2, '2016-11-17 06:31:05', '2016-12-01 01:08:52'),
(11, 'third', '0', '55417.jpg', 2, 2, 2, '2016-12-01 00:33:59', '2016-12-01 00:34:13'),
(12, 'four', '0', '47831.jpg', 2, 2, 2, '2016-12-01 00:34:30', '2016-12-01 00:34:30'),
(13, 'five', '0', '71598.jpg', 2, 2, 2, '2016-12-01 00:42:45', '2016-12-01 00:42:45'),
(14, 'colombia coffe', '1', '34346.mp4', 2, 2, 2, '2016-12-01 01:59:21', '2016-12-01 01:59:21');

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

--
-- Table structure for table `google_consumers`
--

CREATE TABLE `google_consumers` (
  `id_consumer` int(11) NOT NULL,
  `id_goo_user` int(11) NOT NULL,
  `full_name` varchar(250) COLLATE utf8_bin NOT NULL,
  `profile_picture` varchar(250) COLLATE utf8_bin NOT NULL,
  `email` text COLLATE utf8_bin NOT NULL,
  `id_user` int(11) NOT NULL,
  `mac` varchar(200) COLLATE utf8_bin NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

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

--
-- Table structure for table `groups`
--

CREATE TABLE `groups` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `permissions` text COLLATE utf8_unicode_ci,
  `protected` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `groups`
--

INSERT INTO `groups` (`id`, `name`, `permissions`, `protected`, `created_at`, `updated_at`) VALUES
(1, 'superadmin', '{\"_superadmin\":1}', 0, '2016-11-06 19:32:48', '2016-11-08 07:53:21'),
(4, 'Member', '{\"_member\":1}', 0, '2016-11-06 19:40:20', '2016-11-08 07:52:15');

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

--
-- Table structure for table `migrations`
--

CREATE TABLE `migrations` (
  `id` int(10) UNSIGNED NOT NULL,
  `migration` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `migrations`
--

INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '2012_12_06_225988_migration_cartalyst_sentry_install_throttle', 1),
(2, '2014_02_19_095545_create_users_table', 1),
(3, '2014_02_19_095623_create_user_groups_table', 1),
(4, '2014_02_19_095637_create_groups_table', 1),
(5, '2014_02_19_160516_create_permission_table', 1),
(6, '2014_02_26_165011_create_user_profile_table', 1),
(7, '2014_05_06_122145_create_profile_field_types', 1),
(8, '2014_05_06_122155_create_profile_field', 1),
(9, '2014_10_12_100000_create_password_resets_table', 1),
(10, '2016_11_06_171457_create_client_devices_table', 2),
(11, '2016_11_07_134509_create_facebook_consumers_table', 3),
(12, '2016_11_08_120137_create_advertisings_table', 4),
(13, '2016_11_08_121000_create_advertisings_table', 5),
(14, '2016_11_08_153445_create_advertisings_table', 6),
(15, '2016_11_08_154207_create_advertisings_table', 7),
(16, '2016_11_09_112205_create_portals_table', 8);

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

--
-- Table structure for table `permission`
--

CREATE TABLE `permission` (
  `id` int(10) UNSIGNED NOT NULL,
  `description` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `permission` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `protected` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `permission`
--

INSERT INTO `permission` (`id`, `description`, `permission`, `protected`, `created_at`, `updated_at`) VALUES
(1, 'superadmin', '_superadmin', 0, '2016-11-06 19:32:48', '2016-11-06 19:32:48'),
(6, 'member', '_member', 0, '2016-11-08 05:23:09', '2016-11-08 05:23:09');

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

--
-- Table structure for table `portals`
--

CREATE TABLE `portals` (
  `id_portal` int(10) UNSIGNED NOT NULL,
  `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `display_popup` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `close_popup_time` int(11) NOT NULL,
  `close_popup_time_seconds` int(11) NOT NULL,
  `redirect_url` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `access_code` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
  `fb_page_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `fb_page_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `share_action` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `share_message` text COLLATE utf8_unicode_ci NOT NULL,
  `like_us_popup` varchar(250) COLLATE utf8_unicode_ci NOT NULL,
  `close_popup_like_time` int(11) NOT NULL,
  `close_popup_like_time_seconds` int(11) NOT NULL,
  `id_device` int(10) NOT NULL,
  `id_user` int(11) NOT NULL,
  `css` text COLLATE utf8_unicode_ci,
  `connect_fb` int(20) NOT NULL DEFAULT '0',
  `connect_ig` int(20) NOT NULL DEFAULT '0',
  `connect_tw` int(20) NOT NULL DEFAULT '0',
  `connect_go` int(20) NOT NULL DEFAULT '0',
  `connect_wa` int(20) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `portals`
--

INSERT INTO `portals` (`id_portal`, `title`, `display_popup`, `close_popup_time`, `close_popup_time_seconds`, `redirect_url`, `access_code`, `fb_page_id`, `fb_page_name`, `share_action`, `share_message`, `like_us_popup`, `close_popup_like_time`, `close_popup_like_time_seconds`, `id_device`, `id_user`, `css`, `connect_fb`, `connect_ig`, `connect_tw`, `connect_go`, `connect_wa`, `created_at`, `updated_at`) VALUES
(2, 'Café Sorrento', '1', 0, 2, 'https://www.facebook.com/cafesorrentoarmenia', '5555', '1374285526139276', 'Café Sorrento', '1', 'share our site', '0', 0, 5, 2, 2, '', 1, 1, 1, 1, 0, '2016-11-17 07:27:57', '2018-06-09 22:16:14');

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

--
-- Table structure for table `profile_field`
--

CREATE TABLE `profile_field` (
  `id` int(10) UNSIGNED NOT NULL,
  `profile_id` int(10) UNSIGNED NOT NULL,
  `profile_field_type_id` int(10) UNSIGNED NOT NULL,
  `value` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Table structure for table `profile_field_type`
--

CREATE TABLE `profile_field_type` (
  `id` int(10) UNSIGNED NOT NULL,
  `description` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

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

--
-- Table structure for table `throttle`
--

CREATE TABLE `throttle` (
  `id` int(10) UNSIGNED NOT NULL,
  `user_id` int(10) UNSIGNED DEFAULT NULL,
  `ip_address` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `attempts` int(11) NOT NULL DEFAULT '0',
  `suspended` tinyint(1) NOT NULL DEFAULT '0',
  `banned` tinyint(1) NOT NULL DEFAULT '0',
  `last_attempt_at` timestamp NULL DEFAULT NULL,
  `suspended_at` timestamp NULL DEFAULT NULL,
  `banned_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `throttle`
--

INSERT INTO `throttle` (`id`, `user_id`, `ip_address`, `attempts`, `suspended`, `banned`, `last_attempt_at`, `suspended_at`, `banned_at`) VALUES
(3, 1, '::1', 0, 0, 0, NULL, NULL, NULL),
(4, 2, '::1', 0, 0, 0, NULL, NULL, NULL),
(5, 3, '::1', 0, 0, 0, NULL, NULL, NULL),
(6, 1, '181.60.34.243', 0, 0, 0, NULL, NULL, NULL),
(7, 3, '181.60.34.243', 5, 1, 0, '2016-11-16 04:19:46', '2016-11-16 04:19:46', NULL),
(8, 2, '181.60.34.243', 0, 0, 0, NULL, NULL, NULL),
(9, 1, '190.9.208.186', 0, 0, 0, NULL, NULL, NULL),
(10, 2, '181.51.186.112', 0, 0, 0, NULL, NULL, NULL),
(11, 1, '127.0.0.1', 1, 0, 0, '2018-06-09 20:07:57', NULL, NULL),
(12, 2, '127.0.0.1', 0, 0, 0, NULL, NULL, NULL),
(13, 3, '127.0.0.1', 0, 0, 0, NULL, NULL, NULL);

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

--
-- Table structure for table `users_devices_connections`
--

CREATE TABLE `users_devices_connections` (
  `id_device` int(11) NOT NULL,
  `id_fb_user` varchar(250) NOT NULL,
  `gw_address` varchar(250) NOT NULL,
  `gw_port` varchar(10) NOT NULL,
  `gw_id` varchar(50) NOT NULL,
  `ip` varchar(50) NOT NULL,
  `mac` varchar(50) NOT NULL,
  `platform` varchar(200) NOT NULL,
  `date` datetime NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `users_devices_connections`
--

INSERT INTO `users_devices_connections` (`id_device`, `id_fb_user`, `gw_address`, `gw_port`, `gw_id`, `ip`, `mac`, `platform`, `date`) VALUES
(1, '3412492687', '10.0.0.1', '2060', 'F4F26DF4ADA6', '10.0.0.148', '58:7f:66:e2:b0:6c', 'instagram', '2016-12-09 06:56:25'),
(2, '3412492687', '10.0.0.1', '2060', 'F4F26DF4ADA6', '10.0.0.148', '58:7f:66:e2:b0:6c', 'instagram', '2016-12-09 08:38:48'),
(3, '381358448878489', '10.0.0.1', '2060', 'F4F26DF4ADA6', '10.0.0.160', '24:df:6a:d8:45:16', 'facebook', '2016-12-09 11:23:58'),
(4, '10154208364573131', '10.0.0.3', '2060', 'F4F26DF4ADA6', '10.0.0.176', '4c:66:41:8b:bf:a0', 'facebook', '2016-12-10 10:35:42');

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

--
-- Table structure for table `users_groups`
--

CREATE TABLE `users_groups` (
  `user_id` int(10) UNSIGNED NOT NULL,
  `group_id` int(10) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `users_groups`
--

INSERT INTO `users_groups` (`user_id`, `group_id`) VALUES
(1, 1),
(2, 4),
(3, 4);

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

--
-- Table structure for table `user_profile`
--

CREATE TABLE `user_profile` (
  `id` int(10) UNSIGNED NOT NULL,
  `user_id` int(10) UNSIGNED NOT NULL,
  `code` varchar(25) COLLATE utf8_unicode_ci DEFAULT NULL,
  `vat` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `first_name` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `last_name` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `phone` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `state` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `city` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `country` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `zip` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
  `address` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `avatar` blob,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `user_profile`
--

INSERT INTO `user_profile` (`id`, `user_id`, `code`, `vat`, `first_name`, `last_name`, `phone`, `state`, `city`, `country`, `zip`, `address`, `avatar`, `created_at`, `updated_at`) VALUES
(1, 1, '1112768143', NULL, 'Jhon Alexander', 'Grisales Rivera', '3165053657', 'Quindio', 'Armenia', 'Colombia', '630001', 'cra 14 ', 0x[BLOB], '2016-11-06 19:32:48', '2016-11-06 19:39:21'),
(2, 2, '11127681432', NULL, 'Manuela', 'Rivera', '675303127', 'BU', 'Chile', 'Antofagasta', '09400', 'Calle', 0x[BLOB], '2016-11-06 19:42:56', '2016-11-06 19:44:37');
INSERT INTO `user_profile` (`id`, `user_id`, `code`, `vat`, `first_name`, `last_name`, `phone`, `state`, `city`, `country`, `zip`, `address`, `avatar`, `created_at`, `updated_at`) VALUES
(3, 3, '11127681438', NULL, 'Jhon Alexander', 'Rivera', '675303127', 'BU', 'Acapulco', 'Mexico', '09800', 'Calle', 0x[BLOB], '2016-11-10 04:20:59', '2016-11-10 22:40:15');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `advertisings`
--
ALTER TABLE `advertisings`
  ADD PRIMARY KEY (`id_advertising`);

--
-- Indexes for table `google_consumers`
--
ALTER TABLE `google_consumers`
  ADD PRIMARY KEY (`id_consumer`);

--
-- Indexes for table `groups`
--
ALTER TABLE `groups`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `groups_name_unique` (`name`);

--
-- Indexes for table `migrations`
--
ALTER TABLE `migrations`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `permission`
--
ALTER TABLE `permission`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `portals`
--
ALTER TABLE `portals`
  ADD PRIMARY KEY (`id_portal`);

--
-- Indexes for table `profile_field`
--
ALTER TABLE `profile_field`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `profile_field_profile_id_profile_field_type_id_unique` (`profile_id`,`profile_field_type_id`),
  ADD KEY `profile_field_profile_field_type_id_foreign` (`profile_field_type_id`);

--
-- Indexes for table `profile_field_type`
--
ALTER TABLE `profile_field_type`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `throttle`
--
ALTER TABLE `throttle`
  ADD PRIMARY KEY (`id`),
  ADD KEY `throttle_user_id_index` (`user_id`);

--
-- Indexes for table `users_devices_connections`
--
ALTER TABLE `users_devices_connections`
  ADD PRIMARY KEY (`id_device`);

--
-- Indexes for table `users_groups`
--
ALTER TABLE `users_groups`
  ADD PRIMARY KEY (`user_id`,`group_id`);

--
-- Indexes for table `user_profile`
--
ALTER TABLE `user_profile`
  ADD PRIMARY KEY (`id`),
  ADD KEY `user_profile_user_id_foreign` (`user_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `advertisings`
--
ALTER TABLE `advertisings`
  MODIFY `id_advertising` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;

--
-- AUTO_INCREMENT for table `google_consumers`
--
ALTER TABLE `google_consumers`
  MODIFY `id_consumer` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `groups`
--
ALTER TABLE `groups`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;

--
-- AUTO_INCREMENT for table `permission`
--
ALTER TABLE `permission`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `portals`
--
ALTER TABLE `portals`
  MODIFY `id_portal` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `profile_field`
--
ALTER TABLE `profile_field`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `profile_field_type`
--
ALTER TABLE `profile_field_type`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `throttle`
--
ALTER TABLE `throttle`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;

--
-- AUTO_INCREMENT for table `users_devices_connections`
--
ALTER TABLE `users_devices_connections`
  MODIFY `id_device` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `user_profile`
--
ALTER TABLE `user_profile`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- Constraints for table `profile_field`
--
ALTER TABLE `profile_field`
  ADD CONSTRAINT `profile_field_profile_field_type_id_foreign` FOREIGN KEY (`profile_field_type_id`) REFERENCES `profile_field_type` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `profile_field_profile_id_foreign` FOREIGN KEY (`profile_id`) REFERENCES `user_profile` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `user_profile`
--
ALTER TABLE `user_profile`
  ADD CONSTRAINT `user_profile_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
COMMIT;

