Create a check for initial migrations
See original GitHub issueToday I found a code like this:
class Migration(migrations.Migration):
# initial = True
dependencies = []
And this was an initial migration for an app.
This suprised me:
- It works correctly
- It does not produce any warnings
- It is cryptic
What am I concerned about? I have an impression that all migrations with dependencies = []
must be initial
, because otherwise they should be dependent on a previous migration. Am I correct?
So, I guess we can check this pretty easily in case initial
really works this way.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Code First Migrations - EF6 - Microsoft Learn
Customizing Migrations. So far we've generated and run a migration without making any changes. Now let's look at editing the code that gets ......
Read more >Code-Based Migration in Entity Framework 6
To use code-based migrations, first execute the enable-migrations command in the Package Manager Console. Open the Package Manager Console from Tools → Library ......
Read more >Migrations and Seed Data With Entity Framework Core
The migration process has two steps: Creating migration and Applying ... The first thing it does is inspect our class, associated entity ...
Read more >Migrations - Django documentation
For an initial migration that creates one or more tables ( CreateModel operation), Django checks that all of those tables already exist in...
Read more >Entity Framework Core Migrations
The target migration is the point to which you want to restore the database. For example, if your first migration is named "Create",...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
hello @denisSurkov 👋
I think it’s still relevant, however, we haven’t got time to work on this issue, so any help is really appreciated. To be honest, I haven’t checked how to implement this feature, but the general process could look like this:
MigrationLoader.graph.root_nodes()
can be used to implementinitial = True
checkMigrationClasses
to this file so migration-related checks can be included separatelyOf course, don’t forget about unit tests of all newly introduced code. Let’s ping me if you have any questions etc 😉
Hi
Is there any activity here? Is it still relevant?
And if so, what do you expect from this feature?