Closed yubarajshrestha closed 2 years ago
Summarizing the specs to fix this issue here (from Discord):
👉 The proposed solution was to add an index in the migration filename: {timestamp}_{index}_{name}.py
.
This index would be computed based on the list of existing migrations in the migrations folder.
@josephmancuso is that correct ?
@yubarajshrestha Are you okay with the specs above ?
@yubarajshrestha Are you okay with the specs above ?
Yes, you're right. You should order those migrations based_on order of migrations added in migrations.
.migrations(
"migrations/first_table.py",
"migrations/secon_table.py",
"migrations/third_table.py",
)
Yes, you're right. You should order those migrations based_on order of migrations added in migrations.
☝️ Yes you're right. But that become a Masonite issue then. I will transfer this issue to the Masonite repo.
I think this is solve https://github.com/MasoniteFramework/masonite/blob/4.0/src/masonite/packages/providers/PackageProvider.py#L150
@josephmancuso if you try to migrate the migration with above solution that will give you error if you try migrating.
Describe the bug If you have multiple migrations in package development then we need a way to maintain the hierarchy of migrations.
To Reproduce Steps to reproduce the behavior:
Expected behavior Should be able to maintain the order of migrations registered.