Files
luos/gulliver/thirdparty/propel-generator/templates/sql/base/mysql/table.tpl
norahmollo 0d40ffbfb0 PM-476 Engine InnoDB
Tables Engine
2014-10-08 16:32:12 -04:00

46 lines
1.3 KiB
Smarty
Executable File

# -mysql----------------------------------------------------------------------
# <?php echo $table->getName() ?>
# -----------------------------------------------------------------------
<?php echo $generator->parse("$basepath/drop.tpl") ?>
CREATE TABLE <?php echo "`" . $table->getName() . "`" ?>
(
<?php
$cols = $generator->parse("$basepath/columns.tpl");
$pk = $generator->parse("$basepath/primarykey.tpl");
$fk = $generator->parse("$basepath/foreignkey.tpl");
$unique = $generator->parse("$basepath/unique.tpl");
$index = $generator->parse("$basepath/index.tpl");
$output = array();
if(!empty($cols)) {
$output[] = $cols;
}
if(!empty($pk)) {
$output[] = $pk;
}
if(!empty($unique)) {
$output[] = $unique;
}
if(!empty($index)) {
$output[] = $index;
}
if(!empty($fk)) {
$output[] = $fk;
}
echo implode(", ", $output);
?>
)<?php if (!isset($mysqlTableType)) {
$vendorSpecific = $table->getVendorSpecificInfo();
if(isset($vendorSpecific['Type']))
$mysqlTableType = $vendorSpecific['Type'];
else
$mysqlTableType = 'InnoDB';
}
?>
Type=<?php echo $mysqlTableType ?>
<?php if($table->getDescription()) { ?> COMMENT='<?php echo $platform->escapeText($table->getDescription()) ?>'<?php } ?>;