See also: http://www.postgresql.org/docs/9.3/interactive/datatype.html MySQL Data Types:
See also: http://dev.mysql.com/doc/refman/5.6/en/data-types.html MySQL Reference reference_definition: REFERENCES tbl_name (index_col_name,...) [MATCH FULL | MATCH PARTIAL | MATCH SIMPLE] [ON DELETE reference_option] [ON UPDATE reference_option] reference_option: RESTRICT | CASCADE | SET NULL | NO ACTION
Inheritance: implements SQLBuilder\ToSqlInterface
 public function testAddColumnFirst()
 {
     $driver = new MySQLDriver();
     $args = new ArgumentArray();
     $column = new Column('last_name', 'varchar(30)');
     $column->default('');
     $column->notNull();
     $q = new AlterTableQuery('products');
     $q->addColumn($column)->first();
     $this->assertDriverQuery(new MySQLDriver(), $q);
     $this->assertSqlStrings($q, [[new MySQLDriver(), 'ALTER TABLE `products` ADD COLUMN `last_name` varchar(30) NOT NULL DEFAULT \'\' FIRST']]);
 }
Beispiel #2
0
 /**
  * @var string column name (id)
  */
 public function __construct(DeclareSchema $schema, $name = null, $type = null)
 {
     $this->schema = $schema;
     $this->attributeTypes = $this->attributeTypes + array('primary' => self::ATTR_FLAG, 'size' => self::ATTR_INTEGER, 'autoIncrement' => self::ATTR_FLAG, 'immutable' => self::ATTR_FLAG, 'unique' => self::ATTR_FLAG, 'null' => self::ATTR_FLAG, 'notNull' => self::ATTR_FLAG, 'typeConstraint' => self::ATTR_FLAG, 'timezone' => self::ATTR_FLAG, 'renderable' => self::ATTR_FLAG, 'findable' => self::ATTR_FLAG, 'label' => self::ATTR_ANY, 'desc' => self::ATTR_STRING, 'comment' => self::ATTR_STRING, 'refer' => self::ATTR_STRING, 'default' => self::ATTR_ANY, 'validator' => self::ATTR_ANY, 'validatorArgs' => self::ATTR_ANY, 'validValues' => self::ATTR_ANY, 'validValueBuilder' => self::ATTR_CALLABLE, 'optionValues' => self::ATTR_ANY, 'validPairs' => self::ATTR_ANY, 'canonicalizer' => self::ATTR_CALLABLE, 'virtual' => self::ATTR_FLAG, 'required' => self::ATTR_FLAG, 'filter' => self::ATTR_CALLABLE, 'inflator' => self::ATTR_CALLABLE, 'deflator' => self::ATTR_CALLABLE, 'renderAs' => self::ATTR_STRING, 'widgetAttributes' => self::ATTR_ARRAY, 'contentType' => self::ATTR_STRING, 'primaryField' => self::ATTR_FLAG);
     parent::__construct($name, $type);
 }