Commit Graph

84 Commits

Author SHA1 Message Date
Maksim Spirkov
53256fdd24 Fix #20513: Fix code examples in PHPDoc 2025-09-06 00:22:56 +03:00
Alexander Makarov
52e4a3e645 release version 2.0.50 2024-05-30 20:23:31 +03:00
Wilmer Arambula
f3f2f2bb08 Apply sugestion rob006. 2024-05-18 11:43:02 -04:00
Alexander Makarov
e7b6330dbb Merge branch 'master' into master 2024-05-16 15:04:21 +03:00
Razvan Grigore
e2a167028b Upgrade to PSR12 coding standard (#20121) 2024-03-19 17:21:27 +03:00
Roberto Braga
9de65e7959 Merge branch 'yiisoft:master' into master 2023-09-22 09:06:09 +02:00
Roberto Braga
493cbc3577 Correction on dropCheck() message 2023-09-22 09:05:32 +02:00
Roberto Braga
8aa0ac69a6 Correction on dropCheck() message 2023-09-22 09:03:50 +02:00
Bizley
0f7248c7a2 release version 2.0.49 2023-08-29 15:36:17 +02:00
bobonog@gmail.com
3615134d3d Added method for addCheck() and dropCheck(), resolve #19817 2023-07-05 11:50:57 +02:00
Sohel Ahmed Mesaniya
6c511d99fb Fix #19759: Update docs for Command::createTable(), Migration::createTable() and QueryBuilder::createTable() 2023-06-16 07:02:22 +03:00
Bizley
161526cd41 HTTPS everywhere (#19503) 2022-08-03 12:32:18 +03:00
Brandon Kelly
a87c02c712 Fix more types (#19333)
* Migration::upsert() returns void

* Unneeded `@property` tags

* Add missing `null` param/return types

* Null types for db\Query + db\ActiveQuery

* Fixed testSelect

* Null types for Validator

* Several more null types

* One more

* Make AccessRule::$allow always a boolean

It doesn't have any special null handling, so it's safe to default to false

* Validator::$skipOnEmpty is always a boolean

* Catch all throwable from Widget::widget()

* Don't limit $previous args to \Exception

The actual \Exception allows $previous to be any throwable in PHP 7+

* Add Throwable catch block to Instance::get()

* Throwable cleanup

Comment changes only.

- Document \Throwable instead of \Exception wherever appropriate
- Removed redundant exception/error classes when \Throwable is referenced

* Yii::setlogger() accepts null

* ArrayHelper::removeValue() can remove any type of value

* Change default $allow value to false
2022-04-03 11:20:21 +02:00
Brandon Kelly
4628b91e73 Fix types (#19332)
* Migration::upsert() returns void

* Unneeded `@property` tags

* Add missing `null` param/return types

* Null types for db\Query + db\ActiveQuery

* Fixed testSelect
2022-03-30 18:40:10 +02:00
rhertogh
81a3b83995 Fix #19021: Fix return type in PhpDoc yii\db\Migration functions up(), down(), safeUp() and safeDown()
* Fixed PhpDoc in Migration.php (revert #18886)

Fixed the return type of `up()`, `down()`, `safeUp()` and `safeDown()` functions to match the described behavior.
The current implementation checks for `false`, "all other return values mean the migration succeeds".
This PR also reverts #18886 since it was a code fix for what was documentation error.

Allow all possible values for `yii\db\Migration` functions `up()`, `down()`, `safeUp()` and `safeDown()`
2021-11-22 00:43:53 +03:00
Anton
fdbdbb51fb Fix #18886: Fix default return of yii\db\Migration::safeUp() and yii\db\Migration::safeDown() 2021-09-19 12:38:06 +03:00
Brandon Kelly
eb956e9c6b primary/replica in a definitely non-breaking way (#18106) 2020-06-16 11:33:27 +03:00
Brandon Kelly
472600ee3f Fix #18102: Use “primary”/“replica” terminology instead of “master”/“slave” 2020-06-14 00:12:10 +03:00
Brandon Kelly
47674e1266 #13879: Added yii\db\Migration::upsert() 2018-02-16 17:37:00 +03:00
Klimov Paul
65f6b59b35 @inheritdoc notation changed 2018-01-23 13:11:24 +02:00
Ankit Padia
9944d7a49f Fixed wrong description for param $table in addCommentOnTable() (#15387) [skip ci] 2017-12-19 13:59:43 +03:00
Alexander Makarov
2d672b6722 release version 2.0.13 2017-11-03 01:09:29 +03:00
Alexander Makarov
fb23b0d0ea Code style fixes 2017-11-01 02:43:02 +03:00
Alexander Makarov
1f24fd35b9 Fixes #14910: adjusted safeUp()/safeDown() docs [skip ci] 2017-10-04 15:47:03 +01:00
santilin
6eae7fba59 Fixed typo: an => a in batchInsert [skip ci] 2017-10-02 21:15:31 +02:00
SilverFire - Dmitry Naumenko
5aedb9e040 Fixed typo in PHPDocs 2017-09-12 16:55:29 +03:00
Francis Lavoie
9588c8f5a4 Fixes #13853: Added yii\db\Migration::$compact as well as yii\console\controllers\BaseMigrateController::$compact to allow making the migration console output more compact 2017-08-25 13:30:28 +03:00
Robert Korulczyk
5a8c3d537b Enable phpdoc_summary rule in php-cs-fixer config (#14675)
* Enable `phpdoc_summary` rule in php-cs-fixer config.

* Fix case in "PHPDoc".
2017-08-21 11:19:35 +02:00
Thiago Talma
1d062100b6 Fixes #13787: Added yii\db\Migration::$maxSqlOutputLength that allows limiting number of characters for outputting SQL 2017-06-09 23:36:19 +03:00
Alexander Makarov
902c2b563d Fixes #13831: Added more info about transactions in migrations to phpdoc [skip ci] 2017-04-02 00:41:34 +03:00
Carsten Brandt
a3b6dfbb7b Catch \Throwable in critical places
Added catch `\Throwable` to be compatible with PHP7.
Added it in cases where object state needs to be kept consistent.

Mainly on transactions but also some other places where some values are
reset before exiting.

Most of them could probably be refactored by using `finally` in 2.1, as
that requires PHP 5.5.

fixes #12619
2016-12-16 02:20:02 +01:00
Robert Korulczyk
4aa935e69e Fixes #12055: Changed boolean to bool and integer to int in phpdoc 2016-11-07 02:51:39 +03:00
Boudewijn Vahrmeijer
32f4dc8997 Fixes #5385: links created from classes to corresponding guide articles (#12920) 2016-11-04 18:55:14 +03:00
rhertogh
f696a28c79 display the table when dropping index
display the table, helping when dropping multiple indices with the same name
2016-09-16 19:56:08 +02:00
__FresHmaN
b764a7a21e Disable slaves when execute migrations to resolve master-slave replication no-sync (#12460)
Resolve #12446
2016-09-05 10:57:29 +03:00
__FresHmaN
af189518a3 removed incorrect docblocks 2016-09-03 14:02:40 +03:00
Alexander Makarov
0061692e60 Replaced unnecessary double quotes with single quotes 2016-07-29 22:56:38 +03:00
mshutov
bb35fda6e9 Update Migration.php (#11605)
Typo in doc for safeDown
2016-05-21 15:32:34 +03:00
Carsten Brandt
edd6e719bb added missing since annotations and removed duplicate line 2016-04-28 03:02:17 +02:00
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
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
Matvey Vasenin
341e16645a add cubrid support 2015-08-19 14:49:40 +03:00
Matvey Vasenin
c0c380e730 add comment to migration 2015-08-17 11:07:19 +03:00
Matvey Vasenin
ce6e92b736 add comment control methods 2015-08-14 12:27:21 +03:00
Carsten Brandt
abc7dbbf0f added missing @since annotations 2015-08-04 12:40:12 +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
6e3da6b329 various phpdoc fixes 2015-08-02 22:53:08 +02:00
Yasser Hassan
1df3bb29ea Clarify escaping column name quoting in createIndex()
Added information about when column names are not quoted when using createIndex() as discussed in #9017. "left parenthesis" was used rather than just "parenthesis" to reflect the exact code working.
2015-07-06 12:41:07 +02:00
Klimov Paul
e683e3e79d Schema refresh moved to Migration::init(). 2015-06-08 11:32:09 +03:00