[OpenSER-Devel] Defining MySQL foreign key constraint

Dan Pascu dan at ag-projects.com
Wed Jul 18 13:29:00 CEST 2007


On Wednesday 18 July 2007, Henning Westerholt wrote:
> On Monday 16 July 2007, Dan Pascu wrote:
> > While it can't be applied to the core openser tables that need to
> > work with all supported databases, nevertheless it can be useful to
> > people trying to write custom modules that do not necessarily support
> > all database types, or for custom tables that are used directly from
> > the script using AVP database query operations.
> >
> > So I believe it can be an useful addition even if it isn't used by
> > the main tables.
>
> Hello,
>
> we discussed this topic yesterday in the devel meeting, and decided to
> stay for now with the functionality neeeded for OpenSER. But extensions
> to the datatypes are not to hard to implement. Just take a look into
> the mysql.xsl file, 'column.type' template, and add the needed
> datatype.

I know it's not hard to add, however I don't want to continuously patch my 
openser with every release. So the question is if we provide a patch for 
this that uses TIMESTAMP for MySQL and fallsback to DATETIME for the 
other databases, will it be included?

This way we can benefit from MySQL's TIMESTAMP autoupdate behavior and 
it'll still work with the other databases as a DATETIME column.

>
> E.g.:
>
> <xsl:when test="$type='double'">
> 		<xsl:text>DOUBLE</xsl:text>
> 		<xsl:call-template name="column.size"/>
> 		<xsl:call-template name="column.trailing"/>
> </xsl:when>
>
>
> $type is string compared to the given datatype, e.g. double. And then
> the xsl:text content is copied to the node.
>
> Cheers,
>
> Henning



-- 
Dan



More information about the Devel mailing list