Commits

Yury Shulaev committed 5460216

improve MySQL export output

Comments (0)

Files changed (1)

db/mysql/output.xsl

 	<xsl:for-each select="table">
 	<xsl:text>-- ---
 -- Table '</xsl:text>
-	<xsl:value-of select="@name" />
+	<xsl:value-of select="@name" /><xsl:text>'</xsl:text>
 	<xsl:if test="comment">
+		<xsl:text> </xsl:text>
 		<xsl:call-template name="replace-substring">
 			<xsl:with-param name="value" select="comment" />
 			<xsl:with-param name="from" select='"&apos;"' />
 
 </xsl:text>
 
-<xsl:text>DROP TABLE IF EXISTS `</xsl:text>
+<xsl:text>-- DROP TABLE `</xsl:text>
 		<xsl:value-of select="@name" />
 		<xsl:text>`;
 
 		</xsl:for-each>
 
 		<xsl:text>
-)</xsl:text>
+) ENGINE=InnoDB DEFAULT CHARSET=utf8</xsl:text>
 
 
 
 	</xsl:for-each>
 
 <xsl:text>-- ---
--- Table Properties
--- ---
-
-</xsl:text>
-	<xsl:for-each select="table">
-	<xsl:text>ALTER TABLE `</xsl:text><xsl:value-of select="@name" />
-	<xsl:text>` ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-</xsl:text>
-	</xsl:for-each>
-
-<xsl:text>
--- ---
 -- Foreign Keys
 -- ---