can you create constraints with ADO in db.xml?
Permalink
Hello,
I have just discovered ADO. I read Andrew's http://www.concrete5.org/documentation/how-tos/developers/creating-... post about it and now I am trying to implement it in my own project.
I was wondering if I can set validation within is format I saw you can set size="255" to set the number of chars in a varchar.
But I been wondering about how to do things (that you could do in sql)
eg Decimail (2,2) This would set the numbers before the decimal point and numbers to round to?
How could I use this ADO to ensure a check constraint is placed on the database?
I tried this
<field name="year" type="I" size="4"></field>
but in the Database it created a smallint(6) which will not validate for a date or at least a 4 digit number which is what I was aiming for as a simple test.
Thanks for reading. Look forward to your reply's
I have just discovered ADO. I read Andrew's http://www.concrete5.org/documentation/how-tos/developers/creating-... post about it and now I am trying to implement it in my own project.
I was wondering if I can set validation within is format I saw you can set size="255" to set the number of chars in a varchar.
But I been wondering about how to do things (that you could do in sql)
eg Decimail (2,2) This would set the numbers before the decimal point and numbers to round to?
How could I use this ADO to ensure a check constraint is placed on the database?
I tried this
<field name="year" type="I" size="4"></field>
but in the Database it created a smallint(6) which will not validate for a date or at least a 4 digit number which is what I was aiming for as a simple test.
Thanks for reading. Look forward to your reply's
Is this possible or am I overthinking this?
I think if you read through this it will help.
http://www.concrete5.org/documentation/how-tos/developers/creating-...
http://www.concrete5.org/documentation/how-tos/developers/creating-...