Beispiel #1
0
 public function test()
 {
     $column = new DeclareColumn(new DeclareSchema(), 'foo');
     $column->primary()->integer()->autoIncrement()->notNull();
     $this->assertEquals('foo', $column->name);
     $this->assertTrue($column->primary);
     $this->assertEquals('int', $column->type);
     $this->assertTrue($column->notNull);
 }
 /**
  * Create primary key column with autoIncrement and unsigned.
  */
 public static function forMySQL($type = 'bigint')
 {
     $column = new DeclareColumn('id');
     $column->isa('int');
     $column->type($type);
     $column->unsigned();
     $column->notNull();
     $column->primary()->autoIncrement();
     return $column;
 }