コード例 #1
0
ファイル: CubridSchemaTest.php プロジェクト: howq/yii2
 public function getExpectedColumns()
 {
     $columns = parent::getExpectedColumns();
     $columns['int_col']['dbType'] = 'integer';
     $columns['int_col']['size'] = null;
     $columns['int_col']['precision'] = null;
     $columns['int_col2']['dbType'] = 'integer';
     $columns['int_col2']['size'] = null;
     $columns['int_col2']['precision'] = null;
     $columns['smallint_col']['dbType'] = 'short';
     $columns['smallint_col']['size'] = null;
     $columns['smallint_col']['precision'] = null;
     $columns['char_col3']['type'] = 'string';
     $columns['char_col3']['dbType'] = 'varchar(1073741823)';
     $columns['char_col3']['size'] = 1073741823;
     $columns['char_col3']['precision'] = 1073741823;
     $columns['enum_col']['dbType'] = "enum('a', 'B')";
     $columns['float_col']['dbType'] = 'double';
     $columns['float_col']['size'] = null;
     $columns['float_col']['precision'] = null;
     $columns['float_col']['scale'] = null;
     $columns['numeric_col']['dbType'] = 'numeric(5,2)';
     $columns['blob_col']['phpType'] = 'resource';
     $columns['blob_col']['type'] = 'binary';
     $columns['bool_col']['dbType'] = 'short';
     $columns['bool_col']['size'] = null;
     $columns['bool_col']['precision'] = null;
     $columns['bool_col2']['dbType'] = 'short';
     $columns['bool_col2']['size'] = null;
     $columns['bool_col2']['precision'] = null;
     $columns['time']['defaultValue'] = '12:00:00 AM 01/01/2002';
     $columns['ts_default']['defaultValue'] = new Expression('SYS_TIMESTAMP');
     return $columns;
 }
コード例 #2
0
 public function getExpectedColumns()
 {
     $columns = parent::getExpectedColumns();
     unset($columns['enum_col']);
     $columns['int_col']['dbType'] = 'int4';
     $columns['int_col']['size'] = null;
     $columns['int_col']['precision'] = 32;
     $columns['int_col']['scale'] = 0;
     $columns['int_col2']['dbType'] = 'int4';
     $columns['int_col2']['size'] = null;
     $columns['int_col2']['precision'] = 32;
     $columns['int_col2']['scale'] = 0;
     $columns['smallint_col']['dbType'] = 'int2';
     $columns['smallint_col']['size'] = null;
     $columns['smallint_col']['precision'] = 16;
     $columns['smallint_col']['scale'] = 0;
     $columns['char_col']['dbType'] = 'bpchar';
     $columns['char_col']['precision'] = null;
     $columns['char_col2']['dbType'] = 'varchar';
     $columns['char_col2']['precision'] = null;
     $columns['float_col']['dbType'] = 'float8';
     $columns['float_col']['precision'] = 53;
     $columns['float_col']['scale'] = null;
     $columns['float_col']['size'] = null;
     $columns['float_col2']['dbType'] = 'float8';
     $columns['float_col2']['precision'] = 53;
     $columns['float_col2']['scale'] = null;
     $columns['float_col2']['size'] = null;
     $columns['blob_col']['dbType'] = 'bytea';
     $columns['blob_col']['phpType'] = 'resource';
     $columns['blob_col']['type'] = 'binary';
     $columns['numeric_col']['dbType'] = 'numeric';
     $columns['numeric_col']['size'] = null;
     $columns['bool_col']['type'] = 'boolean';
     $columns['bool_col']['phpType'] = 'boolean';
     $columns['bool_col']['dbType'] = 'bool';
     $columns['bool_col']['size'] = null;
     $columns['bool_col']['precision'] = null;
     $columns['bool_col']['scale'] = null;
     $columns['bool_col2']['type'] = 'boolean';
     $columns['bool_col2']['phpType'] = 'boolean';
     $columns['bool_col2']['dbType'] = 'bool';
     $columns['bool_col2']['size'] = null;
     $columns['bool_col2']['precision'] = null;
     $columns['bool_col2']['scale'] = null;
     $columns['bool_col2']['defaultValue'] = true;
     $columns['ts_default']['defaultValue'] = new Expression('now()');
     $columns['bit_col']['dbType'] = 'bit';
     $columns['bit_col']['size'] = 8;
     $columns['bit_col']['precision'] = null;
     return $columns;
 }
コード例 #3
0
ファイル: SqliteSchemaTest.php プロジェクト: howq/yii2
 public function getExpectedColumns()
 {
     $columns = parent::getExpectedColumns();
     unset($columns['enum_col']);
     unset($columns['bit_col']);
     $columns['int_col']['dbType'] = 'integer';
     $columns['int_col']['size'] = null;
     $columns['int_col']['precision'] = null;
     $columns['int_col2']['dbType'] = 'integer';
     $columns['int_col2']['size'] = null;
     $columns['int_col2']['precision'] = null;
     $columns['bool_col']['type'] = 'boolean';
     $columns['bool_col']['phpType'] = 'boolean';
     $columns['bool_col2']['type'] = 'boolean';
     $columns['bool_col2']['phpType'] = 'boolean';
     $columns['bool_col2']['defaultValue'] = true;
     return $columns;
 }
コード例 #4
0
ファイル: OracleSchemaTest.php プロジェクト: noname007/yii2-1
 public function getExpectedColumns()
 {
     $columns = parent::getExpectedColumns();
     unset($columns['enum_col']);
     $columns['int_col']['dbType'] = 'NUMBER';
     $columns['int_col']['size'] = 22;
     $columns['int_col']['precision'] = null;
     $columns['int_col']['scale'] = 0;
     $columns['int_col2']['dbType'] = 'NUMBER';
     $columns['int_col2']['size'] = 22;
     $columns['int_col2']['precision'] = null;
     $columns['int_col2']['scale'] = 0;
     $columns['smallint_col']['dbType'] = 'NUMBER';
     $columns['smallint_col']['type'] = 'integer';
     $columns['smallint_col']['size'] = 22;
     $columns['smallint_col']['precision'] = null;
     $columns['smallint_col']['scale'] = 0;
     $columns['char_col']['dbType'] = 'CHAR';
     $columns['char_col']['precision'] = null;
     $columns['char_col']['size'] = 100;
     $columns['char_col2']['dbType'] = 'VARCHAR2';
     $columns['char_col2']['precision'] = null;
     $columns['char_col2']['size'] = 100;
     $columns['char_col3']['type'] = 'string';
     $columns['char_col3']['dbType'] = 'VARCHAR2';
     $columns['char_col3']['precision'] = null;
     $columns['char_col3']['size'] = 4000;
     $columns['float_col']['dbType'] = 'FLOAT';
     $columns['float_col']['precision'] = 126;
     $columns['float_col']['scale'] = null;
     $columns['float_col']['size'] = 22;
     $columns['float_col2']['dbType'] = 'FLOAT';
     $columns['float_col2']['precision'] = 126;
     $columns['float_col2']['scale'] = null;
     $columns['float_col2']['size'] = 22;
     $columns['blob_col']['dbType'] = 'BLOB';
     $columns['blob_col']['phpType'] = 'resource';
     $columns['blob_col']['type'] = 'binary';
     $columns['blob_col']['size'] = 4000;
     $columns['numeric_col']['dbType'] = 'NUMBER';
     $columns['numeric_col']['size'] = 22;
     $columns['time']['dbType'] = 'TIMESTAMP(6)';
     $columns['time']['size'] = 11;
     $columns['time']['scale'] = 6;
     $columns['time']['defaultValue'] = null;
     $columns['bool_col']['type'] = 'string';
     $columns['bool_col']['phpType'] = 'string';
     $columns['bool_col']['dbType'] = 'CHAR';
     $columns['bool_col']['size'] = 1;
     $columns['bool_col']['precision'] = null;
     $columns['bool_col2']['type'] = 'string';
     $columns['bool_col2']['phpType'] = 'string';
     $columns['bool_col2']['dbType'] = 'CHAR';
     $columns['bool_col2']['size'] = 1;
     $columns['bool_col2']['precision'] = null;
     $columns['bool_col2']['defaultValue'] = '1';
     $columns['ts_default']['type'] = 'timestamp';
     $columns['ts_default']['phpType'] = 'string';
     $columns['ts_default']['dbType'] = 'TIMESTAMP(6)';
     $columns['ts_default']['scale'] = 6;
     $columns['ts_default']['size'] = 11;
     $columns['ts_default']['defaultValue'] = null;
     $columns['bit_col']['type'] = 'string';
     $columns['bit_col']['phpType'] = 'string';
     $columns['bit_col']['dbType'] = 'CHAR';
     $columns['bit_col']['size'] = 3;
     $columns['bit_col']['precision'] = null;
     $columns['bit_col']['defaultValue'] = '130';
     return $columns;
 }