Changeset 1068 for trunk/contrib/dbd2propel
- Timestamp:
- 08/06/08 07:55:11 (1 month ago)
- Files:
-
- trunk/contrib/dbd2propel/dbd2propel.xsl (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/contrib/dbd2propel/dbd2propel.xsl
r485 r1068 8 8 9 9 ==== Author: Jonathan Graham <jkgraham@gmail.com> 10 ==== Version: 0. 4 (2006-11-13) (http://blog.tooleshed.com/?p=6)10 ==== Version: 0.5 (2008-01-25) (http://blog.tooleshed.com/?p=6) 11 11 ==== Description: 12 12 This XSL will transform a DB Designer 4 database model XML file into a … … 33 33 Michiel Hakvoort - onDelete 34 34 Michel D'HOOGE - FULLTEXT 35 Oleg Marchuk <kingoleg@mail.ru> - version 0.5 35 36 36 37 ==== Software: … … 46 47 version 0.3 (2006-11-05) - added non-unique-INDEXes and onDelete 47 48 version 0.4 (2006-11-13) - added support for index names and FULLTEXT indexes, changed license to LGPL 49 version 0.5 (2008-01-25) - added ENUM, GEOMETRY as BLOB, scale for DECIMAL; fixed size in ENUM and spaces in relation names 48 50 49 51 --> … … 99 101 <!-- ==== type ==== --> 100 102 <xsl:attribute name="type"> 101 <xsl:value-of select="$datatype"/> 103 <xsl:choose> 104 <xsl:when test="$datatype = 'ENUM'"> 105 <xsl:value-of select="'CHAR'" /> 106 </xsl:when> 107 <xsl:otherwise> 108 <xsl:value-of select="$datatype"/> 109 </xsl:otherwise> 110 </xsl:choose> 102 111 </xsl:attribute> 103 112 … … 110 119 </xsl:call-template> 111 120 </xsl:attribute> 112 113 <xsl:if test="contains('FLOAT,DOUBLE ',$datatype)">121 122 <xsl:if test="contains('FLOAT,DOUBLE,DECIMAL',$datatype)"> 114 123 <!-- ==== scale ==== --> 115 124 <xsl:attribute name="scale"> … … 219 228 <!-- name --> 220 229 <xsl:attribute name="name"> 221 <xsl:value-of select=" $relation/@RelationName"/>230 <xsl:value-of select="translate($relation/@RelationName, ' ', '_')"/> 222 231 </xsl:attribute> 223 232 … … 265 274 <xsl:when test="$type = 'TEXT'" >LONGVARCHAR</xsl:when> 266 275 <xsl:when test="$type = 'BOOL'" >BOOLEAN</xsl:when> 276 <xsl:when test="$type = 'GEOMETRY'" >BLOB</xsl:when> 267 277 <xsl:otherwise> 268 278 <xsl:value-of select="$type"/> … … 279 289 280 290 <xsl:choose> 281 <xsl:when test="contains('FLOAT,DOUBLE ',$dtype)" >291 <xsl:when test="contains('FLOAT,DOUBLE,DECIMAL',$dtype)" > 282 292 <xsl:value-of select="substring-before($dtpc,',')"/> 283 </xsl:when> 293 </xsl:when> 294 <xsl:when test="$dtype = 'ENUM'"> 295 <xsl:value-of select="''" /> 296 </xsl:when> 284 297 <xsl:otherwise> 285 298 <xsl:value-of select="$dtpc"/>
