Skip to content

Commit 6724fa6

Browse files
committed
Restoring the warning about using create() and update()
The need for calling those methods in not gone yet
1 parent 136e139 commit 6724fa6

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"keywords": ["phinx", "migrations", "database", "db", "database migrations"],
66
"homepage": "https://phinx.org",
77
"license": "MIT",
8-
"version": "0.10.0",
8+
"version": "0.10.1",
99
"authors": [{
1010
"name": "Rob Morgan",
1111
"email": "[email protected]",

docs/migrations.rst

+6
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,12 @@ Please be aware that when a ``change`` method exists, Phinx will automatically
123123
ignore the ``up`` and ``down`` methods. If you need to use these methods it is
124124
recommended to create a separate migration file.
125125

126+
..note
127+
When creating or updating tables inside a ``change()`` method you must use
128+
the Table ``create()`` and ``update()`` methods. Phinx cannot automatically
129+
determine whether a ``save()`` call is creating a new table or modifying an
130+
existing one.
131+
126132
Phinx can only reverse the following commands:
127133

128134
- createTable

src/Phinx/Migration/Migration.template.php.dist

+3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ class $className extends $baseClassName
2626
*
2727
* Any other distructive changes will result in an error when trying to
2828
* rollback the migration.
29+
*
30+
* Remember to call "create()" or "update()" and NOT "save()" when working
31+
* with the Table class.
2932
*/
3033
public function change()
3134
{

0 commit comments

Comments
 (0)