Commit Graph

45 Commits

Author SHA1 Message Date
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
5cecb09c1b Fixes #9443: Added unsigned() to ColumnSchemaBuilder 2015-12-26 15:20:21 +03: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
Alexander Makarov
8765cae71c Reverted #9656 because of BC break (reverted from commit 4a464afe9b) 2015-11-25 06:41:55 +03:00
Edgard Lorraine Messias
7c9b7c77a7 Added tests for dropTable, truncateTable and renameTable 2015-11-20 16:16:44 +03:00
Sam Mousa
4a464afe9b Fixes #9656: yii\db\BaseActiveRecord refactored in order to getting, setting and unsetring attribute values using the same approach 2015-11-20 15:45:12 +03:00
SilverFire - Dmitry Naumenko
58119c5b11 Fixed testCreateTable, testAlterTable now quotes table name 2015-11-19 00:17:16 +02:00
Carsten Brandt
6acb76606c fixed connection serialization test 2015-11-17 12:06:32 +01:00
Sam Mousa
603a956b8d Implemented __sleep in yii\db\Connection
to support serializing the connection object without exceptions.

- Added test for serializing an open connection.
- Added unserialize test

close #10149
2015-11-16 22:44:57 +01:00
romeOz
9ed8b80493 Added tests for #9790 2015-11-11 21:04:18 +03:00
Edgard Lorraine Messias
2d8106a39c Fixed testCreateTable and testAlterTable in CommandTest for MSSQL and OCI 2015-10-21 00:19:48 +03: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
3826b6f4a3 added test for #9869 2015-10-09 16:30:18 +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
AIZAWA, Hina
0f2a77ed36 Fixes #9442: Fixed yii\db\Migration::renameTable() caused fatal error when using SQLite driver 2015-08-18 11:52:48 +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
310f9152e1 Fixes #9268: Improved display of boolean parameters in logged SQL queries 2015-08-01 00:30:16 +03:00
Alexander Makarov
357bce51bb Tests for #9006 2015-07-30 19:25:52 +03:00
Alexander Makarov
8e1d982da4 Cleanup, added ->unique(), changelog 2015-07-08 15:55:09 +03:00
Matvey Vasenin
da941a7675 Improved SchemaBuilder implementation 2015-07-08 15:40:09 +03:00
Matvey Vasenin
b456f699cc Implemented SchemaBuilder 2015-07-08 15:38:21 +03:00
Carsten Brandt
2872365000 added test case for #8918 2015-07-04 03:08:34 +02:00
Carsten Brandt
0858d0a834 added test for querybuilder select
close #8895
2015-06-26 00:13:08 +02:00
Carsten Brandt
d0c6cb7700 abort removing duplicate records when pk is not in result set
in this cases it does not make sense to remove duplicates as the result is not on record level anymore.
This could be the case after GROUP BY has been applied.

fixes #8772
2015-06-14 19:29:57 +02:00
Carsten Brandt
879911810f added test for createTable and alterTable
test for issue #8627
close #8628
2015-06-08 20:40:24 +02:00
Klimov Paul
72f9e63e10 Table schema auto refreshing on DDL added to yii\db\Command 2015-06-04 13:53:11 +03:00
Klimov Paul
fb0062114e Method yii\db\Schema::refreshTableSchema() added 2015-06-04 12:57:16 +03:00
Klimov Paul
0d48f1041e Fixed yii\db\Command::getRawSql() unable to parse params specified without colon (':') 2015-06-02 13:45:28 +03:00
Klimov Paul
a849e815df Fixed yii\db\ActiveQuery produces incorrect SQL for aggregations, when sql field is set 2015-05-29 13:18:20 +03:00
Carsten Brandt
aa5887fec7 added missing use statement to fix #8572
- added unit tests for timestamp behavior and insert with expression
- fixed issue #8572

close #8596
2015-05-29 01:37:47 +02:00
Klimov Paul
51a442d6c8 Fixed yii\db\ActiveRecord does not updates attribute specified at optimisticLock() after save 2015-05-26 11:53:34 +03:00
John Was
57db031d1c Merge branch 'master' into 7374-inserting-ar-without-values 2015-05-24 23:29:40 +02:00
John Was
a63fc2ff59 properly quote sequence name in Schema::getLastInsertId()
fixes #8483
close #8515
2015-05-21 22:42:34 +02:00
John Was
94acb2e126 add unit tests to check lastInsertId 2015-05-16 11:47:31 +02:00
John Was
01345874a3 add working QueryBuilder test for Oracle 2015-05-16 11:31:52 +02:00
Klimov Paul
6d96d3cbee Fixed yii\db\BaseActiveRecord::updateCounters() fails for new record saved with counter attribute not set 2015-04-21 16:23:00 +03:00
Jan Was
5f099b3f8d Merge branch 'master' into 7374-inserting-ar-without-values 2015-04-21 09:49:46 +02:00
Klimov Paul
aa9399c6c0 Merge branch 'master' of github.com:yiisoft/yii2 into 5042-insert-returning 2015-04-20 11:23:38 +03:00
Alexander Makarov
6949992246 Simplified tests directory structure a bit 2015-04-16 12:10:01 +03:00