--
-- Host: mysql-cdp-do-user-7590294-0.c.db.ondigitalocean.com    Database: cdp
-- ------------------------------------------------------

SET @MYSQLDUMP_TEMP_LOG_BIN = @@SESSION.SQL_LOG_BIN;

--
-- GTID state at the beginning of the backup 
--

add47338-882d-11ef-91fa-6ea90baa445c:1-24368367,
f8cf7e28-b1b1-11ee-96fe-72a88c374e66:1-423808264';

--
-- Temporary view structure for view `vw_contas`
--

/*!50001 DROP VIEW IF EXISTS `vw_contas`*/;
/*!50001 CREATE VIEW `vw_contas` AS SELECT 
 1 AS `id`,
 1 AS `name`,
 1 AS `assigned_user_id`,
 1 AS `country`,
 1 AS `user_count`,
 1 AS `cloudBdm`*/;

--
-- Final view structure for view `vw_contas`
--

/*!50001 DROP VIEW IF EXISTS `vw_contas`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`pbi_connector`@`%` SQL SECURITY DEFINER */
/*!50001 VIEW `vw_contas` AS select `a`.`id` AS `id`,`a`.`name` AS `name`,`a`.`assigned_user_id` AS `assigned_user_id`,`a`.`country` AS `country`,count(distinct `ua`.`user_id`) AS `user_count`,(case when (count(distinct `ua`.`user_id`) > 1) then 'Múltiplos BDMs' else max(`u`.`user_name`) end) AS `cloudBdm` from ((`account` `a` left join `user_account` `ua` on((`ua`.`account_id` = `a`.`id`))) left join `user` `u` on((`u`.`id` = `ua`.`user_id`))) where (`a`.`deleted` = 0) group by `a`.`id`,`ua`.`account_id` */;


