gen icon indicating copy to clipboard operation
gen copied to clipboard

Incompatible comment format

Open wmh opened this issue 2 years ago • 3 comments

gen produce field comment as below:

Field1      *string    `gorm:"column:field1;type:varchar(10)" json:"field1"` // this is field1 desc

but gorm migration has different definition as below:

Field1      *string    `gorm:"column:field1;type:varchar(10);comment:this is field1 desc" json:"field1"`

Looking forward to see the solution. Thanks.

wmh avatar Aug 11 '22 03:08 wmh

it is as expected.we do not have plan to change it.

tr1v3r avatar Aug 13 '22 07:08 tr1v3r

but how can I use this for migration?

wmh avatar Aug 13 '22 10:08 wmh

We do not recommend using generated structures to migrate, it may lead to info miss(index or else) and incompatible between different types of database, You can use DDL to create tables

tr1v3r avatar Aug 13 '22 15:08 tr1v3r

#784

qqxhb avatar Apr 11 '23 02:04 qqxhb