Commit Graph

55 Commits

Author SHA1 Message Date
SilverFire - Dmitry Naumenko
0fe27b9d3b Refactored code in PR #9441 2016-04-19 17:48:25 +03:00
SilverFire - Dmitry Naumenko
c9dfc90be0 Merge branch 'methods_for_schema_builder' of https://github.com/vaseninm/yii2 into vaseninm-methods_for_schema_builder 2016-04-19 12:21:33 +03:00
Chris Harris
5316576361 Fixes after() column string builder (#11362) 2016-04-19 11:59:16 +03:00
Chris Harris
2fe6cee8bf Added SQLite bigpk test. Moved schema builder patterns spreadsheet to docs/internals folder. 2016-03-21 23:39:54 -07:00
Chris Harris
0b2db6f18a Fixing tests 2016-03-21 04:29:45 -07:00
Chris Harris
7bfcd0c427 Fixing tests 2016-03-21 04:14:38 -07:00
Chris Harris
d8d10229c6 Fixing tests 2016-03-21 03:59:27 -07:00
Chris Harris
b8e44b2f47 Merge branch 'master' of git://github.com/yiisoft/yii2 into 9562-add-char-datatype 2016-03-14 05:33:41 -07:00
SilverFire - Dmitry Naumenko
7229b3aa7d QueryBuilder::buildAndCondition() - added Expression value extraction
Updated CHANGELOG
Added test case for param binding in `or` condition

Closes #11093
2016-03-13 19:22:32 +02:00
CedricYii
2bd14098f9 Fix Expression parameter binding in 'And' clause 2016-03-13 19:19:48 +02:00
Chris Harris
c955ccfd47 Fixes primary key columns being added to table creation test 2016-02-26 18:00:30 -08:00
Chris Harris
2f91889b70 Removed unsignedPrimaryKey() schema builder type; now, the unsigned() modifier works with primary key types e.g. pk()->unsigned() or bigpk()->unsigned(). 2016-02-26 17:48:03 -08:00
Chris Harris
b697e173fc Fixed unsigned() modifier to enable use with PKs. 2016-02-26 14:14:52 -08:00
Chris Harris
91018f6c38 Corrected MSSQL driver name. Fixed array addition to not overwrite matching keys. 2016-02-26 12:44:20 -08:00
Chris Harris
553cca642c Reverted unsigned() pk modifier 2016-02-26 06:09:22 -08:00
Chris Harris
f7d23f662d Made base QueryBuilderTest abstract to exclude it from tests. Added upgrade notes. 2016-02-26 05:27:31 -08:00
Chris Harris
030ee68b01 Testing unsigned() modifier on PKs (now $this->primaryKey()->unsigned() works) 2016-02-26 04:39:05 -08:00
Chris Harris
732a51b551 All common column definitions and expected outputs now in QueryBuilderTest::columnTypes(). DbmsSpecificQueryBuilderTest::columnTypes() adds DBMS specific column definitions. 2016-02-26 03:53:05 -08:00
Chris Harris
4531b981f4 Items with text only in col 3 will be ignored 2016-02-26 00:35:27 -08:00
Chris Harris
8eb746d1f1 Testing multi-DBMS capable column schema test data array 2016-02-26 00:05:43 -08:00
Chris Harris
f709246cac Fixed test data 2016-02-22 10:05:47 -08:00
Chris Harris
cbcdf11836 Formatting 2016-02-22 09:47:25 -08:00
Chris Harris
0a336df6ba Check return value of strncmp. Corrected SQLite expected schema test data. 2016-02-22 09:30:04 -08:00
Chris Harris
f500354040 Remove _all_ variants of primary key columns from testCreateTableColumnTypes() test 2016-02-22 09:08:34 -08:00
Chris Harris
0f0964be90 Correct builder type in test data 2016-02-22 08:46:16 -08:00
Chris Harris
13823834e2 Start of new tests 2016-02-22 08:39:41 -08:00
Chris Harris
db5399b124 Added $expectedColumnSchemaBuilder back to test data 2016-02-22 05:28:54 -08:00
Chris Harris
e0e82bc56b ColumnSchemaBuilder::__toString() should match $expected 2016-02-22 05:10:55 -08:00
Chris Harris
3761682edf Upgraded some tests. Fixed MySQL test fixtures to create all tables with InnoDB. 2016-02-22 04:53:14 -08:00
Chris Harris
eaeb926768 Adds char datatype to framework 2016-02-20 01:52:23 -08:00
Carsten Brandt
187c314d01 better fix for test break b9880f3247 2016-02-17 14:27:10 +01:00
Carsten Brandt
b9880f3247 added test for custom index hints in FROM and JOIN
close #10869
2016-02-16 21:24:00 +01:00
Carsten Brandt
4c6ecbe79c fixed wrong assertation in test 2016-01-28 20:13:10 +01:00
Carsten Brandt
261b3fd39b added a test for QueryBuilder PK 2016-01-28 17:43:14 +01:00
Carsten Brandt
f0a62cdbd3 allow expressions in GROUP BY 2016-01-27 16:53:20 +01:00
Carsten Brandt
5a462dc5d2 added tests and documentation for #8824 2016-01-27 16:26:43 +01:00
Andrew Nester
61df727eaf Expression objects for orderBy should be handled in QueryBuilder
fixes #10535
close #10637

- Added test to prove orderBy accepts \yii\db\Expression
2016-01-23 09:27:54 +01:00
Alexander Makarov
615a29f04e More fixes for MSSQL tests 2015-12-09 03:07:32 +03:00
Klimov Paul
bea90e1228 Fixed yii\db\Query::where() does not add params from directly passed yii\db\Expression 2015-12-05 12:28:43 +02:00
Carsten Brandt
decd45201c allow passing a single Expression object to select() and addSelect()
fixes #9883
2015-10-11 09:58:42 +02:00
Carsten Brandt
989699614f fixed test break 2015-09-19 18:29:41 +02:00
Carsten Brandt
4e7adc13ea adjusted docs about Query::from() and subqueries
also added a  test to verify behavior

close #9720
close #9266
2015-09-19 17:41:45 +02:00
Matvey Vasenin
3cc8c09898 some test case added 2015-08-17 10:17:51 +03:00
Matvey Vasenin
ce6e92b736 add comment control methods 2015-08-14 12:27:21 +03:00
Nikola Kovacs
316e95b81d Remove length from SchemaBuilderTrait::text.
close #9307
2015-08-05 22:50:46 +02:00
Carsten Brandt
56902298b4 fixed wrong expectation in QueryBuilder test 2015-08-04 12:58:03 +02:00
Carsten Brandt
0d778d0570 adjusted querybuilder tests to match implementation 2015-08-04 12:15:00 +02:00
Carsten Brandt
681db52ba6 refactored SchemaBuilder
- rename class to ColumnSchemaBuilder as this is more appropriate
- changed internal organisation to match how the rest of schema related classes work
  - the ColumnSchemaBuilder is now created the same way as QueryBuilder is
- removed static call magic and method annotations, now real methods are called as they are
- the whole code works on objects in a db context now instead of setting database connection in global state
- trait is now used by Migration by default but can be used in other contexts as well

Migration usage is now as follows:

```php
$this->createTable('example_table', [
  'id' => $this->primaryKey(),
  'name' => $this->string(64)->notNull(),
  'type' => $this->integer()->notNull()->defaultValue(10),
  'description' => $this->text(),
  'rule_name' => $this->string(64),
  'data' => $this->text(),
  'created_at' => $this->datetime()->notNull(),
  'updated_at' => $this->datetime(),
]);
```
2015-08-03 23:25:50 +02:00
Carsten Brandt
7150e830d9 do not use reserved php words as function in schemabuilder
there is a reason for them to be reserved, we should not add such workarounds to still use them.

close #9283
2015-08-03 11:21:58 +02:00
Alexander Makarov
8e1d982da4 Cleanup, added ->unique(), changelog 2015-07-08 15:55:09 +03:00