From d66e27a631f779a9f937f723847c81dc95bde604 Mon Sep 17 00:00:00 2001 From: Andrey Ivanov Date: Tue, 26 Jan 2021 14:05:51 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D1=82=D0=BB=D0=B0=D0=B4=D0=BA=D0=B0.=20?= =?UTF-8?q?=D0=A7=D0=B5=D1=85=D0=BE=D1=80=D0=B4=D0=B0=20=D1=81=20=D0=B2?= =?UTF-8?q?=D0=B5=D1=80=D1=81=D0=B8=D1=8F=D0=BC=D0=B8=20mysql=20=D0=B8=20c?= =?UTF-8?q?ollation,=20=D0=BA=D0=B0=D0=BA=20=D1=81=D0=BB=D0=B5=D0=B4=D1=81?= =?UTF-8?q?=D1=82=D0=B2=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cicd/dbinit/init.sql | 2 +- cicd/docker-compose.yml | 2 +- internal/application/application.go | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cicd/dbinit/init.sql b/cicd/dbinit/init.sql index 5b2f928..4d13934 100644 --- a/cicd/dbinit/init.sql +++ b/cicd/dbinit/init.sql @@ -1,2 +1,2 @@ -CREATE DATABASE IF NOT EXISTS `app` CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; +CREATE DATABASE IF NOT EXISTS `app` CHARACTER SET utf8 COLLATE utf8_general_ci; GRANT ALL ON `app`.* TO 'app'@'%' identified by 'app'; \ No newline at end of file diff --git a/cicd/docker-compose.yml b/cicd/docker-compose.yml index aacc327..286e170 100644 --- a/cicd/docker-compose.yml +++ b/cicd/docker-compose.yml @@ -1,7 +1,7 @@ version: '3' services: mysql: - image: mysql + image: mysql:5.6 hostname: "mysql" container_name: mysql command: --default-authentication-plugin=mysql_native_password diff --git a/internal/application/application.go b/internal/application/application.go index ebda9fd..e13e108 100755 --- a/internal/application/application.go +++ b/internal/application/application.go @@ -60,13 +60,13 @@ func dbInit(db *sql.DB) error { City varchar(255) DEFAULT NULL, Interests varchar(255) DEFAULT NULL, PRIMARY KEY (Id) - ) ENGINE=InnoDB DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci`); err != nil { + ) ENGINE=InnoDB DEFAULT CHARSET=utf8`); err != nil { return err } if _, err := db.Exec(`CREATE TABLE IF NOT EXISTS relations ( userId int(11) DEFAULT NULL, friendId int(11) DEFAULT NULL - ) ENGINE=InnoDB DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci`); err != nil { + ) ENGINE=InnoDB DEFAULT CHARSET=utf8`); err != nil { return err } log.Println("All tables exists")