go-gorm / postgres

GORM PostgreSQL driver
MIT License
228 stars 120 forks source link

feat: support for setting table comments after AutoMigrate #228

Closed iTanken closed 7 months ago

iTanken commented 9 months ago

What did this pull request do?

Support for setting table comments after AutoMigrate.

User Case Description

// Migrating and setting a comment for a single table
db.Set("gorm:table_comments", "用户信息表").AutoMigrate(&User{})

// Migrating and setting comments for multiple tables
db.Set("gorm:table_comments", []string{"用户信息表", "公司信息表"}).AutoMigrate(&User{}, &Company{})