<p>It sounds like it's working as expected.</p>

<p>When you add a new migration for your plugin, you're expected to update your plugin's Install.php migration with the new schema changes as well.</p>

<p>You can see the relevant code here: <a href="https://github.com/craftcms/cms/blob/develop/src/base/Plugin.php#L149-L161" rel="nofollow noreferrer">https://github.com/craftcms/cms/blob/develop/src/base/Plugin.php#L149-L161</a></p>

CC BY-SA 4.0
2019-09-14T21:16:24.867Z
thanks. so when we change database schema, we have to create a separate migration for current installations and update install.php for new installations? what is the point of this special install.php migration anyway?
user9975
CC BY-SA 4.0
2019-09-13T23:10:48.730Z
2019-09-13T23:10:48.730Z
Brad Bell
<p>I have a custom plugin which is added via path repository on local.
I have some migrations in the <code>src</code> folder.</p>

<p>My problem is if I uninstall the plugin and install it again, I can see all of the migrations in the migration table, but only Install migration is applied.</p>

<p>If I change the version and schema version of the plugin and remove and require the plugin again, I get update plugin notification on the dashboard and all of the migrations are applied correctly.</p>

<p>also if i create and apply these migrations via command i can see change in databases.</p>

<p>i don't why migrations aren't applied on plugin install -except Install migration-?</p>

<craft3><migration>
Only Install migration is applying on plugin install
# Only Install migration is applying on plugin install

(Asked by: username_0 on 2019-09-12)

I have a custom plugin which is added via path repository on local.
I have some migrations in the `src` folder.

My problem is if I uninstall the plugin and install it again, I can see all of the migrations in the migration table, but only Install migration is applied.

If I change the version and schema version of the plugin and remove and require the plugin again, I get update plugin notification on the dashboard and all of the migrations are applied correctly.

also if i create and apply these migrations via command i can see change in databases.

i don't why migrations aren't applied on plugin install -except Install migration-?

**Tags:** craft3, migration

---

## 1 answers

### Answer by username_1 on 2019-09-13. Score: 1 | Accepted answer

It sounds like it's working as expected.

When you add a new migration for your plugin, you're expected to update your plugin's Install.php migration with the new schema changes as well.

You can see the relevant code here: <https://github.com/craftcms/cms/blob/develop/src/base/Plugin.php#L149-L161>

> **Comments:**
> **username_0**: thanks. so when we change database schema, we have to create a separate migration for current installations and update install.php for new installations? what is the point of this special install.php migration anyway?  

---

