Radhika
Radhika

Reputation: 2561

How to set default value of string column in Beego

I am trying to set a default column value for a string column in beego struct.

I tried the following:

string `orm:"column(method_type);default(test)"`

And some different versions of this but instead of inserting the default value supplied, the orm keeps sending blank string to table.

Used this as reference: https://beego.me/docs/mvc/model/models.md#default

Upvotes: 0

Views: 694

Answers (1)

Sơn xê kô
Sơn xê kô

Reputation: 207

Try this

string `orm:"column:method_type;default:'test'"`

Upvotes: 0

Related Questions