I would like to constrain an attribute to a certain range using beego orm, similar to
CHECK(“column” >= 0 AND “column” <= 10)
in the table setup. Can I do this with beego, and if yes, how?
I would like to constrain an attribute to a certain range using beego orm, similar to
CHECK(“column” >= 0 AND “column” <= 10)
in the table setup. Can I do this with beego, and if yes, how?
Copyright © 2021 Jogjafile Inc.
The command doesn't seem to give any options for inserting CHECK, it's quite an esoteric SQL command, and there is no hint of it in the source at getDbCreateSQL or the docs.
I suggest you just create your tables with SQL instead and insert the sql you have above, this should be a one-time task so not too onerous.