Re: Re: DRY for ActiveRecord w/PostgreSQL : defaults and validations

Grant Johnson
Mon, 19 Sep 2005 13:38:32 -0000

>
>
>
>There has been a few long threads on the philosophy of dbms
>constraints versus application-logic constraints. IIRC correctly,
>application-logic validation was the philosophical direction, being
>DHH''s preference.
>
>Part of the influence on this was, I think, MySQL''s only rather
recent
>support of constraints in the DBMS.
>
>The other was that an OO domain model can be hard to constrain in a
>RDMS constraint model.
>
>Nick
>
>
That said, would it make sense, when generating a model, to place any
database constraints and relationships in the model?   not
null=validates presense of, char(2)= validates length of, foriegn
key=belongs to, etc.