-- 1
INSERT INTO `influenc_v2`.`campaign_goal_image` (`id`,`created_at`,`updated_at`,`mime`,`name`,`size`,`title`)
VALUES (1,'2022-10-03 15:01:34.323566','2022-10-03 15:22:34.000000','image/png','83366690-4f61-475c-b7e0-0bf8036a81b2.PNG',29487,NULL);
INSERT INTO `influenc_v2`.`campaign_goal_image` (`id`,`created_at`,`updated_at`,`mime`,`name`,`size`,`title`)
VALUES (2,'2022-10-03 15:01:34.323566','2022-10-11 11:01:37.946680','image/png','88990011-4f61-475c-b7e0-0bf8036a81b2.PNG',29487,NULL);
INSERT INTO `influenc_v2`.`campaign_goal_image` (`id`,`created_at`,`updated_at`,`mime`,`name`,`size`,`title`)
VALUES (3,'2022-10-03 15:29:34.826415','2022-10-03 15:29:34.826415','image/png','6210cba2-56ee-407b-aa16-aafbfc59bfca.PNG',26051,NULL);

-- 2
INSERT INTO `influenc_v2`.`campaign_goal` (`id`,`created_at`,`updated_at`,`title`,`story`,`summary`,`goal_image_id`,`is_active`)
VALUES (1,'2022-10-03 15:01:34.251979','2022-10-11 10:43:47.326616','Brand Awareness','The goal of this campaign is to use the reach a content creator has built on social media in a specific niche to communicate a brand message and create brand awareness.','Increasing your reach within relevant audiences by tapping into the audience and creativity of creators.',1,1);
INSERT INTO `influenc_v2`.`campaign_goal` (`id`,`created_at`,`updated_at`,`title`,`story`,`summary`,`goal_image_id`,`is_active`)
VALUES (2,'2022-10-03 15:29:34.735000','2022-10-11 10:43:47.336809','Engagement','The goal of this campaign is to use the trust that the content creator has built with their audience and their authenticity as a communicator to make their audience engage with your website, content or product.','Drive traffic onto a landing page with your influencer campaign by reaching the right audience.',2,1);
INSERT INTO `influenc_v2`.`campaign_goal` (`id`,`created_at`,`updated_at`,`title`,`story`,`summary`,`goal_image_id`,`is_active`)
VALUES (3,'2022-10-05 15:14:27.824316','2022-10-11 10:43:47.339796','Conversions','The goal of this campaign is to increase sales of your campaign using a content creator as a spokesperson within a specific community. This campaign can be similar to an affiliate campaign. ','Direct Calls to Action and convincing ',3,1);

-- 3
INSERT INTO `platform` (`id`, `created_at`, `name`, `icon`, `position`, `is_enabled`, `platform_enum`, `has_api`) VALUES
(1, '2022-04-04 10:30:49.922781', 'Instagram', 'instagram.svg', 1, 1, 'instagram', 1),
(2, '2022-04-04 10:30:49.922781', 'YouTube', 'youtube.svg', 2, 1, 'youtube', 1),
(3, '2022-04-04 10:30:49.922781', 'Facebook', 'facebook.svg', 3, 1, '', 0),
(4, '2022-04-04 10:30:49.922781', 'TikTok', 'tiktok.svg', 4, 1, 'tiktok', 1),
(5, '2022-04-04 10:30:49.922781', 'Podcast', 'podcast.svg', 5, 1, '', 0),
(6, '2022-04-04 10:30:49.922781', 'Twitter', 'twitter.svg', 6, 1, '', 0),
(7, '2022-04-04 10:30:49.922781', 'Blog', 'blog.svg', 7, 1, '', 0),
(8, '2022-08-19 12:57:38.090882', 'Twitch', 'twitch.svg', 8, 0, '', 0);

-- 4
INSERT INTO `platform_items` (`id`, `created_at`, `platform`, `name`, `type`, `icon`, `position`, `has_advertising`, `is_long_term`, `is_live`, `is_enabled`, `likes`, `dislikes`, `comments`, `shares`, `clicks`, `saves`, `sticker_engagements`, `swipe_up_links`, `views`, `watch_time`, `reach`,`impressions`, `main_platform_id`) VALUES
(1, '2022-04-04 10:06:22.534593', 'instagram', 'instagram', 'posting', 'instagram_post.svg', 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1),
(2, '2022-04-04 10:06:22.534593', 'facebook', 'facebook', 'posting', 'facebook_post.svg', 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3),
(3, '2022-04-04 10:06:22.534593', 'youtube', 'youtube', 'posting', 'youtube_post.svg', 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2),
(4, '2022-04-04 10:06:22.534593', 'instagram', 'instagram_story', 'shorts', 'instagram_story.svg', 4, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
(5, '2022-04-04 10:06:22.534593', 'twitter', 'twitter', 'posting', 'twitter_post.svg', 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6),
(6, '2022-04-04 10:06:22.534593', 'blog', 'blog', 'posting', 'blog.svg', 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7),
(7, '2022-04-04 10:06:22.534593', 'tiktok', 'tiktok', 'posting', 'tiktok.svg', 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4),
(8, '2022-04-04 10:06:22.534593', 'instagram', 'instagram_reels', 'posting', 'instagram_reels.svg', 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
(9, '2022-04-04 10:06:22.534593', 'instagram', 'instagram_tv', 'posting', 'instagram_tv.svg', 9, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
(10, '2022-04-04 10:06:22.534593', 'podcast', 'podcast', 'posting', 'podcast.svg', 10, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5),
(11, '2022-08-19 13:51:21.288072', 'twitch', 'twitch', 'posting', 'twitch.svg', 11, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 8),
(12, '2022-04-04 10:06:22.534593', 'youtube', 'youtube_shorts', 'shorts', 'youtube_shorts.svg', 12, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2),
(13, '2022-04-04 10:06:22.534593', 'facebook', 'facebook_live', 'posting', 'facebook_live.svg', 13, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3),
(14, '2022-04-04 10:06:22.534593', 'facebook', 'facebook_story', 'shorts', 'facebook_story.svg', 14, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3);
-- 5
INSERT INTO `influenc_v2`.`creator_type_image` (`id`, `created_at`, `updated_at`, `mime`, `name`, `size`, `title`)
VALUES
   	(1,'2022-10-04 13:28:26.788710','2022-10-04 13:28:26.788710','image/png','24fdc2d0-efe3-4c50-ae88-e73d1da10e35.PNG',29487,NULL),
   	(2,'2022-10-04 13:47:49.392789','2022-10-04 13:47:49.392789','image/png','d50f2fd0-d8e6-4c19-88af-3e76b1aafb54.PNG',29487,NULL),
   	(3,'2022-10-04 13:48:24.966070','2022-10-04 13:48:24.966070','image/png','7ff2ebe8-e412-4c03-996f-6e2b0faa9f34.PNG',29487,NULL);

-- 6
INSERT INTO `influenc_v2`.`creator_type` (`id`, `created_at`, `updated_at`, `title`, `description`, `followers_range_from`, `followers_range_to`, `is_active`, `creator_type_image_id`)
VALUES
   	(1,'2022-10-04 13:28:26.677612','2022-10-04 13:28:26.000000','Mix','LOrem ipsum dolor sit',0,5000000,1,1),
   	(2,'2022-10-04 13:47:49.184852','2022-10-04 13:47:49.000000','Micro','LOrem ipsum dolor sit',10000,50000,1,2),
   	(3,'2022-10-04 13:48:24.931483','2022-10-04 13:48:24.000000','Macro','LOrem ipsum dolor sit',50000,5000000,1,3);

-- 7
INSERT INTO `influenc_v2`.`budget_range` (`id`, `created_at`, `updated_at`, `min_price`, `recommended_min_budget`, `recommended_max_budget`, `nb_platforms`, `creator_type_id`, `max_price`)
VALUES
	(1,'2022-10-05 15:17:04.595961','2022-10-25 15:28:42.149918',5000,7500,20000,1,1,200000),
	(2,'2022-10-05 15:17:04.600348','2022-10-25 15:28:42.150514',7500,11250,30000,2,1,200000),
	(3,'2022-10-05 15:17:04.601157','2022-10-25 15:28:42.150968',10000,15000,40000,3,1,200000),
	(4,'2022-10-05 15:17:04.602054','2022-10-25 15:28:42.151580',12500,18750,50000,4,1,200000),
	(5,'2022-10-05 15:17:04.602905','2022-10-25 15:28:42.152235',15000,22500,60000,5,1,200000),
	(6,'2022-10-05 15:17:04.603609','2022-10-25 15:28:42.152554',17500,26250,70000,6,1,200000),
	(7,'2022-10-05 15:19:16.480994','2022-10-25 15:28:42.152944',3000,4500,12000,1,2,200000),
	(8,'2022-10-05 15:19:16.482523','2022-10-25 15:28:42.153240',4500,6750,18000,2,2,200000),
	(9,'2022-10-05 15:19:16.483398','2022-10-25 15:28:42.153529',6000,9000,24000,3,2,200000),
	(10,'2022-10-05 15:19:16.484760','2022-10-25 15:28:42.154463',7500,11250,30000,4,2,200000),
	(11,'2022-10-05 15:19:16.486020','2022-10-25 15:28:42.154753',9000,13500,36000,5,2,200000),
	(12,'2022-10-05 15:19:16.486824','2022-10-25 15:28:42.155032',10500,15750,42000,6,2,200000),
	(13,'2022-10-05 15:20:42.269504','2022-10-25 15:28:42.155317',12000,18000,48000,1,3,200000),
	(14,'2022-10-05 15:20:42.273630','2022-10-25 15:28:42.155591',18000,27000,72000,2,3,200000),
	(15,'2022-10-05 15:20:42.275192','2022-10-25 15:28:42.155863',24000,36000,96000,3,3,200000),
	(16,'2022-10-05 15:20:42.275998','2022-10-25 15:28:42.156150',30000,45000,12000,4,3,200000),
	(17,'2022-10-05 15:20:42.276707','2022-10-25 15:28:42.157014',36000,54000,144000,5,3,200000),
	(18,'2022-10-05 15:20:42.277434','2022-10-25 15:28:42.148451',42000,63000,168000,6,3,20000);

-- 8
INSERT INTO `influenc_v2`.`user_photo`
(`id`,
`name`,
`mime`,
`created_at`,
`updated_at`)
SELECT
`id`,
`name`,
`mime`,
`created_at`,
`updated_at`
FROM `influenc_backup`.`user_photo`;

-- 9
INSERT INTO `influenc_v2`.`users`
(`id`,
`created_at`,
`updated_at`,
`username`,
`email`,
`password`,
`first_name`,
`last_name`,
`is_enabled`,
`last_login`,
`confirmation_token`,
`password_requested_at`,
`roles`,
`user_type`,
`display_name`,
`gender`,
`birthdate`,
`about`,
`total_followers`,
`total_reach`,
`total_engagements`,
`brand_type`,
`last_login_ip`,
`average_like_to_follower_ratio`,
`locale`,
`omr`,
`referral_code`,
`ambassador_status`,
`is_managed`,
`profile_photo_id`,
`salt`,
`contact_phone`,
`contact_street`,
`contact_city`,
`contact_province`,
`contact_zip`,
`contact_company_name`,
`contact_company_register`,
`contact_small_business`,
`contact_uid_number`,
`contact_country`,
`contact_invoice_first_name`,
`contact_invoice_last_name`)
SELECT `id`,
`created_at`,
`updated_at`,
`username`,
`email`,
`password`,
`first_name`,
`last_name`,
`enabled`,
`last_login`,
`confirmation_token`,
`password_requested_at`,
(CASE
     WHEN roles =  'a:0{}' THEN 'ROLE_USER'
     WHEN roles = 'a:1:{i:0;s:11:"ROLE_AGENCY";}' THEN 'ROLE_AGENCY'
     WHEN roles = 'a:1:{i:0;s:12:"ROLE_PARTNER";}' THEN 'ROLE_PARTNER'
     WHEN roles = 'a:1:{i:0;s:15:"ROLE_ADMIN_BLOG";}' THEN 'ROLE_ADMIN_BLOG'
     WHEN roles = 'a:1:{i:0;s:16:"ROLE_SUPER_ADMIN";}' THEN 'ROLE_SUPER_ADMIN'
     ELSE 'ROLE_USER'
END),
`type`,
`display_name`,
`gender`,
`birthdate`,
`about`,
`total_followers`,
`total_reach`,
`total_engagements`,
`brand_type`,
`last_login_ip`,
`avg_like_to_follower_ratio`,
`locale`,
`omr`,
`referral_code`,
`ambassador_status`,
`managed`,
`profile_photo_id`,
`password`,
`contact_phone`,
`contact_street`,
`contact_city`,
`contact_province`,
`contact_zip`,
`contact_company_name`,
`contact_company_register`,
`contact_small_business`,
`contact_uid_number`,
`contact_country`,
`contact_invoice_first_name`,
`contact_invoice_last_name`
FROM `influenc_backup`.`user`;

-- 10
UPDATE `influenc_v2`.`users` nu SET agency_id = (SELECT agency_id FROM `influenc_backup`.`user` WHERE nu.id = id);

-- 11
UPDATE`influenc_v2`.`users` nu SET referred_by_id = (SELECT referred_by_id FROM `influenc_backup`.`user` WHERE nu.id = id);

-- 12
INSERT INTO `influenc_v2`.`brand`
(`id`,
`created_at`,
`updated_at`,
`name`,
`user_id`)
SELECT `brand`.`id`,
    `brand`.`created_at`,
    `brand`.`updated_at`,
	`brand`.`name`,
    (SELECT `user_id` FROM `influenc_backup`.`user_user_brands` WHERE `brand_id` = `influenc_backup`.`brand`.`id`)
FROM `influenc_backup`.`brand`;

-- 13
INSERT INTO `influenc_v2`.`campaigns`
(`id`,
`created_at`,
`updated_at`,
`title`,
`details`,
`ad_description`,
`url`,
`hashtags`,
`use_content`,
`date`,
`publish_from`,
`publish_to`,
`gender`,
`is_reviewed`,
`audience_age_min`,
`audience_age_max`,
`status`,
`type_description`,
`review_days`,
`creators`,
`gross_budget`,
`net_budget`,
`fee_amount`,
`fee_percentage`,
`audience`,
`use_content_text`,
`package`,
`is_charity`,
`brand_id`,
`user_id`,
`posting_deadline`,
`approval_status`,
`campaign_goal_id`,
`last_change`)
SELECT `campaign`.`id`,
    `campaign`.`created_at`,
    `campaign`.`updated_at`,
    `campaign`.`title`,
    `campaign`.`details`,
    `campaign`.`ad_description`,
    `campaign`.`url`,
    `campaign`.`hashtags`,
    `campaign`.`use_content`,
    `campaign`.`date`,
    `campaign`.`publish_from`,
    `campaign`.`publish_to`,
    `campaign`.`gender`,
    `campaign`.`review`,
    `campaign`.`age_min`,
    `campaign`.`age_max`,
    (CASE
         WHEN `campaign`.`status` =  'draft' THEN 'draft'
         WHEN `campaign`.`status` =  'published' AND `campaign`.`audience` = 'private' THEN 'private'
         WHEN `campaign`.`status` =  'published' AND `campaign`.`audience` = 'public' THEN 'published'
         WHEN `campaign`.`status` =  'published' AND `campaign`.`audience` = '' THEN 'published'
         ELSE 'pending'
    END),
     `campaign`.`type_description`,
    `campaign`.`review_days`,
    `campaign`.`creators`,
    `campaign`.`gross_budget`,
    `campaign`.`net_budget`,
    `campaign`.`fee_amount`,
    0.75,
    `campaign`.`audience`,
    `campaign`.`use_content_text`,
    `campaign`.`package`,
    IFNULL (`campaign`.`charity`,0),
    `campaign`.`brand_id`,
    `campaign`.`user_id`,
    `campaign`.`publish_to`,
        (CASE
             WHEN `campaign`.`status` =  'draft' THEN 'pending'
             ELSE 'approved'
        END),
    1,
    `campaign`.`updated_at`
FROM `influenc_backup`.`campaign`;

-- 14
UPDATE `influenc_backup`.`campaign_campaign_category`
SET `influenc_backup`.`campaign_campaign_category`.`category_id` = 4 WHERE `influenc_backup`.`campaign_campaign_category`.`category_id` IN (
	SELECT `influenc_backup`.`campaign_category`.`id` FROM `influenc_backup`.`campaign_category` WHERE `influenc_backup`.`campaign_category`.`name` = 'beauty_and_fashion'
);

-- 15
UPDATE `influenc_backup`.`campaign_campaign_category`
SET `influenc_backup`.`campaign_campaign_category`.`category_id` = 11 WHERE `influenc_backup`.`campaign_campaign_category`.`category_id` IN (
	SELECT `influenc_backup`.`campaign_category`.`id` FROM `influenc_backup`.`campaign_category` WHERE `influenc_backup`.`campaign_category`.`name` = 'tech'
);

-- 16
UPDATE `influenc_backup`.`campaign_campaign_category`
SET `influenc_backup`.`campaign_campaign_category`.`category_id` = 19 WHERE `influenc_backup`.`campaign_campaign_category`.`category_id` IN (
	SELECT `influenc_backup`.`campaign_category`.`id` FROM `influenc_backup`.`campaign_category` WHERE `influenc_backup`.`campaign_category`.`name` = 'other'
);

-- 17
UPDATE `influenc_backup`.`campaign_campaign_category`
SET `influenc_backup`.`campaign_campaign_category`.`category_id` = 30 WHERE `influenc_backup`.`campaign_campaign_category`.`category_id` IN (
	SELECT `influenc_backup`.`campaign_category`.`id` FROM `influenc_backup`.`campaign_category` WHERE `influenc_backup`.`campaign_category`.`name` = 'health_fitness'
);


-- 18
UPDATE `influenc_backup`.`campaign_campaign_category`
SET `influenc_backup`.`campaign_campaign_category`.`category_id` = 31 WHERE `influenc_backup`.`campaign_campaign_category`.`category_id` IN (
	SELECT `influenc_backup`.`campaign_category`.`id` FROM `influenc_backup`.`campaign_category` WHERE `influenc_backup`.`campaign_category`.`name` = 'food'
);

-- 19
UPDATE `influenc_backup`.`campaign_campaign_category`
SET `influenc_backup`.`campaign_campaign_category`.`category_id` = 66 WHERE `influenc_backup`.`campaign_campaign_category`.`category_id` IN (
	SELECT `influenc_backup`.`campaign_category`.`id` FROM `influenc_backup`.`campaign_category` WHERE `influenc_backup`.`campaign_category`.`name` = 'lifestyle'
);

-- 20
UPDATE `influenc_backup`.`campaign_campaign_category`
SET `influenc_backup`.`campaign_campaign_category`.`category_id` = 91 WHERE `influenc_backup`.`campaign_campaign_category`.`category_id` IN (
	SELECT `influenc_backup`.`campaign_category`.`id` FROM `influenc_backup`.`campaign_category` WHERE `influenc_backup`.`campaign_category`.`name` = 'travel'
);

-- 21
UPDATE `influenc_backup`.`campaign_campaign_category`
SET `influenc_backup`.`campaign_campaign_category`.`category_id` = 92 WHERE `influenc_backup`.`campaign_campaign_category`.`category_id` IN (
	SELECT `influenc_backup`.`campaign_category`.`id` FROM `influenc_backup`.`campaign_category` WHERE `influenc_backup`.`campaign_category`.`name` = 'sport'
);

-- 22
UPDATE `influenc_backup`.`campaign_campaign_category`
SET `influenc_backup`.`campaign_campaign_category`.`category_id` = 110 WHERE `influenc_backup`.`campaign_campaign_category`.`category_id` IN (
	SELECT `influenc_backup`.`campaign_category`.`id` FROM `influenc_backup`.`campaign_category` WHERE `influenc_backup`.`campaign_category`.`name` = 'diy'
);

-- 23
UPDATE `influenc_backup`.`campaign_campaign_category`
SET `influenc_backup`.`campaign_campaign_category`.`category_id` = 114 WHERE `influenc_backup`.`campaign_campaign_category`.`category_id` IN (
	SELECT `influenc_backup`.`campaign_category`.`id` FROM `influenc_backup`.`campaign_category` WHERE `influenc_backup`.`campaign_category`.`name` = 'family'
);

-- 24
UPDATE `influenc_backup`.`campaign_campaign_category`
SET `influenc_backup`.`campaign_campaign_category`.`category_id` = 143 WHERE `influenc_backup`.`campaign_campaign_category`.`category_id` IN (
	SELECT `influenc_backup`.`campaign_category`.`id` FROM `influenc_backup`.`campaign_category` WHERE `influenc_backup`.`campaign_category`.`name` = 'music'
);

-- 25
UPDATE `influenc_backup`.`campaign_campaign_category`
SET `influenc_backup`.`campaign_campaign_category`.`category_id` = 144 WHERE `influenc_backup`.`campaign_campaign_category`.`category_id` IN (
	SELECT `influenc_backup`.`campaign_category`.`id` FROM `influenc_backup`.`campaign_category` WHERE `influenc_backup`.`campaign_category`.`name` = 'auto'
);

-- 26
UPDATE `influenc_backup`.`campaign_campaign_category`
SET `influenc_backup`.`campaign_campaign_category`.`category_id` = 159 WHERE `influenc_backup`.`campaign_campaign_category`.`category_id` IN (
	SELECT `influenc_backup`.`campaign_category`.`id` FROM `influenc_backup`.`campaign_category` WHERE `influenc_backup`.`campaign_category`.`name` = 'gaming_apps'
);

-- 27
UPDATE `influenc_backup`.`campaign_campaign_category`
SET `influenc_backup`.`campaign_campaign_category`.`category_id` = 161 WHERE `influenc_backup`.`campaign_campaign_category`.`category_id` IN (
	SELECT `influenc_backup`.`campaign_category`.`id` FROM `influenc_backup`.`campaign_category` WHERE `influenc_backup`.`campaign_category`.`name` = 'pets'
);

-- 28
UPDATE `influenc_backup`.`campaign_campaign_category`
SET `influenc_backup`.`campaign_campaign_category`.`category_id` = 20452 WHERE `influenc_backup`.`campaign_campaign_category`.`category_id` IN (
	SELECT `influenc_backup`.`campaign_category`.`id` FROM `influenc_backup`.`campaign_category` WHERE `influenc_backup`.`campaign_category`.`name` = 'personal_development'
);

-- 29
UPDATE `influenc_backup`.`campaign_campaign_category`
SET `influenc_backup`.`campaign_campaign_category`.`category_id` = 20460 WHERE `influenc_backup`.`campaign_campaign_category`.`category_id` IN (
	SELECT `influenc_backup`.`campaign_category`.`id` FROM `influenc_backup`.`campaign_category` WHERE `influenc_backup`.`campaign_category`.`name` = 'fashion'
);

-- 30
UPDATE `influenc_backup`.`campaign_campaign_category`
SET `influenc_backup`.`campaign_campaign_category`.`category_id` = 20510 WHERE `influenc_backup`.`campaign_campaign_category`.`category_id` IN (
	SELECT `influenc_backup`.`campaign_category`.`id` FROM `influenc_backup`.`campaign_category` WHERE `influenc_backup`.`campaign_category`.`name` = 'finance'
);

-- 31
UPDATE `influenc_backup`.`campaign_campaign_category`
SET `influenc_backup`.`campaign_campaign_category`.`category_id` = 20511 WHERE `influenc_backup`.`campaign_campaign_category`.`category_id` IN (
	SELECT `influenc_backup`.`campaign_category`.`id` FROM `influenc_backup`.`campaign_category` WHERE `influenc_backup`.`campaign_category`.`name` = 'interior'
);

-- 32
UPDATE `influenc_backup`.`campaign_campaign_category`
SET `influenc_backup`.`campaign_campaign_category`.`category_id` = 20512 WHERE `influenc_backup`.`campaign_campaign_category`.`category_id` IN (
	SELECT `influenc_backup`.`campaign_category`.`id` FROM `influenc_backup`.`campaign_category` WHERE `influenc_backup`.`campaign_category`.`name` = 'sustainability'
);

-- 33
UPDATE `influenc_backup`.`user_user_category`
SET `influenc_backup`.`user_user_category`.`category_id` = 4 WHERE `influenc_backup`.`user_user_category`.`category_id` IN (
	SELECT `influenc_backup`.`campaign_category`.`id` FROM `influenc_backup`.`campaign_category` WHERE `influenc_backup`.`campaign_category`.`name` = 'beauty_and_fashion'
);

-- 34
UPDATE `influenc_backup`.`user_user_category`
SET `influenc_backup`.`user_user_category`.`category_id` = 11 WHERE `influenc_backup`.`user_user_category`.`category_id` IN (
	SELECT `influenc_backup`.`campaign_category`.`id` FROM `influenc_backup`.`campaign_category` WHERE `influenc_backup`.`campaign_category`.`name` = 'tech'
);

-- 35
UPDATE `influenc_backup`.`user_user_category`
SET `influenc_backup`.`user_user_category`.`category_id` = 19 WHERE `influenc_backup`.`user_user_category`.`category_id` IN (
	SELECT `influenc_backup`.`campaign_category`.`id` FROM `influenc_backup`.`campaign_category` WHERE `influenc_backup`.`campaign_category`.`name` = 'other'
);

-- 36
UPDATE `influenc_backup`.`user_user_category`
SET `influenc_backup`.`user_user_category`.`category_id` = 30 WHERE `influenc_backup`.`user_user_category`.`category_id` IN (
	SELECT `influenc_backup`.`campaign_category`.`id` FROM `influenc_backup`.`campaign_category` WHERE `influenc_backup`.`campaign_category`.`name` = 'health_fitness'
);

-- 37
UPDATE `influenc_backup`.`user_user_category`
SET `influenc_backup`.`user_user_category`.`category_id` = 31 WHERE `influenc_backup`.`user_user_category`.`category_id` IN (
	SELECT `influenc_backup`.`campaign_category`.`id` FROM `influenc_backup`.`campaign_category` WHERE `influenc_backup`.`campaign_category`.`name` = 'food'
);

-- 38
UPDATE `influenc_backup`.`user_user_category`
SET `influenc_backup`.`user_user_category`.`category_id` = 66 WHERE `influenc_backup`.`user_user_category`.`category_id` IN (
	SELECT `influenc_backup`.`campaign_category`.`id` FROM `influenc_backup`.`campaign_category` WHERE `influenc_backup`.`campaign_category`.`name` = 'lifestyle'
);

-- 39
UPDATE `influenc_backup`.`user_user_category`
SET `influenc_backup`.`user_user_category`.`category_id` = 91 WHERE `influenc_backup`.`user_user_category`.`category_id` IN (
	SELECT `influenc_backup`.`campaign_category`.`id` FROM `influenc_backup`.`campaign_category` WHERE `influenc_backup`.`campaign_category`.`name` = 'travel'
);

-- 40
UPDATE `influenc_backup`.`user_user_category`
SET `influenc_backup`.`user_user_category`.`category_id` = 92 WHERE `influenc_backup`.`user_user_category`.`category_id` IN (
	SELECT `influenc_backup`.`campaign_category`.`id` FROM `influenc_backup`.`campaign_category` WHERE `influenc_backup`.`campaign_category`.`name` = 'sport'
);

-- 41
UPDATE `influenc_backup`.`user_user_category`
SET `influenc_backup`.`user_user_category`.`category_id` = 110 WHERE `influenc_backup`.`user_user_category`.`category_id` IN (
	SELECT `influenc_backup`.`campaign_category`.`id` FROM `influenc_backup`.`campaign_category` WHERE `influenc_backup`.`campaign_category`.`name` = 'diy'
);

-- 42
UPDATE `influenc_backup`.`user_user_category`
SET `influenc_backup`.`user_user_category`.`category_id` = 114 WHERE `influenc_backup`.`user_user_category`.`category_id` IN (
	SELECT `influenc_backup`.`campaign_category`.`id` FROM `influenc_backup`.`campaign_category` WHERE `influenc_backup`.`campaign_category`.`name` = 'family'
);

-- 43
UPDATE `influenc_backup`.`user_user_category`
SET `influenc_backup`.`user_user_category`.`category_id` = 143 WHERE `influenc_backup`.`user_user_category`.`category_id` IN (
	SELECT `influenc_backup`.`campaign_category`.`id` FROM `influenc_backup`.`campaign_category` WHERE `influenc_backup`.`campaign_category`.`name` = 'music'
);

-- 44
UPDATE `influenc_backup`.`user_user_category`
SET `influenc_backup`.`user_user_category`.`category_id` = 144 WHERE `influenc_backup`.`user_user_category`.`category_id` IN (
	SELECT `influenc_backup`.`campaign_category`.`id` FROM `influenc_backup`.`campaign_category` WHERE `influenc_backup`.`campaign_category`.`name` = 'auto'
);

-- 45
UPDATE `influenc_backup`.`user_user_category`
SET `influenc_backup`.`user_user_category`.`category_id` = 159 WHERE `influenc_backup`.`user_user_category`.`category_id` IN (
	SELECT `influenc_backup`.`campaign_category`.`id` FROM `influenc_backup`.`campaign_category` WHERE `influenc_backup`.`campaign_category`.`name` = 'gaming_apps'
);

-- 46
UPDATE `influenc_backup`.`user_user_category`
SET `influenc_backup`.`user_user_category`.`category_id` = 161 WHERE `influenc_backup`.`user_user_category`.`category_id` IN (
	SELECT `influenc_backup`.`campaign_category`.`id` FROM `influenc_backup`.`campaign_category` WHERE `influenc_backup`.`campaign_category`.`name` = 'pets'
);

-- 47
UPDATE `influenc_backup`.`user_user_category`
SET `influenc_backup`.`user_user_category`.`category_id` = 20452 WHERE `influenc_backup`.`user_user_category`.`category_id` IN (
	SELECT `influenc_backup`.`campaign_category`.`id` FROM `influenc_backup`.`campaign_category` WHERE `influenc_backup`.`campaign_category`.`name` = 'personal_development'
);

-- 48
UPDATE `influenc_backup`.`user_user_category`
SET `influenc_backup`.`user_user_category`.`category_id` = 20460 WHERE `influenc_backup`.`user_user_category`.`category_id` IN (
	SELECT `influenc_backup`.`campaign_category`.`id` FROM `influenc_backup`.`campaign_category` WHERE `influenc_backup`.`campaign_category`.`name` = 'fashion'
);

-- 49
UPDATE `influenc_backup`.`user_user_category`
SET `influenc_backup`.`user_user_category`.`category_id` = 20510 WHERE `influenc_backup`.`user_user_category`.`category_id` IN (
	SELECT `influenc_backup`.`campaign_category`.`id` FROM `influenc_backup`.`campaign_category` WHERE `influenc_backup`.`campaign_category`.`name` = 'finance'
);

-- 50
UPDATE `influenc_backup`.`user_user_category`
SET `influenc_backup`.`user_user_category`.`category_id` = 20511 WHERE `influenc_backup`.`user_user_category`.`category_id` IN (
	SELECT `influenc_backup`.`campaign_category`.`id` FROM `influenc_backup`.`campaign_category` WHERE `influenc_backup`.`campaign_category`.`name` = 'interior'
);

-- 51
UPDATE `influenc_backup`.`user_user_category`
SET `influenc_backup`.`user_user_category`.`category_id` = 20512 WHERE `influenc_backup`.`user_user_category`.`category_id` IN (
	SELECT `influenc_backup`.`campaign_category`.`id` FROM `influenc_backup`.`campaign_category` WHERE `influenc_backup`.`campaign_category`.`name` = 'sustainability'
);

-- 52
DELETE FROM `influenc_backup`.`campaign_category` WHERE `influenc_backup`.`campaign_category`.`id` NOT IN (
    4,
    11,
    19,
    30,
    31,
    66,
    91,
    92,
    110,
    114,
    143,
    144,
    159,
    161,
    20452,
    20460,
    20510,
    20511,
    20512
);

-- 53
INSERT INTO `influenc_v2`.`campaign_categories`
(
`id`,
`created_at`,
`updated_at`,
`name`
)
SELECT
`id`,
`created_at`,
`updated_at`,
`name`
FROM `influenc_backup`.`campaign_category`;

-- 54
INSERT INTO `influenc_v2`.`campaign_campaign_categories`
(
`id`,
`campaign_id`,
`campaign_category_id`
)
SELECT
NULL,
`campaign_id`,
`category_id`
FROM `influenc_backup`.`campaign_campaign_category`;

-- 55
INSERT INTO `influenc_v2`.`user_campaign_categories`
(
`id`,
`user_id`,
`campaign_category_id`
)
SELECT
NULL,
`user_id`,
`category_id`
FROM `influenc_backup`.`user_user_category`;

-- 56
INSERT INTO `influenc_v2`.`campaign_country`
(`id`,
`created_at`,
`updated_at`,
`name`,
`campaign_id`)
SELECT `campaign_country`.`id`,
    `campaign_country`.`created_at`,
    `campaign_country`.`updated_at`,
    `campaign_country`.`name`,
    `campaign_campaign_country`.`campaign_id`
FROM `influenc_backup`.`campaign_country`
INNER JOIN `influenc_backup`.`campaign_campaign_country`
ON  `influenc_backup`.`campaign_country`.`id`=`influenc_backup`.`campaign_campaign_country`.`country_id`;

-- 57
INSERT INTO `influenc_v2`.`campaign_audience_country`
(`id`,
`created_at`,
`updated_at`,
`name`,
`campaign_id`)
SELECT `campaign_country`.`id`,
    `campaign_country`.`created_at`,
    `campaign_country`.`updated_at`,
    `campaign_country`.`name`,
    `campaign_campaign_audience_country`.`campaign_id`
FROM `influenc_backup`.`campaign_country`
INNER JOIN `influenc_backup`.`campaign_campaign_audience_country`
ON  `influenc_backup`.`campaign_country`.`id`=`influenc_backup`.`campaign_campaign_audience_country`.`country_id`;

-- 58
INSERT INTO `influenc_v2`.`campaign_group`
(`id`,
`created_at`,
`updated_at`,
`title`)
SELECT `campaign_group`.`id`,
    `campaign_group`.`created_at`,
    `campaign_group`.`updated_at`,
    `campaign_group`.`title`
FROM `influenc_backup`.`campaign_group`;

-- 59
INSERT INTO `influenc_v2`.`campaign_package`
(`id`,
`created_at`,
`updated_at`,
`name`,
`cpm_max`,
`cpm_min`,
`price`)
SELECT `campaign_package`.`id`,
    `campaign_package`.`created_at`,
    `campaign_package`.`updated_at`,
    `campaign_package`.`name`,
    `campaign_package`.`cpm_max`,
    `campaign_package`.`cpm_min`,
    `campaign_package`.`price`
FROM `influenc_backup`.`campaign_package`;

-- 60
INSERT INTO `influenc_v2`.`campaign_group_category`
(`campaign_group_id`,
`campaign_categories_id`)
SELECT `campaign_group_category`.`campaign_group_id`,
    `campaign_group_category`.`category_id`
FROM `influenc_backup`.`campaign_group_category`;

-- 61
INSERT INTO `influenc_v2`.`campaign_group_package`
(`campaign_group_id`,
`campaign_package_id`)
SELECT `campaign_group_package`.`campaign_group_id`,
    `campaign_group_package`.`package_id`
FROM `influenc_backup`.`campaign_group_package`;

-- 62
INSERT INTO `influenc_v2`.`campaign_image`
(`id`,
`created_at`,
`updated_at`,
`mime`,
`name`,
`purpose`,
`size`,
`source`,
`title`)
SELECT `campaign_image`.`id`,
    `campaign_image`.`created_at`,
    `campaign_image`.`updated_at`,
    `campaign_image`.`mime`,
    `campaign_image`.`name`,
    `campaign_image`.`purpose`,
    `campaign_image`.`size`,
    `campaign_image`.`source`,
    `campaign_image`.`title`
FROM `influenc_backup`.`campaign_image`;

-- 63
UPDATE `influenc_v2`.`campaign_image`,`influenc_backup`.`campaign_campaign_image`
SET `influenc_v2`.`campaign_image`.`campaign_id` = `influenc_backup`.`campaign_campaign_image`.`campaign_id`
WHERE `influenc_backup`.`campaign_campaign_image`.`image_id` = `influenc_v2`.`campaign_image`.`id`;

-- 64
INSERT INTO `influenc_v2`.`campaign_invoice`
(`id`,
`created_at`,
`updated_at`,
`date`,
`delivery_status`,
`description`,
`grand_total`,
`payment_status`,
`total_fee_amount`,
`total_net_price`,
`total_vat_amount`,
`campaign_id`,
`user_id`)
SELECT `campaign_invoice`.`id`,
    `campaign_invoice`.`created_at`,
    `campaign_invoice`.`updated_at`,
    `campaign_invoice`.`date`,
    `campaign_invoice`.`delivery_status`,
    `campaign_invoice`.`description`,
    `campaign_invoice`.`grand_total`,
    `campaign_invoice`.`payment_status`,
    `campaign_invoice`.`total_fee_amount`,
    `campaign_invoice`.`total_net_price`,
    `campaign_invoice`.`total_vat_amount`,
    `campaign_invoice`.`campaign_id`,
    `campaign_invoice`.`to_id`
FROM `influenc_backup`.`campaign_invoice`;

-- 65
INSERT INTO `influenc_v2`.`campaign_invoice_item`
(`id`,
`created_at`,
`updated_at`,
`description`,
`grand_total`,
`fee_percentage`,
`fee_amount`,
`net_price`,
`vat_amount`,
`vat_percentage`,
`report_item_id`,
`invoice_id`)
SELECT `campaign_invoice_item`.`id`,
    `campaign_invoice_item`.`created_at`,
    `campaign_invoice_item`.`updated_at`,
    `campaign_invoice_item`.`description`,
	`campaign_invoice_item`.`grand_total`,
    `campaign_invoice_item`.`fee_percentage`,
    `campaign_invoice_item`.`fee_amount`,
    `campaign_invoice_item`.`net_price`,
    `campaign_invoice_item`.`vat_amount`,
    `campaign_invoice_item`.`vat_percentage`,
    `campaign_invoice_item`.`report_id`,
	`campaign_invoice_item`.`invoice_id`
FROM `influenc_backup`.`campaign_invoice_item`;

-- 66
INSERT INTO `influenc_v2`.`campaign_platform`
(`id`,
`created_at`,
`updated_at`,
`name`,
`nb_posts`)
SELECT `campaign_platform`.`id`,
    `campaign_platform`.`created_at`,
    `campaign_platform`.`updated_at`,
    `campaign_platform`.`name`,
    `campaign_platform`.`nb_posts`
FROM `influenc_backup`.`campaign_platform`;

-- 67
UPDATE `influenc_v2`.`campaign_platform`,`influenc_backup`.`campaign_campaign_platform`
SET `influenc_v2`.`campaign_platform`.`campaign_id` = `influenc_backup`.`campaign_campaign_platform`.`campaign_id`
WHERE `influenc_backup`.`campaign_campaign_platform`.`platform_id` = `influenc_v2`.`campaign_platform`.`id`;

-- 68
INSERT INTO `influenc_v2`.`campaign_referred`
(`id`,
`created_at`,
`updated_at`,
`fee`,
`total_booking_budget`,
`influencer_booking_budget`,
`is_invoiced`,
`is_managed`,
`user_id`,
`campaign_id`)
SELECT `campaign_referred`.`id`,
    `campaign_referred`.`created_at`,
    `campaign_referred`.`updated_at`,
    `campaign_referred`.`fee`,
    `campaign_referred`.`total_booking_budget`,
    `campaign_referred`.`influencer_booking_budget`,
    `campaign_referred`.`invoiced`,
    `campaign_referred`.`managed`,
    `campaign_referred`.`user_id`,
    `campaign_referred`.`campaign_id`
FROM `influenc_backup`.`campaign_referred`;

-- 69
INSERT INTO `influenc_v2`.`campaign_type`
(`id`,
`created_at`,
`updated_at`,
`name`)
SELECT `campaign_type`.`id`,
    `campaign_type`.`created_at`,
	`campaign_type`.`updated_at`,
    `campaign_type`.`name`
FROM `influenc_backup`.`campaign_type`;

-- 70
INSERT INTO `influenc_v2`.`blog_photo`
(`id`,
`name`,
`size`,
`mime`,
`created_at`,
`updated_at`)
SELECT `blog_photo`.`id`,
    `blog_photo`.`name`,
    `blog_photo`.`size`,
    `blog_photo`.`mime`,
    `blog_photo`.`created_at`,
    `blog_photo`.`updated_at`
FROM `influenc_backup`.`blog_photo`;

-- 71
INSERT INTO `influenc_v2`.`blog`
(`id`,
`title`,
`slug`,
`video`,
`meta_keywords`,
`meta_description`,
`created_at`,
`updated_at`,
`view_count_singular`,
`view_count_plural`,
`author`,
`category`,
`locale`,
`intro`,
`text`,
`is_enabled`,
`main_image_id`)
SELECT `blog`.`id`,
    `blog`.`title`,
    `blog`.`slug`,
    `blog`.`video`,
    `blog`.`meta_keywords`,
    `blog`.`meta_description`,
    `blog`.`created_at`,
    `blog`.`updated_at`,
    `blog`.`view_count_singular`,
    `blog`.`view_count_plural`,
    `blog`.`author`,
    `blog`.`category`,
    `blog`.`locale`,
    `blog`.`intro`,
    `blog`.`text`,
    `blog`.`enabled`,
    `blog`.`main_image_id`
FROM `influenc_backup`.`blog`;

-- 72
INSERT INTO `influenc_v2`.`workshop`
(`id`,
`name`,
`widget`,
`is_enabled`,
`created_at`,
`updated_at`,
`position`)
SELECT `workshop`.`id`,
    `workshop`.`name`,
    `workshop`.`widget`,
    `workshop`.`enabled`,
    `workshop`.`created_at`,
    `workshop`.`updated_at`,
    `workshop`.`position`
FROM `influenc_backup`.`workshop`;

-- 73
INSERT INTO `influenc_v2`.`cookie_consent_log`
(`id`,
`ip_address`,
`cookie_consent_key`,
`cookie_name`,
`cookie_value`,
`timestamp`)
SELECT `ch_cookieconsent_log`.`id`,
    `ch_cookieconsent_log`.`ip_address`,
    `ch_cookieconsent_log`.`cookie_consent_key`,
    `ch_cookieconsent_log`.`cookie_name`,
    `ch_cookieconsent_log`.`cookie_value`,
    `ch_cookieconsent_log`.`timestamp`
FROM `influenc_backup`.`ch_cookieconsent_log`;

-- 74
INSERT INTO `influenc_v2`.`credits_request`
(`id`,
`created_at`,
`updated_at`,
`first_name`,
`last_name`,
`company_name`,
`company_address`,
`company_vat_number`,
`company_registration_number`,
`company_email`,
`company_phone`,
`accepted_terms`,
`status`,
`credits`,
`user_id`)
SELECT `credits_request`.`id`,
    `credits_request`.`created_at`,
    `credits_request`.`updated_at`,
    `credits_request`.`first_name`,
    `credits_request`.`last_name`,
    `credits_request`.`company_name`,
    `credits_request`.`company_address`,
    `credits_request`.`company_vat_number`,
    `credits_request`.`company_registration_number`,
    `credits_request`.`company_email`,
    `credits_request`.`company_phone`,
    `credits_request`.`accepted_terms`,
    `credits_request`.`status`,
    `credits_request`.`credits`,
    `credits_request`.`user_id`
FROM `influenc_backup`.`credits_request`;

-- 75
INSERT INTO `influenc_v2`.`attachment`
(`id`,
`created_at`,
`updated_at`,
`name`,
`title`,
`size`,
`mime`)
SELECT `attachment`.`id`,
    `attachment`.`created_at`,
    `attachment`.`updated_at`,
    `attachment`.`name`,
    `attachment`.`title`,
    `attachment`.`size`,
    `attachment`.`mime`
FROM `influenc_backup`.`attachment`;

-- 76
INSERT INTO `influenc_v2`.`thread`
(`id`,
`created_at`,
`updated_at`,
`subject`,
`is_spam`,
`bounded_entity_class_name`,
`bounded_entity_identifier`,
`created_by_id`)
SELECT `thread`.`id`,
    `thread`.`created_at`,
    NULL,
    `thread`.`subject`,
    `thread`.`is_spam`,
    `thread`.`bounded_entity_class_name`,
    `thread`.`bounded_entity_identifier`,
	`thread`.`created_by_id`
FROM `influenc_backup`.`thread`;

-- 77
INSERT INTO `influenc_v2`.`thread_metadata`
(`id`,
`is_deleted`,
`last_participant_message_date`,
`last_message_date`,
`thread_id`,
`participant_id`)
SELECT `thread_metadata`.`id`,
    `thread_metadata`.`is_deleted`,
    `thread_metadata`.`last_participant_message_date`,
    `thread_metadata`.`last_message_date`,
    `thread_metadata`.`thread_id`,
    `thread_metadata`.`participant_id`
FROM `influenc_backup`.`thread_metadata`;

-- 78
INSERT INTO `influenc_v2`.`message`
(`id`,
`created_at`,
`updated_at`,
`body`,
`thread_id`,
`sender_id`)
SELECT `message`.`id`,
    `message`.`created_at`,
    NULL,
    `message`.`body`,
    `message`.`thread_id`,
	`message`.`sender_id`
FROM `influenc_backup`.`message`;

-- 79
INSERT INTO `influenc_v2`.`message_attachments`
(`message_id`,
`attachment_id`)
SELECT `message_attachment`.`message_id`,
    `message_attachment`.`attachment_id`
FROM `influenc_backup`.`message_attachment`;

-- 80
INSERT INTO `influenc_v2`.`message_metadata`
(`id`,
`is_read`,
`message_id`,
`participant_id`)
SELECT `message_metadata`.`id`,
    `message_metadata`.`is_read`,
    `message_metadata`.`message_id`,
    `message_metadata`.`participant_id`
FROM `influenc_backup`.`message_metadata`;

-- 81
INSERT INTO `influenc_v2`.`offer`
(`id`,
`created_at`,
`updated_at`,
`status`,
`paid_amount`,
`description`,
`price`,
`is_requested`,
`is_favorite`,
`is_best_pick`,
`campaign_id`,
`user_id`,
`negotiation_finished`,
`parent_offer_id`,
`counter_offer_by_id`)
SELECT `offer`.`id`,
    `offer`.`created_at`,
    `offer`.`updated_at`,
    `offer`.`status`,
    `offer`.`paid`,
    `offer`.`description`,
    `offer`.`price`,
    `offer`.`requested`,
    `offer`.`is_favorite`,
    `offer`.`is_best_pick`,
	`offer`.`campaign_id`,
    `offer`.`user_id`,
    `offer`.`negotiation_finished`,
    NULL,
    `offer`.`counter_offer_by_id`
FROM `influenc_backup`.`offer`;

-- 82
UPDATE `influenc_v2`.`offer`,`influenc_backup`.`offer`
SET `influenc_v2`.`offer`.`parent_offer_id` = `influenc_backup`.`offer`.`parent_offer_id`
WHERE `influenc_backup`.`offer`.`id` = `influenc_v2`.`offer`.`id`;

-- 83
INSERT INTO `influenc_v2`.`offer_item`
(`id`,
`created_at`,
`updated_at`,
`platform`,
`nb_posts`,
`price`,
`offer_id`)
SELECT `offer_item`.`id`,
    `offer_item`.`created_at`,
    `offer_item`.`updated_at`,
    `offer_item`.`platform`,
    `offer_item`.`nb_posts`,
    `offer_item`.`price`,
	(SELECT `offer_id` FROM `influenc_backup`.`offer_items` WHERE `item_id` = `influenc_backup`.`offer_item`.`id`)
FROM `influenc_backup`.`offer_item`;

-- 84
INSERT INTO `influenc_v2`.`user_clothing`
(`id`,
`created_at`,
`updated_at`,
`clothing_tshirt`,
`clothing_shoes`,
`clothing_pants`,
`clothing_swim_wear`,
`clothing_hat`,
`clothing_sweater`,
`clothing_bath`,
`clothing_sneakers`,
`clothing_skirts`,
`user_id`)
SELECT
	NULL,
	`created_at`,
	`updated_at`,
	`clothing_tshirt`,
	`clothing_shoes`,
	`clothing_pants`,
	`clothing_swim_wear`,
	`clothing_hat`,
	`clothing_sweather`,
	`clothing_bath`,
	`clothing_sneakers`,
	`clothing_skirts`,
`id` FROM `influenc_backup`.`user`
WHERE `clothing_tshirt` IS NOT NULL
OR `clothing_tshirt` IS NOT NULL
OR `clothing_shoes` IS NOT NULL
OR `clothing_pants` IS NOT NULL
OR `clothing_swim_wear` IS NOT NULL
OR `clothing_hat` IS NOT NULL
OR `clothing_sweather` IS NOT NULL
OR `clothing_bath` IS NOT NULL
OR `clothing_sneakers` IS NOT NULL
OR `clothing_skirts` IS NOT NULL;

-- 85
INSERT INTO `influenc_v2`.`user_bank_account`
(`id`,
`created_at`,
`updated_at`,
`user_id`,
`bank_account_bank_name`,
`bank_account_iban`,
`bank_account_swift`,
`bank_account_payment_type`,
`bank_account_country`)
SELECT
	NULL,
	`created_at`,
	`updated_at`,
	`id`,
	`bank_account_bank_name`,
	`bank_account_iban`,
	`bank_account_swift`,
	`bank_account_payment_type`,
	`bank_account_country`
FROM `influenc_backup`.`user`;

-- 86
INSERT INTO `influenc_v2`.`user_bank_account_document`
(`id`,
`created_at`,
`updated_at`,
`name`,
`size`,
`mime`,
`user_id`)
SELECT
	NULL,
	`created_at`,
	`updated_at`,
	`name`,
	`size`,
	`mime`,
	`user_id`
FROM `influenc_backup`.`user_bank_account_document`;

-- 87
INSERT INTO `influenc_v2`.`user_device`
(`id`,
`created_at`,
`updated_at`,
`token`,
`discriminator`,
`user_id`)
SELECT
	`id`,
	`created_at`,
	`updated_at`,
	`token`,
	`discriminator`,
	`user_id`
FROM `influenc_backup`.`user_device`;

-- 88
INSERT INTO `influenc_v2`.`user_notifications`
(`id`,
`created_at`,
`updated_at`,
`is_notification_by_email_requested`,
`is_notification_in_browser_requested`,
`is_notification_by_sms_requested`,
`user_id`)
SELECT NULL,
    `user`.`created_at`,
    `user`.`updated_at`,
	IFNULL(`user`.`notifications_email`,0),
    IFNULL(`user`.`notifications_browser`,0),
    IFNULL(`user`.`notifications_sms`,0),
    `user`.`id`
FROM `influenc_backup`.`user`;

-- 89
INSERT INTO `influenc_v2`.`user_oauth`
(`id`,
`created_at`,
`updated_at`,
`oauth_facebook_id`,
`oauth_facebook_access_token`,
`oauth_google_id`,
`oauth_google_access_token`,
`oauth_instagram_id`,
`oauth_instagram_access_token`,
`user_id`)
SELECT
	NULL,
	`created_at`,
	`updated_at`,
	`oauth_facebook_id`,
	`oauth_facebook_access_token`,
	`oauth_google_id`,
	`oauth_google_access_token`,
	`oauth_instagram_id`,
	`oauth_instagram_access_token`,
	`id`
FROM `influenc_backup`.`user`;

-- 90
INSERT INTO `influenc_v2`.`user_platform`
(`id`,
`created_at`,
`updated_at`,
`name`,
`title`,
`data`,
`is_enabled`,
`platform_id`,
`followers`,
`reach`,
`like_follower_ratio`,
`audience_data_updated_at`,
`audience_report_file_id`,
`audience_data_history_updated_at`,
`user_id`,
`status`)
SELECT
	`user_platform`.`id`,
	`user_platform`.`created_at`,
	`user_platform`.`updated_at`,
	`user_platform`.`name`,
	`user_platform`.`title`,
	NULL,
	`user_platform`.`enabled`,
	`user_platform`.`platform_id`,
	`user_platform`.`followers`,
	`user_platform`.`reach`,
	`user_platform`.`like_follower_ratio`,
	`user_platform`.`audience_data_updated_at`,
	`user_platform`.`audience_report_file_id`,
	`user_platform`.`audience_data_history_updated_at`,
    `user_user_platform`.`user_id`,
    (CASE
         WHEN `user_platform`.`enabled` =  true THEN 'approved'
         WHEN `user_platform`.`enabled` =  false THEN 'pending'
         ELSE 'pending'
    END)
FROM `influenc_backup`.`user_platform`
LEFT JOIN `influenc_backup`.`user_user_platform` ON `influenc_backup`.`user_user_platform`.`platform_id` = `influenc_backup`.`user_platform`.`id`;

-- 91
INSERT INTO `influenc_v2`.`audience`
(`id`,
`created_at`,
`updated_at`,
`dimension`,
`metric`,
`value`,
`user_platform_id`)
SELECT
	NULL,
    `audience`.`created_at`,
    NULL,
    `audience`.`dimension`,
    `audience`.`metric`,
    `audience`.`value`,
	(SELECT `influenc_v2`.`user_platform`.`id` FROM `influenc_v2`.`user_platform` WHERE `influenc_backup`.`audience`.`platform_id` = `influenc_v2`.`user_platform`.`id`)
FROM `influenc_backup`.`audience`;

-- 92
INSERT INTO `influenc_v2`.`user_terms_and_conditions`
(`id`,
`created_at`,
`updated_at`,
`is_general_terms_accepted`,
`is_privacy_policy_accepted`,
`user_id`)
SELECT
	NULL,
	`terms_and_conditions_created_at`,
	`terms_and_conditions_updated_at`,
	`terms_and_conditions_general_terms`,
	`terms_and_conditions_privacy_policy`,
`id`
FROM `influenc_backup`.`user`;

-- 93
INSERT INTO `influenc_v2`.`marketing_account`
(`id`,
`created_at`,
`updated_at`,
`account_id`,
`user_id`)
SELECT `marketing_account`.`id`,
	NULL,
    NULL,
    `marketing_account`.`account_id`,
    `marketing_account`.`user_id`
FROM `influenc_backup`.`marketing_account`;

-- 94
INSERT INTO `influenc_v2`.`audience_data_history`
(`id`,
`created_at`,
`updated_at`,
`month`,
`followers`,
`average_likes`,
`average_comments`,
`average_views`,
`total_views`,
`following`,
`user_platform_id`)
SELECT NULL,
	`audience_data_history`.`created_at`,
    NULL,
    `audience_data_history`.`month`,
    `audience_data_history`.`followers`,
    `audience_data_history`.`avg_likes`,
    `audience_data_history`.`avg_comments`,
    `audience_data_history`.`avg_views`,
    `audience_data_history`.`total_views`,
    `audience_data_history`.`following`,
    `audience_data_history`.`platform_id`
FROM `influenc_backup`.`audience_data_history`;

-- 95
INSERT INTO `influenc_v2`.`audience_report_file`
(`id`,
`created_at`,
`updated_at`,
`name`,
`size`,
`mime`)
SELECT NULL,
    `audience_report_file`.`created_at`,
    `audience_report_file`.`updated_at`,
    `audience_report_file`.`name`,
    `audience_report_file`.`size`,
    `audience_report_file`.`mime`
FROM `influenc_backup`.`audience_report_file`;

-- 96
INSERT INTO `influenc_v2`.`feed_item`
(`id`,
`created_at`,
`updated_at`,
`platform`,
`uri_id`,
`feed_id`,
`title`,
`type`,
`permalink_url`,
`user_id`,
`statistic_date`,
`statistic_views`,
`statistic_likes`,
`statistic_dislikes`,
`statistic_comments`,
`statistic_shares`,
`published_at`,
`description`)
SELECT `feed_item`.`uuid`,
    `feed_item`.`created_at`,
    `feed_item`.`updated_at`,
    `feed_item`.`platform`,
    `feed_item`.`id`,
    `feed_item`.`feed_id`,
    `feed_item`.`title`,
    `feed_item`.`type`,
    `feed_item`.`permalink_url`,
    `feed_item`.`user_id`,
    `feed_item`.`statistic_date`,
    `feed_item`.`statistic_views`,
    `feed_item`.`statistic_likes`,
    `feed_item`.`statistic_dislikes`,
    `feed_item`.`statistic_comments`,
    `feed_item`.`statistic_shares`,
    `feed_item`.`published`,
    `feed_item`.`description`
FROM `influenc_backup`.`feed_item`;

-- 97
INSERT INTO `influenc_v2`.`post_file`
(`id`,
`created_at`,
`updated_at`,
`name`,
`size`,
`mime`,
`title`,
`feed_item_id`)
SELECT `post_file`.`id`,
    `post_file`.`created_at`,
    `post_file`.`updated_at`,
    `post_file`.`name`,
    `post_file`.`size`,
    `post_file`.`mime`,
    `post_file`.`title`,
    `post_file`.`feed_item_id`
FROM `influenc_backup`.`post_file`;

-- 98
INSERT INTO `influenc_v2`.`post_image`
(`id`,
`created_at`,
`updated_at`,
`name`,
`size`,
`mime`,
`title`,
`feed_item_id`)
SELECT `post_image`.`id`,
    `post_image`.`created_at`,
    `post_image`.`updated_at`,
    `post_image`.`name`,
    `post_image`.`size`,
    `post_image`.`mime`,
    `post_image`.`title`,
    `post_image`.`feed_item_id`
FROM `influenc_backup`.`post_image`;

-- 99
INSERT INTO `influenc_v2`.`external_user_profile`
(`id`,
`created_at`,
`updated_at`,
`username`,
`photo_url`,
`followers_count`,
`following_count`,
`average_count`,
`average_likes`,
`average_comments`,
`full_name`,
`about`,
`channel_id`,
`platform`,
`internal_user_id`)
SELECT `external_user_profile`.`id`,
    `external_user_profile`.`created_at`,
    `external_user_profile`.`updated_at`,
    `external_user_profile`.`username`,
    `external_user_profile`.`photo_url`,
    `external_user_profile`.`followers_count`,
    `external_user_profile`.`following_count`,
    `external_user_profile`.`avg_count`,
    `external_user_profile`.`avg_likes`,
    `external_user_profile`.`avg_comments`,
    `external_user_profile`.`full_name`,
    `external_user_profile`.`about`,
    `external_user_profile`.`channel_id`,
    `external_user_profile`.`platform`,
	`external_user_profile`.`internal_user_id`
FROM `influenc_backup`.`external_user_profile`;

-- 100
INSERT INTO `influenc_v2`.`external_audience_data_history`
(`created_at`,
`updated_at`,
`month`,
`followers`,
`average_likes`,
`average_comments`,
`average_views`,
`total_views`,
`following`,
`external_user_profile_id`)
SELECT `external_audience_data_history`.`created_at`,
	NULL,
    `external_audience_data_history`.`month`,
    `external_audience_data_history`.`followers`,
    `external_audience_data_history`.`avg_likes`,
    `external_audience_data_history`.`avg_comments`,
    `external_audience_data_history`.`avg_views`,
    `external_audience_data_history`.`total_views`,
    `external_audience_data_history`.`following`,
    `external_audience_data_history`.`external_user_profile_id`
FROM `influenc_backup`.`external_audience_data_history`;

-- 101
INSERT INTO `influenc_v2`.`external_search_history`
(`id`,
`created_at`,
`updated_at`,
`external_user_profile_id`,
`user_id`)
SELECT `external_search_history`.`id`,
	`external_search_history`.`created_at`,
    `external_search_history`.`updated_at`,
    `external_search_history`.`external_user_profile_id`,
	`external_search_history`.`user_id`
FROM `influenc_backup`.`external_search_history`;

-- 102
INSERT INTO `influenc_v2`.`external_audience`
(`created_at`,
`updated_at`,
`dimension`,
`metric`,
`value`,
`external_user_profile_id`)
SELECT `external_audience`.`created_at`,
	NULL,
    `external_audience`.`dimension`,
    `external_audience`.`metric`,
    `external_audience`.`value`,
    `external_audience`.`external_user_profile_id`
FROM `influenc_backup`.`external_audience`;

-- INSERT INTO `influenc_v2`.`event_log`
-- (`id`,
-- `created_at`,
-- `updated_at`,
-- `event`,
-- `message`,
-- `message_args`,
-- `route`,
-- `route_args`,
-- `other_data`,
-- `is_seen`,
-- `user_id`)
-- SELECT `log_event_log`.`id`,
--     `log_event_log`.`created_at`,
--     `log_event_log`.`updated_at`,
--     `log_event_log`.`event`,
--     `log_event_log`.`message`,
--     `log_event_log`.`message_args`,
--     `log_event_log`.`route`,
--     `log_event_log`.`route_args`,
--     `log_event_log`.`other_data`,
-- 	`log_event_log`.`seen`,
--     `event_log_user`.`user_id`
-- FROM `influenc_backup`.`log_event_log`
-- INNER JOIN `influenc_backup`.`event_log_user` ON `event_log_user`.`event_log_id` = `log_event_log`.`id`;

-- 103
INSERT INTO `influenc_v2`.`ambassador_invoice`
(`id`,
`created_at`,
`updated_at`,
`status`,
`earnings`,
`number`,
`vat`,
`vat_amount`,
`total`,
`user_id`,
`contact_phone`,
`contact_street`,
`contact_city`,
`contact_province`,
`contact_zip`,
`contact_company_name`,
`contact_company_register`,
`contact_small_business`,
`contact_uid_number`,
`contact_country`,
`contact_invoice_first_name`,
`contact_invoice_last_name`,
`bank_account_bank_name`,
`bank_account_iban`,
`bank_account_swift`,
`bank_account_payment_type`)
SELECT `ambassador_invoice`.`id`,
    `ambassador_invoice`.`created_at`,
    `ambassador_invoice`.`updated_at`,
    `ambassador_invoice`.`status`,
    `ambassador_invoice`.`earning`,
    `ambassador_invoice`.`number`,
	`ambassador_invoice`.`vat`,
    `ambassador_invoice`.`vat_amount`,
	`ambassador_invoice`.`total`,
    `ambassador_invoice`.`user_id`,
    `ambassador_invoice`.`contact_phone`,
    `ambassador_invoice`.`contact_street`,
    `ambassador_invoice`.`contact_city`,
    `ambassador_invoice`.`contact_province`,
    `ambassador_invoice`.`contact_zip`,
    `ambassador_invoice`.`contact_company_name`,
    `ambassador_invoice`.`contact_company_register`,
    `ambassador_invoice`.`contact_small_business`,
    `ambassador_invoice`.`contact_uid_number`,
    `ambassador_invoice`.`contact_country`,
    `ambassador_invoice`.`contact_invoice_first_name`,
    `ambassador_invoice`.`contact_invoice_last_name`,
    `ambassador_invoice`.`bank_account_bank_name`,
    `ambassador_invoice`.`bank_account_iban`,
    `ambassador_invoice`.`bank_account_swift`,
    `ambassador_invoice`.`bank_account_payment_type`
FROM `influenc_backup`.`ambassador_invoice`;

-- 104
INSERT INTO `influenc_v2`.`ambassador_invoice_item`
(`id`,
`created_at`,
`updated_at`,
`earning`,
`ambassador_invoice_id`,
`offer_id`,
`user_id`)
SELECT `ambassador_invoice_item`.`id`,
    `ambassador_invoice_item`.`created_at`,
    `ambassador_invoice_item`.`updated_at`,
    `ambassador_invoice_item`.`earning`,
    `ambassador_invoice_item`.`invoice_id`,
    `ambassador_invoice_item`.`offer_id`,
    `ambassador_invoice_item`.`user_id`
FROM `influenc_backup`.`ambassador_invoice_item`;

-- 105
INSERT INTO `influenc_v2`.`company`(
`created_at`,
`created_by`,
`display_name`,
`first_name`,
`last_name`,
`about`,
`email`,
`contact_phone`,
`contact_street`,
`contact_city`,
`contact_province`,
`contact_zip`,
`contact_company_name`,
`contact_company_register`,
`contact_small_business`,
`contact_uid_number`,
`contact_country`,
`contact_invoice_first_name`,
`contact_invoice_last_name`,
`fee`)SELECT
    `created_at`,
    `id`,
    `display_name`,
    `first_name`,
    `last_name`,
    `about`,
    `email`,
    `contact_phone`,
    `contact_street`,
    `contact_city`,
    `contact_province`,
    `contact_zip`,
    `contact_company_name`,
    `contact_company_register`,
    `contact_small_business`,
    `contact_uid_number`,
    `contact_country`,
    `contact_invoice_first_name`,
    `contact_invoice_last_name`,
    0.75
    FROM `influenc_v2`.`users` WHERE `user_type`='brand';

-- 106
INSERT INTO `influenc_v2`.`agency`(`created_at`,
`created_by_id`,
`display_name`,
`first_name`,
`last_name`,
`about`,
`contact_phone`,
`contact_street`,
`contact_city`,
`contact_province`,
`contact_zip`,
`contact_company_name`,
`contact_company_register`,
`contact_small_business`,
`contact_uid_number`,
`contact_country`,
`contact_invoice_first_name`,
`contact_invoice_last_name`,
`email`)SELECT
    `created_at`,
    `id`,
    `display_name`,
    `first_name`,
    `last_name`,
    `about`,
    `contact_phone`,
    `contact_street`,
    `contact_city`,
    `contact_province`,
    `contact_zip`,
    `contact_company_name`,
    `contact_company_register`,
    `contact_small_business`,
    `contact_uid_number`,
    `contact_country`,
    `contact_invoice_first_name`,
    `contact_invoice_last_name`,
     `email`
     FROM `influenc_v2`.`users` WHERE `user_type`='agency';

-- 107

-- 108
INSERT INTO `influenc_v2`.`report_item`
(`id`,`offer_id`,`external_feed_item_id`,`url`,`platform`,`views`,`impressions`,`likes`,`dislikes`,`comments`,`shares`,`created_at`,`updated_at`,`related_feed_item_id`,
`description`,`swipe_up_links`,`sticker_engagements`,`is_manual`,`additional_post`,`reach`,`clicks`,`saves`,`watch_time`)
SELECT `id`,`offer_id`,`feed_item_id`,`url`,`platform`,0,`views`,`likes`,`dislikes`,`comments`,`shares`,`created_at`,`updated_at`,`related_feed_item_id`,
`description`,`swipe_up_links`,`sticker_engagements`,`manual`,`addition_post`,`reach`,`clicks`,`saves`,`watch_time`
FROM `influenc_backup`.`report_item`;

-- 109
INSERT INTO `influenc_v2`.`report_image`
(`id`,`name`,`size`,`mime`,`title`,`created_at`,`updated_at`,`created_by`,`updated_by`,`report_item_id`)
SELECT `id`,`name`,`size`,`mime`,`title`,`created_at`,`updated_at`,`created_by`,`updated_by`,
(SELECT `report_item_id` FROM `influenc_backup`.`report_item_image` WHERE `influenc_backup`.`report_item_image`.`image_id`=`influenc_backup`.`report_image`.`id`)
FROM `influenc_backup`.`report_image`;

-- 112
UPDATE `influenc_v2`.`agency`,`influenc_v2`.`users`
SET `influenc_v2`.`users`.`agency_company_id` = `influenc_v2`.`agency`.`id`
WHERE `influenc_v2`.`users`.`user_type`='agency'
AND `influenc_v2`.`agency`.`created_by_id` = `influenc_v2`.`users`.`id`;

-- 113
UPDATE `influenc_v2`.`users` `t1`
INNER JOIN `influenc_v2`.`users` `t2`
ON ( `t1`.`agency_id` = `t2`.`id`
AND `t1`.`agency_id` IS NOT NULL )
SET    `t1`.`agency_company_id` = `t2`.`agency_company_id`;

-- 114
UPDATE `influenc_v2`.`company`,`influenc_v2`.`users` SET `influenc_v2`.`users`.`brand_company_id` = `influenc_v2`.`company`.`id` WHERE `influenc_v2`.`users`.`user_type`='brand' AND `influenc_v2`.`company`.`created_by` = `influenc_v2`.`users`.`id`;

-- 115
UPDATE `influenc_v2`.`company`,`influenc_v2`.`campaigns` SET `influenc_v2`.`campaigns`.`company_id` = `influenc_v2`.`company`.`id` WHERE `influenc_v2`.`company`.`created_by` = `influenc_v2`.`campaigns`.`user_id`;

-- 116
UPDATE `influenc_v2`.`campaign_platform`,`influenc_v2`.`platform_items`
SET `influenc_v2`.`campaign_platform`.`social_platform_id` = `influenc_v2`.`platform_items`.`id`
WHERE `influenc_v2`.`campaign_platform`.`name`= `influenc_v2`.`platform_items`.`name`;

-- 117
UPDATE `influenc_v2`.`offer_item`,`influenc_v2`.`platform_items`
SET `influenc_v2`.`offer_item`.`social_platform_id` = `influenc_v2`.`platform_items`.`id`
WHERE `influenc_v2`.`offer_item`.`platform`= `influenc_v2`.`platform_items`.`name`;

-- 118
UPDATE `influenc_v2`.`feed_item`,`influenc_v2`.`platform_items`
SET `influenc_v2`.`feed_item`.`social_platform_id` = `influenc_v2`.`platform_items`.`id`
WHERE `influenc_v2`.`feed_item`.`platform`= `influenc_v2`.`platform_items`.`name`;

-- 119
UPDATE `influenc_v2`.`user_platform`,`influenc_v2`.`platform_items`
SET `influenc_v2`.`user_platform`.`social_platform_id` = `influenc_v2`.`platform_items`.`id`
WHERE `influenc_v2`.`platform_items`.`name`= `influenc_v2`.`user_platform`.`name`;

-- 120
UPDATE `influenc_v2`.`user_platform`,`influenc_v2`.`platform`,`influenc_v2`.`platform_items`
SET `influenc_v2`.`user_platform`.`main_platform_id` = `influenc_v2`.`platform_items`.`main_platform_id`
WHERE `influenc_v2`.`platform_items`.`name`= `influenc_v2`.`user_platform`.`name`;

-- 121
UPDATE `influenc_v2`.`report_item`,`influenc_v2`.`platform_items`
SET `influenc_v2`.`report_item`.`social_platform_id` = `influenc_v2`.`platform_items`.`id`
WHERE `influenc_v2`.`platform_items`.`name`= `influenc_v2`.`report_item`.`platform`;

-- 124
INSERT INTO `influenc_v2`.`user_price_list`(`created_at`,`updated_at`,`user_platform_id`,`price`)
SELECT `created_at`,`updated_at`,`id`,0
FROM `influenc_v2`.`user_platform`;

-- 125
INSERT INTO `influenc_v2`.`user_exclusivity`
(`created_at`,`updated_at`,`one_month_price`,`three_months_price`,`six_months_price`,`twelve_months_price`,`user_id`)
SELECT `created_at`,`updated_at`,0,0,0,0,`id`
FROM `influenc_v2`.`users` WHERE `influenc_v2`.`users`.`user_type`='influencer';

-- 126
INSERT INTO `influenc_v2`.`user_usage_rights`
(`created_at`,`updated_at`,`one_month_price`,`three_months_price`,`six_months_price`,`twelve_months_price`,`user_id`)
SELECT `created_at`,`updated_at`,0,0,0,0,`id`
FROM `influenc_v2`.`users` WHERE `influenc_v2`.`users`.`user_type`='influencer';

-- 127
-- INSERT INTO `influenc_v2`.`offer_item`
-- SET
-- SELECT `offer_item`.`id`,
--     `offer_item`.`created_at`,
--     `offer_item`.`updated_at`,
--     `offer_item`.`platform`,
--     `offer_item`.`nb_posts`,
--     `offer_item`.`price`,
-- 	(SELECT `offer_id` FROM `influenc_backup`.`offer_items` WHERE `item_id` = `influenc_backup`.`offer_item`.`id`)
-- FROM `influenc_backup`.`offer_item`;

-- 128
CREATE VIEW offer_platform_view
AS SELECT `influenc_v2`.`offer_item`.`id` AS `offer_item_id`, `influenc_v2`.`offer`.`id` AS `offer_id`, `influenc_v2`.`users`.`id` AS `user_id`, `influenc_v2`.`user_platform`.`id` AS `user_platform_id`
FROM `influenc_v2`.`offer_item`
LEFT JOIN `influenc_v2`.`offer` ON `influenc_v2`.`offer`.`id`=`influenc_v2`.`offer_item`.`offer_id`
LEFT JOIN `influenc_v2`.`users` ON `influenc_v2`.`users`.`id`=`influenc_v2`.`offer`.`user_id`
LEFT JOIN `influenc_v2`.`user_platform` ON `influenc_v2`.`user_platform`.`name`=`influenc_v2`.`offer_item`.`platform` AND `influenc_v2`.`user_platform`.`user_id` = `influenc_v2`.`users`.`id`;

-- 129
UPDATE `influenc_v2`.`offer_item`, `influenc_v2`.`offer_platform_view`
SET `influenc_v2`.`offer_item`.`user_platform_id` = `influenc_v2`.`offer_platform_view`.`user_platform_id`
WHERE `influenc_v2`.`offer_platform_view`.`offer_item_id`= `influenc_v2`.`offer_item`.`id`;

-- 130
UPDATE `influenc_v2`.`users`
SET `influenc_v2`.`users`.`locale`='en'
WHERE `influenc_v2`.`users`.`locale` !='de' AND `influenc_v2`.`users`.`locale` !='en';

UPDATE audience_data_history SET engagement_rate=IFNULL((average_likes/NULLIF(followers,0)*100),0)

-- 131
-- DROP VIEW offer_platform_view

-- 132
UPDATE `influenc_v2`.`users` SET `influenc_v2`.`users`.`user_type`='brand_master' WHERE `influenc_v2`.`users`.`user_type`='brand';

-- 133
UPDATE `influenc_v2`.`report_item` SET  `influenc_v2`.`report_item`.`swipe_up_links` = `influenc_v2`.`report_item`.`clicks` WHERE `social_platform_id`=4 AND `swipe_up_links` != `clicks`;

-- 134
UPDATE `influenc_v2`.`campaigns` SET `influenc_v2`.`campaigns`.`last_change` = `influenc_v2`.`campaigns`.`updated_at`;

-- 135
INSERT INTO `influenc_v2`.`user_platform`
(`id`,
`created_at`,
`updated_at`,
`name`,
`title`,
`data`,
`is_enabled`,
`platform_id`,
`followers`,
`reach`,
`like_follower_ratio`,
`audience_data_updated_at`,
`audience_report_file_id`,
`audience_data_history_updated_at`,
`social_platform_id`,
`main_platform_id`,
`user_id`,
`status`,
 `engagements`,
 `average_likes`)
SELECT
	NULL,
	`user_platform`.`created_at`,
	`user_platform`.`updated_at`,
	`user_platform`.`name`,
	`user_platform`.`title`,
	NULL,
	`user_platform`.`is_enabled`,
	`user_platform`.`platform_id`,
	`user_platform`.`followers`,
	`user_platform`.`reach`,
	`user_platform`.`like_follower_ratio`,
	`user_platform`.`audience_data_updated_at`,
	`user_platform`.`audience_report_file_id`,
	`user_platform`.`audience_data_history_updated_at`,
    12,
    2,
    `user_platform`.`user_id`,
	'approved',
    `user_platform`.`engagements`,
    `user_platform`.`average_likes`
FROM `influenc_v2`.`user_platform` WHERE `main_platform_id`=2 and `social_platform_id`!=12 and `is_enabled`=true;

-- 136
INSERT INTO `influenc_v2`.`user_price_list`(`user_platform_id`)
SELECT `t2`.`id`
FROM   `user_platform` `t2`
WHERE  `t2`.`id` NOT IN (SELECT `t1`.`user_platform_id` FROM `influenc_v2`.`user_price_list` `t1` WHERE `t1`.`user_platform_id` IS NOT NULL);

--Change password and salt to match Dejan12345!
UPDATE `influenc_v2`.`users` SET `password`='$2b$10$VZus8n4IKWJxPQ1ZGSaeF.SNFl1I3/WQ0B1hnWprgjCC/E03sVbJW',`salt`='$2b$10$VZus8n4IKWJxPQ1ZGSaeF.';

