dialect/sql/schema: add field collation support for postgres

This commit is contained in:
Ariel Mashraki
2021-05-10 20:18:33 +03:00
committed by Ariel Mashraki
parent 53e885cbff
commit f7db15ccbb
5 changed files with 10 additions and 13 deletions

View File

@@ -107,7 +107,7 @@ func TestMySQL_Create(t *testing.T) {
before: func(mock mysqlMock) {
mock.start("5.7.33")
mock.tableExists("users", false)
mock.ExpectExec(escape("CREATE TABLE IF NOT EXISTS `users`(`id` bigint AUTO_INCREMENT NOT NULL, `name` varchar(255) NULL, `address` varchar(255) COLLATE utf8_unicode_ci NULL, `age` bigint NOT NULL, `doc` json NULL, `enums` enum('a', 'b') NOT NULL, `uuid` char(36) binary NULL, `datetime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `decimal` decimal(6,2) NOT NULL, PRIMARY KEY(`id`)) CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = INNODB")).
mock.ExpectExec(escape("CREATE TABLE IF NOT EXISTS `users`(`id` bigint AUTO_INCREMENT NOT NULL, `name` varchar(255) NULL, `address` varchar(255) NULL COLLATE utf8_unicode_ci, `age` bigint NOT NULL, `doc` json NULL, `enums` enum('a', 'b') NOT NULL, `uuid` char(36) binary NULL, `datetime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `decimal` decimal(6,2) NOT NULL, PRIMARY KEY(`id`)) CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = INNODB")).
WillReturnResult(sqlmock.NewResult(0, 1))
mock.ExpectCommit()
},