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")