columnSql() public method

{@inheritDoc}
public columnSql ( Cake\Database\Schema\Table $table, $name )
$table Cake\Database\Schema\Table
Example #1
0
 /**
  * Test generating a column that is a primary key.
  *
  * @return void
  */
 public function testColumnSqlPrimaryKey()
 {
     $driver = $this->_getMockedDriver();
     $schema = new PostgresSchema($driver);
     $table = new Table('schema_articles');
     $table->addColumn('id', ['type' => 'integer', 'null' => false])->addConstraint('primary', ['type' => 'primary', 'columns' => ['id']]);
     $result = $schema->columnSql($table, 'id');
     $this->assertEquals($result, '"id" SERIAL');
 }