Отладка

actency-mysql57-replication
Andrey Ivanov 2021-01-26 13:59:27 +03:00 committed by ya@tiburon.su
parent a82c4022a5
commit 5c6b990515
2 changed files with 3 additions and 3 deletions

View File

@ -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'; GRANT ALL ON `app`.* TO 'app'@'%' identified by 'app';

View File

@ -60,13 +60,13 @@ func dbInit(db *sql.DB) error {
City varchar(255) DEFAULT NULL, City varchar(255) DEFAULT NULL,
Interests varchar(255) DEFAULT NULL, Interests varchar(255) DEFAULT NULL,
PRIMARY KEY (Id) PRIMARY KEY (Id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8`); err != nil { ) ENGINE=InnoDB DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci`); err != nil {
return err return err
} }
if _, err := db.Exec(`CREATE TABLE IF NOT EXISTS relations ( if _, err := db.Exec(`CREATE TABLE IF NOT EXISTS relations (
userId int(11) DEFAULT NULL, userId int(11) DEFAULT NULL,
friendId 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 return err
} }
log.Println("All tables exists") log.Println("All tables exists")