code: private function getConstraintsSql()
      {
          $sql = '';
          foreach ($this->table->getConstraints() as $constraint) {
              $sql .= ',';
              if ($constraint instanceof PrimaryKey) {
                  $sql .= (string) $constraint ;
              } elseif ($constraint instanceof ForeignKey) {
                  $sql .= sprintf('CONSTRAINT %s FOREIGN KEY (%s) REFERENCES %s (%s) MATCH SIMPLE ON UPDATE %s ON DELETE %s'
                      , $constraint->getName()
                      , implode(',', $constraint->getColumns())
                      , $constraint->getReferencedTable()->getQualifiedName()
                      , implode(',', $constraint->getReferencedColumns())
                      , $constraint->getUpdateAction()
                      , $constraint->getDeleteAction());
              } elseif ($constraint instanceof Unique) {
                  $sql .= sprintf('CONSTRAINT %s UNIQUE (%s)'
                      , $constraint->getName()
                      , implode(',', $constraint->getColumns()));
              }
          }
  
          return rtrim($sql, ',');
      }
docs: Gets constraints query.
  
  @return string