Commit Graph

784 Commits

Author SHA1 Message Date
Carsten Brandt
ad69b0f8cb added note about fields that can be used in onCondition 2015-11-26 00:11:03 +01:00
Carsten Brandt
7c7ed48c4c cleanup docs and duplicate code in query 2015-11-25 23:31:29 +01:00
Alexander Makarov
8765cae71c Reverted #9656 because of BC break (reverted from commit 4a464afe9b) 2015-11-25 06:41:55 +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
Alexander Makarov
e4f5b91f74 Fixed #6351 MySQL 5.1 compatibility 2015-11-20 02:26:15 +03: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
Alexander Makarov
7641d2d83b Enhanced #9337 as @klimov-paul suggested in e94810551c (commitcomment-14335135) 2015-11-11 21:14:23 +03:00
Alexander Makarov
cddb036cf9 Fixes #9790: Fixed yii\db\sqlite\QueryBuilder to generate proper SQL for UNION 2015-11-11 21:05:57 +03:00
Constantine Chuprik
e94810551c Fixes #9337: Added yii\db\ColumnSchemaBuilder::defaultExpression() to support DB Expression as default value 2015-11-11 20:42:07 +03:00
Alexander Makarov
95f251edd1 Fixes #10084: Improved DB docs 2015-11-04 12:08:18 +03:00
Steve Guns
d40435e931 Enhanced #6351 fix by reintroduced older (SQL CREATE) style FK detection for people still running MySQL servers where referential_constraints is not available 2015-10-27 17:44:16 +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
Alexander Makarov
1b3770fd21 Use === instead of == where possible 2015-10-10 01:04:35 +03:00
Alexander Makarov
f83d233072 Fixed method call case to match definition 2015-10-10 00:26:44 +03:00
Alexander Makarov
5ab4f0f090 Better quotes usage in strings
- Use single quote where interpolation isn't necessary
- Use interpolation when it's better than concatenation
2015-10-10 00:23:52 +03:00
A Slatius
a030cd4250 Allow the use of Yii aliases in an SQLite dsn
Making it possible to use a SQLite DSN like;

```php
'db' => [
    'dsn' => 'sqlite:@app/db/database.sqlite3',
]
```

That way it'll always work out of the box and absolute paths aren't
needed.

close #9869
2015-10-09 16:21:33 +02:00
jeicd
c2f83da8d8 Fix phpdoc 2015-10-05 15:00:13 +06:00
jeicd
0407407b76 fix coding style to follow PSR-2 2015-10-05 13:58:47 +06:00
Vovan-VE
c68b9a486c Fix: Issue #9814: event type EVENT_AFTER_INSERT and EVENT_AFTER_UPDATE
Events `EVENT_AFTER_INSERT` and `EVENT_AFTER_UPDATE` are documented
as `Event`, but infact they are `AfterSaveEvent`.
2015-10-03 20:23:56 +08:00
John Was
eb6935e4a8 add more conditions when reading mysql information_schema to speed it up 2015-10-01 12:20:19 +02:00
Jan Waś
191185f5e3 Fixes #6351: Find MySQL FK constraints from information_schema tables instead of SHOW CREATE TABLE to improve reliability 2015-09-29 13:47:20 +03:00
Alexander Makarov
ab0b50c30d Merge pull request #9496 from daliran/Sqlsrv-MARS
Fixed #9454: changed sqlsrv pdo class selection
2015-09-28 17:40:42 +03:00
Carsten Brandt
229a39dec1 Revert "Fixes #9758: phpdoc correction"
This reverts commit 13a2b70a65.

The docblock is totally valid as it describes the property defined by this getter.
2015-09-24 21:52:21 +02:00
Alexander Makarov
13a2b70a65 Fixes #9758: phpdoc correction 2015-09-24 00:48:31 +03: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
Aleksandr Golovko
a2f70f6484 Update Query doc return type
When used ActiveQuery chain call after call any of join type IDE cannot resolve ActiveQuery methods such an asArray
Example:
SomeActiveRecordModel::find()
            ->select('...') // return ActiveQuery
            ->leftJoin('...', '...') // return Query
            ->asArray() // it's become undefined
            ->column();
2015-08-21 17:14:00 +03:00
Davide Della Casa Venturelli
329fe129fe Fixed #9454: changed sqlsrv pdo class selection 2015-08-21 13:25:02 +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
Carsten Brandt
620ec4d132 added missing namespace on Exception in transaction docs
fixes #9429
2015-08-16 14:13:51 +02:00
Carsten Brandt
34d5b45b35 proper fix for #8844, convert array before using it
fixes #9415
2015-08-14 12:26:36 +02:00
Nikola Kovacs
316e95b81d Remove length from SchemaBuilderTrait::text.
close #9307
2015-08-05 22:50:46 +02:00
Michael Härtl
b071587e0a Improve docs for bindParam() $value 2015-08-04 16:08:38 +02:00
Carsten Brandt
abc7dbbf0f added missing @since annotations 2015-08-04 12:40:12 +02:00
Carsten Brandt
41b25e94b0 improved parameter naming and documentation of schemabuilder
changes according to #9191
close #9191
2015-08-04 11:58:41 +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
1948754d00 phpdoc and slight refactoring of SchemaBuilder 2015-08-03 17:38:13 +02:00
Carsten Brandt
d8bb724ec7 changed method visibility, fixed test break 2015-08-03 12:37:58 +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
Carsten Brandt
8cfc89b21c adjusted pgsql/QueryBuilder batchInsert to match parent implementation
this also fixes #8551
2015-08-02 23:20:52 +02:00
Carsten Brandt
6e3da6b329 various phpdoc fixes 2015-08-02 22:53:08 +02:00
Carsten Brandt
a2568d1ec8 updated some comments and @since annotations 2015-08-02 19:56:49 +02:00
Carsten Brandt
6d9fe671de various code style and whitespace adjustments 2015-08-02 00:27:19 +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
972165ccec Fixes #9006: Fixed bit column always returning true using certain version of PDO MySQL 2015-07-31 03:19:23 +03:00
nidgetgod
b8fefe513c fixed: Oracle 11g 11.2.0.1.0 ORA-03113: end-of-file on communication channel
This is a workaround for an oracle bug:
https://code.google.com/p/yii/issues/detail?id=1779

close #8844
2015-07-26 02:08:47 +02:00
Alexander Makarov
bad507c459 Fixes #9063: Workaround for MySQL losing table case when adding index 2015-07-17 08:41:39 +03:00
Sitawit Suteepohnwiroj
5af6105ea7 Fixes #9127, Fixes #9128: Fixed MSSQL QueryBuilder::renameColumn() and QueryBuilder::renameTable() escaping 2015-07-16 18:22:40 +03:00
Sebastian Thierer
e0d2107e1b Mysql unique index creation fix. 2015-07-10 12:27:15 -03:00
Sebastian Thierer
82fbb568e0 Fix for 9056 2015-07-09 11:52:33 -03:00
Alexander Makarov
e88170ab82 Fixed phpdoc of SchemaBuilder 2015-07-09 00:17:26 +03:00