Closed yuxinyin closed 1 year ago
https://github.com/go-gorm/playground/pull/1
问题代码: gorm.io/driver/postgres@v1.4.4/migrator.go:418
原因:
字段: "country" varchar(4) DEFAULT 'CN'
读取到的值: column.DefaultValueValue = "'CN'::character varying"
修复建议:
修改正则匹配空格
'(.*)'::[\w]+$ => '(.*)'::[\w\s]+$
'(.*)'::[\w]+$
'(.*)'::[\w\s]+$
GORM Playground Link
https://github.com/go-gorm/playground/pull/1
Description
问题代码: gorm.io/driver/postgres@v1.4.4/migrator.go:418
原因:
字段: "country" varchar(4) DEFAULT 'CN'
读取到的值: column.DefaultValueValue = "'CN'::character varying"
修复建议:
修改正则匹配空格
'(.*)'::[\w]+$
=>'(.*)'::[\w\s]+$