This video will introduce django migrations and give you an overview of what you’ll learn throughout the course. You will learn what migrations are, the advantages of using them, and how django works with relational databases.
What Django Migrations Are and the Problems They Solve
00:11 You’re going to see how to create migrations, how to apply the migrations you’ve created, how to change your Django models, how to list migrations, how to unapply migrations, and how to name those migrations.
00:54 This means you don’t have to learn SQL to create databases and Django translates the Python classes that you create into the database for you. Migrations are the tools which allow the creation and modification of database tables without having to learn that SQL language.
01:14 So, what are the advantages of using migrations? Well, the first one is to avoid repetition. You’re not creating similar code to create your models within your program and then doing the same to create it in the database. Secondly, closely related to this, it ensures that the model and the database are in sync.
01:33 Third, it’s possible to track the database schema changes because these are reflected in your Python code rather than merely in the database files themselves. And fourth, the modification of the databases are handled for you.
Become a Member to join the conversation.