Location: PHPKode > projects > DIY Blog > diy-blog/lib/propel/generator/templates/sql/base/oracle/primarykey.tpl
<?php
	$tableName = $table->getName();
	$length = strlen($tableName);
	if ($length > 27) {
		$length = 27;
	}
?>
<?php if ( is_array($table->getPrimaryKey()) && count($table->getPrimaryKey()) ) { ?>
ALTER TABLE <?php echo $table->getName() ?>

    ADD CONSTRAINT <?php echo substr($tableName,0,$length)?>_PK
PRIMARY KEY (<?php
	$delim = "";
	foreach ($table->getPrimaryKey() as $col) {
		echo $delim . $col->getName();
		$delim = ",";
	}
?>);
<?php } ?>
Return current item: DIY Blog