Are FKs not created using a Driver that supports it? schemify calls ensureConstraints which seems to do it, no?
------------------------------------- Derek Chen-Becker<dchenbec...@gmail.com> wrote: If FKs are enabled then the spec fails because you're intentionally trying to break the joins by deleting the Companys that are on the other side of the many-to-many. I'm not sure that FKs should be enabled by default, but if I add the option to introduce them with schemify then I could write another spec that assumes FKs are enabled and expects an exception if you try to delete a joined entity. Derek On Thu, Dec 10, 2009 at 3:22 PM, Naftoli Gugenheim <naftoli...@gmail.com>wrote: > What about that spec I threw together in a hurry implies that foreign > keys would conflict with mapper? > See a recent (few weeks ago) thread discussing how many-to-many should > deal with broken joins. > Why would one not want them to be created by default? > P.S. Sorry I never made that ticket for H2 FK support. > > On 12/8/09, Derek Chen-Becker <dchenbec...@gmail.com> wrote: > > 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 > > <dchenbec...@gmail.com>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 < > >> feeder.of.the.be...@gmail.com> wrote: > >> > >>> > >>> > >>> On Thu, Dec 3, 2009 at 1:47 PM, Derek Chen-Becker > >>> <dchenbec...@gmail.com>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 < > >>>> julianbac...@googlemail.com> 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 lift...@googlegroups.com. > >>>>> To unsubscribe from this group, send email to > >>>>> liftweb+unsubscr...@googlegroups.com<liftweb%2bunsubscr...@googlegroups.com> > <liftweb%2bunsubscr...@googlegroups.com<liftweb%252bunsubscr...@googlegroups.com> > > > >>>>> . > >>>>> 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 lift...@googlegroups.com. > >>>> To unsubscribe from this group, send email to > >>>> liftweb+unsubscr...@googlegroups.com<liftweb%2bunsubscr...@googlegroups.com> > <liftweb%2bunsubscr...@googlegroups.com<liftweb%252bunsubscr...@googlegroups.com> > > > >>>> . > >>>> 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 lift...@googlegroups.com. > >>> To unsubscribe from this group, send email to > >>> liftweb+unsubscr...@googlegroups.com<liftweb%2bunsubscr...@googlegroups.com> > <liftweb%2bunsubscr...@googlegroups.com<liftweb%252bunsubscr...@googlegroups.com> > > > >>> . > >>> 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 lift...@googlegroups.com. > > To unsubscribe from this group, send email to > > liftweb+unsubscr...@googlegroups.com<liftweb%2bunsubscr...@googlegroups.com> > . > > 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 lift...@googlegroups.com. > To unsubscribe from this group, send email to > liftweb+unsubscr...@googlegroups.com<liftweb%2bunsubscr...@googlegroups.com> > . > 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 lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. 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 lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.