Return-Path: Mailing-List: contact torque-dev-help@db.apache.org; run by ezmlm Delivered-To: mailing list torque-dev@db.apache.org Received: (qmail 28759 invoked from network); 8 Apr 2003 23:28:32 -0000 Received: from unknown (HELO eng.werken.com) (66.216.68.111) by daedalus.apache.org with SMTP; 8 Apr 2003 23:28:32 -0000 Received: from eng.werken.com (localhost [127.0.0.1]) by eng.werken.com (8.11.6/8.11.6) with ESMTP id h390pq617016; Tue, 8 Apr 2003 19:51:52 -0500 Message-ID: <176896.1049849512623.JavaMail.jmcnally@localhost> Date: Tue, 8 Apr 2003 19:51:52 -0500 (CDT) From: Gabriel Bauman Reply-To: Scarab Admistrator To: Gabriel Bauman Subject: [SOURCE] Issue #TRQS150 - make foreign keys sensitive to tableType in src/templates/sq... Cc: "torque-dev@db.apache.org" Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N You can view the issue detail at the following URL: Type : Patch Issue Id : TRQS150 Reported by: Gabriel Bauman neiras - (gabe@bravenet.com) Details: Platform: All Operating system: Other linux Summary: make foreign keys sensitive to tableType in src/templates/sql/base/mysql/foreignkey.vm Description: I have patched the VelociMacro file that handles SQL generation for foreign keys under MySql. Basically, I've made it tableType sensitive. The patch is against cvs head. If you do not have a tableType specified in your db.props, the template assumes no support for constraints and simply generates an index: # Foreign Key: service_id -> ftp_service.id INDEX ftp_account_subscription_FK_1 (service_id) In this case, a comment containing a warning message about the missing features is injected as well. I feel that this warning may clear up some confusion among new users. If, on the other hand, you are using InnoDB tables, an index is generated as above (mysql and InnoDB require this) and the proper FOREIGN KEY is generated as well: # Foreign Key: service_id -> ftp_service.id INDEX ftp_account_subscription_FK_1 (service_id)), FOREIGN KEY (service_id) REFERENCES ftp_service (id) ON DELETE CASCADE I have taken pains to keep the output pretty at the expense of template readability. Status: New