OK, I've run into a snag. Schemifier does support foreign key creation, as
do most of the database vendors. The ManyToMany Mapper support, however,
seems to expect no foreign key constraints, since it's explicitly testing
broken refs in the ManyToManySpecs tests:
"ManyToMany" should {
"skip broken joins in children" in {
setupDB
val person = createPerson
person.companies.joins.length must_== 10
person.companies.all.length must_== 8
}
...
I wonder if we should have FK generation be a configuration parameter for
schemify. I could change the code so that the default schemify method
continues to generate DDL without FK constraints, but add a second schemify
method that takes a boolean parameter controlling whether FKs are generated.
That, coupled with the DriverType.supportsForeignKeys_?, would allow people
to add FKs if they want. Thoughts?
Derek
On Sun, Dec 6, 2009 at 5:40 PM, Derek Chen-Becker <[email protected]>wrote:
> Absolutely. I have a PG 8.0, 8.1 and 8.3 instance set up for testing on my
> home box because of the last time I made a PG-related change.
>
> Derek
>
>
> On Thu, Dec 3, 2009 at 2:48 PM, David Pollak <
> [email protected]> wrote:
>
>>
>>
>> On Thu, Dec 3, 2009 at 1:47 PM, Derek Chen-Becker
>> <[email protected]>wrote:
>>
>>> I agree on both points (foreign keys and documentation). Please open a
>>> ticket asking for proper foreign key support and I'll work on it next week.
>>>
>>>
>> Please make sure it works on PG 8.0/8.1 as there is at least 1 Lift app in
>> production against 8.0
>>
>>
>>> Derek
>>>
>>>
>>> On Wed, Dec 2, 2009 at 6:05 PM, Julian Backes <
>>> [email protected]> wrote:
>>>
>>>> Hi Derek,
>>>>
>>>> > It's been a long time since I looked at that particular code, so I may
>>>> > have misspoke. Having said that, if it's currently disabled in the
>>>> > driver I'm not sure why and I would want to review it before saying
>>>> that
>>>> > it works properly in all cases.
>>>> I think the problem here is that the user expects (like I did) foreign
>>>> keys to be created if he uses mapper classes referencing other mapper
>>>> classes. This "behaviour" should at least be mentioned somewhere in the
>>>> documentation (btw, the documentation is in my opinion the biggest
>>>> problems of Lift at the moment).
>>>> I think, using a relational database without foreign keys is somehow not
>>>> very useful because you never really know whether you have referential
>>>> integrity...
>>>> It would be great if you looked at the code and enabled it. This would
>>>> really be an improvement for the mapper stuff in Lift 1.1
>>>>
>>>> Julian
>>>>
>>>> --
>>>>
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Lift" group.
>>>> To post to this group, send email to [email protected].
>>>> To unsubscribe from this group, send email to
>>>> [email protected]<liftweb%[email protected]>
>>>> .
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/liftweb?hl=en.
>>>>
>>>>
>>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Lift" group.
>>> To post to this group, send email to [email protected].
>>> To unsubscribe from this group, send email to
>>> [email protected]<liftweb%[email protected]>
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/liftweb?hl=en.
>>>
>>
>>
>>
>> --
>> Lift, the simply functional web framework http://liftweb.net
>> Beginning Scala http://www.apress.com/book/view/1430219890
>> Follow me: http://twitter.com/dpp
>> Surf the harmonics
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Lift" group.
>>
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected]<liftweb%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/liftweb?hl=en.
>>
>
>
--
You received this message because you are subscribed to the Google Groups
"Lift" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/liftweb?hl=en.