Skip to content

Commit d392277

Browse files
authored
Merge pull request #626 from merlindiavova/patch-1
Correct API link from v3 to v5
2 parents 239f83a + 475fc30 commit d392277

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/5.x/extend/migrations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Migration classes contain methods: [safeUp()](<yii2:yii\db\Migration::safeUp()>)
4646
You can usually ignore the `safeDown()` method, as Craft doesn’t have a way to revert migrations from the control panel.
4747
:::
4848

49-
You have full access to [Craft’s API](https://docs.craftcms.com/api/v3/) from your `safeUp()` method, but plugin migrations should try to avoid calling the plugin’s own API here. As your plugin’s database schema changes over time, so will your APIs assumptions about the schema. If an old migration calls a service method that relies on database changes that haven’t been applied yet, it will result in a SQL error. So in general you should execute all SQL queries directly from your own migration class. It may feel like you’re duplicating code, but it will be more future-proof.
49+
You have full access to [Craft’s API](https://docs.craftcms.com/api/v5/) from your `safeUp()` method, but plugin migrations should try to avoid calling the plugin’s own API here. As your plugin’s database schema changes over time, so will your APIs assumptions about the schema. If an old migration calls a service method that relies on database changes that haven’t been applied yet, it will result in a SQL error. So in general you should execute all SQL queries directly from your own migration class. It may feel like you’re duplicating code, but it will be more future-proof.
5050

5151
### Manipulating Database Data
5252

0 commit comments

Comments
 (0)