/** * Builds the DDL SQL for a Unique constraint object. * * @param Unique $unique * @return string */ public function getUniqueDDL(Unique $unique) { return sprintf('UNIQUE (%s)', $this->getColumnListDDL($unique->getColumnObjects())); }
public function getUniqueDDL(Unique $unique) { return sprintf('CONSTRAINT %s UNIQUE (%s)', $this->quoteIdentifier($unique->getName()), $this->getColumnListDDL($unique->getColumnObjects())); }
/** * Builds the DDL SQL for a Unique constraint object. MS SQL Server CONTRAINT specific * * @param Unique $unique * @return string */ public function getUniqueDDL(Unique $unique) { $pattern = 'CONSTRAINT %s UNIQUE NONCLUSTERED (%s) ON [PRIMARY]'; return sprintf($pattern, $this->quoteIdentifier($unique->getName()), $this->getColumnListDDL($unique->getColumnObjects())); }