From 5c6b99051551e11aed7f07bb0ac83cf39ca5fb9b Mon Sep 17 00:00:00 2001 From: Andrey Ivanov Date: Tue, 26 Jan 2021 13:59:27 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D1=82=D0=BB=D0=B0=D0=B4=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cicd/dbinit/init.sql | 2 +- internal/application/application.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cicd/dbinit/init.sql b/cicd/dbinit/init.sql index 4d13934..5b2f928 100644 --- a/cicd/dbinit/init.sql +++ b/cicd/dbinit/init.sql @@ -1,2 +1,2 @@ -CREATE DATABASE IF NOT EXISTS `app` CHARACTER SET utf8 COLLATE utf8_general_ci; +CREATE DATABASE IF NOT EXISTS `app` CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; GRANT ALL ON `app`.* TO 'app'@'%' identified by 'app'; \ No newline at end of file diff --git a/internal/application/application.go b/internal/application/application.go index e13e108..ebda9fd 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 CHARSET=utf8`); err != nil { + ) ENGINE=InnoDB DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci`); 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 CHARSET=utf8`); err != nil { + ) ENGINE=InnoDB DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci`); err != nil { return err } log.Println("All tables exists")