From c73f16cfb07b8af25188ca2de274397ebb32d921 Mon Sep 17 00:00:00 2001
From: Matias Garcia Isaia <mgarcia@manas.tech>
Date: Mon, 26 Feb 2024 18:16:08 -0300
Subject: [PATCH] Use MySQL8 in development

---
 broker/rebar.config                                         | 2 +-
 docker-compose.yml                                          | 6 ++++--
 .../telemetry/calls_per_day_per_channel_collector_spec.rb   | 4 ++--
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/broker/rebar.config b/broker/rebar.config
index d945303b2..186d4282f 100644
--- a/broker/rebar.config
+++ b/broker/rebar.config
@@ -4,7 +4,7 @@
 {deps, [
   {lager, ".*", {git , "git://github.com/basho/lager.git", {tag, "2.0.1"}}},
   {yamler, "", {git, "https://github.com/waj/yamler.git"}},
-  {mysql, ".*", {git, "git://github.com/manastech/erlang-mysql-driver.git", "d2192d59dc3dac022f294e51a7af9f977181b147"}},
+  {mysql, ".*", {git, "https://github.com/manastech/erlang-mysql-driver.git", "32fc8be2bb6b78bc021204d535276f5554255c96"}},
   {erl_dbmodel, ".*", {git, "https://github.com/manastech/erl-dbmodel.git"}},
   {json, "0.0.2", {git, "https://github.com/hio/erlang-json.git"}},
   {erjs, ".*", {git, "git://github.com/waj/erjs.git"}},
diff --git a/docker-compose.yml b/docker-compose.yml
index 1584e74c0..dde03f764 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -2,8 +2,10 @@ version: '2.0'
 
 services:
   db:
-    image: mysql:5.7
-    platform: linux/amd64
+    # image: mysql:5.7
+    # platform: linux/amd64
+    image: mysql:8.0
+    command: --default-authentication-plugin=mysql_native_password
     environment:
       MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
     volumes:
diff --git a/spec/models/telemetry/calls_per_day_per_channel_collector_spec.rb b/spec/models/telemetry/calls_per_day_per_channel_collector_spec.rb
index 890a3b387..268ab5fb3 100644
--- a/spec/models/telemetry/calls_per_day_per_channel_collector_spec.rb
+++ b/spec/models/telemetry/calls_per_day_per_channel_collector_spec.rb
@@ -87,12 +87,12 @@
       "counters" => [
         {
           "metric" => "calls",
-          "key" => { "date" => (to - 4.days).to_date.iso8601, "channel_id" => channel_1.id, "state" => "completed" },
+          "key" => { "date" => (to - 1.day).to_date.iso8601, "channel_id" => channel_1.id, "state" => "completed" },
           "value" => 1
         },
         {
           "metric" => "calls",
-          "key" => { "date" => (to - 1.day).to_date.iso8601, "channel_id" => channel_1.id, "state" => "completed" },
+          "key" => { "date" => (to - 4.days).to_date.iso8601, "channel_id" => channel_1.id, "state" => "completed" },
           "value" => 1
         }
       ]