Hello, friend.
Welcome back.
In a previous video, we successfully configuration our MySQL database with our Jianguo project, right?
So now I want to do I want to migrate it.
So in our first application into the first application, if you go to that models into the models I
have allocated to all this debris class one of the musician and the album and for the musician, I have
also defined some of the field.
So they have the tree field as a first name, last name and the instrument.
And also I have created another table class as a Alabam.
So that is our album into this album.
I have defined that for field.
One is the artist name, the release date and also the number three starts.
Right.
And also here I define one of the artist.
Here I define the foreign key in our musician class.
That means in particular, that position I have defined as a foreign key one of the field and before
we use it in our school life.
Right.
So right now I am actually changed.
So right now I am working with our Maestrelli for the reasons before all that our data.
That means here I have some of the Battalino musician, Taibi.
I have saved some of the data in our albums.
Tabit So right now, before all that, our Escola data is not totally gone.
So our previous data is totally clean.
And I want to do I want to actually, first of all, grade.
So if you want to make it, I think you already know about it.
I have already discussed about that things with you.
So I have already shared some of the all the basics.
So now together, all the best, we will create one of the core applications.
I hope it will be very much clear to you, far better understanding how Django actually worked.
So for doing this, I just open our Tamino into the terminal that is our project victory, as if my
first project victory.
That means here.
Right.
So in particular, that area, first of all, we have to do we have to define as a python or by whatever
you write.
So I just simply defined by and the man is Domantas Dumphy and then our my grid.
So I just simply defined as a microphone.
So first of all, we have to do we have to migrate it.
And before I get make sure you will save your all the data.
So I just save it.
And now I wanted to do define the python Arbie and the man is not Fi and the mike that as they enter.
So now it's automatically created all that database and also it's migrated in our database, and after
that we have to do we have to run our second command.
We are our second command was actually fired and the man is not fly and then make migration's right.
Make my and our application folder name.
That is our application name as a fast app.
So I just simply defined as the fast fast underscore sorry underscore app.
So here you have to run our second command as a five minutes.
Why make migration's and hour fast.
That means fast app right now.
Click enter.
Perfect, and after that, we have to make the leap again, so I just simply define again as a the spy
and the manna's fi and the secret neocon because after.
I can see everything is perfect.
So now if you go to our database and now here if you refresh it.
Yes, now, because a friend now is automatically created all that default database table and also I
have created two this database.
Maybe one is the fast app of the album, and that is our fourth step as a musician.
So if you open it now, you can see they have no data.
So are all the previous data is totally clean.
And here for our musician table, I have defined three of this field as a fast name.
There is a last name and the instrument.
OK, so here, if you now compare it with our model, similar this model here, you can see that is
actually our musician table.
I have defined the three of this field.
So now that is actually the tree of this field.
And also there is another table.
I have created the album and the album here you can see the name that is already listed, number three
stars, and that is our artist ID.
And here, one thing straight I want to share with you.
I have already discussed about the things we do here.
You can see I didn't find any I.D. So as I told you before, by default it will be created one of the
I.D..
OK, so you can say I didn't find any I.D., but it's automatically created one of the ID field.
So that is a problem with the ID.
If you go in musician, you can see automatically excluded on the primary as ID if you go to the structure.
Into this structure, you can see that the primary ID so far, the results here, they told you you
don't need to create any feel for this one automatically should be created.
And also here I define one of the foreign key in my high definition of the foreign key for this at this
table that this artist will into this artist feel I have defined under the foreign key in our musician
by default automatically.
And I was created like, if you go our album into the album, if you go to that structure here, you
can see is automatically defined.
Our one of the idea that means the artist ID, so that is the one of the primary key is automatically
created.
That means this artist ID, so this ID will be match actually our foreign key of our musician table
with this ID.
OK, so they have the foreign key I have defined now it's perfectly getting this I hope is very much
clear to you right now.
And here also I define our table.
That is our last name as a musician and the album.
But here if you go to a database into the database by default, it's created one of the name as a first
application name.
That means for first of all, it's adding our first application name and then our album name.
That means our table name.
Right.
So if you want to change it, then you can also change it.
Then you have to do you have to go to your models into these models.
That means here.
OK, so like after that.
So after that I want to do I want to define the middle class.
So here you have to define as a class.
And here I just defined as a matter as I told you before my time is that if you want to pull out the
glass inside to the other class, then you have to define as a middle class.
OK, so into this middle class here, you have to defining it like here I have the front of the TV underscore
table I want to do and to change that name.
I want to make that name as a just album, OK, I just name it, just album.
So if you want to actually rename your database, Phelim, that means if you want to rename this database
table, Phelim, then you can change it with this middle class, OK, with this middle class here,
you have to define the DeVita bill.
And now whatever the name you want to define for this specific this class name that was specific, disturbing
them, then you can define that things on here.
So if you want to apply it, I show you like here you have to do you have to save all.
So they told you before, whatever the things you will update in particular, that position after that,
we have to round three of this comment.
That means, first of all, we have to run our by managed by Miqdad click on the enter and then you
have to define as and another one as a five and a minus five and make migration's.
And our final step is to enter.
And after that you can see Snowshoeing as a rename table for the album to album.
OK, so you automatically now rename it and now we have to migrate it again.
So I just using our keyboard Popke.
So if you use it automatically it'll be getting our previous all that common.
So now I just simply defined by a..
By Alami again on the enter.
So now it's perfectly updated.
And now if you go to your database, like I said before, that was really fast.
I'm under escort app under this album.
So now I just changed this texture.
Yeah.
You can see now it's become changed.
So now it's by default is not showing out this field every field as appropriately same, but only our
database Debenham has become changed.
So here I define the album.
So here to help define that as we know our math class as the album.
So now this debris is visible.
So if you want to change it, then you can change it like that way.
OK, so right now it's OK with me.
I want to do I want to make the things that the previous one that means the default one.
So I just simply defining it again to save all.
And now I have to write out this command again, that military command, BHP mine is very fast and then
we have to run our migration's.
Migrations or final stop?
And then also we have to run again, the migrant.
Yeah, perfect.
So now go here.
Refresh it again, you can see it's now become changed again as a final step, and I hope you can will
understand about it.
And also here, that is our authenticated user, right.
So before I have already created one of the authentication user.
But right now you can see it's totally gone because here when you actually updated it by default, everything
will be clean, like I show you, like here if you want to access our Django admin panel, like the
is that Django had been so here we have to run our site.
So I just started I want to do and to add a new terminal.
And here, first of all, we have to run our server as a python python and then our managers start phy
and then run server.
We're going to enter.
Ostovar is now running, and now if you go here, you can see Snow perfectly updated, but before I
have used one of the username as a write some Jagt and also depends some of the password.
But if you knock together Lockie, you can see it's not actually recognize your name.
And the password because of all in our database is totally clean.
So for the results, we have to create another super user.
OK, so we have to create another super user.
So if you want to create I think you already know about it, how can create it.
So like here I want to do and open our new terminal.
And here, first of all, if you want to create another super admin, then you have to define as a pie
or the python and the as dot fi and then create super user.
Right.
So that is actually the document as if I manners file and the create and the super user perfect.
So now I wanted to create another super user click on the enter.
Now you can see snowshoeing as a name, as a jet, so right now it's stuck with me.
So but I just simply copy it.
I want to want to make the things on here.
So that is our user name.
And now also, if you click on the enter and also we have to define our email address, I just limit
is Ardian or have been better at being at the red Gmail dot com.
OK, better I just save it also.
I just save it and also, if you don't click, enter is two bucks for your passport, so you just use
the password again as you do me.
One, two, three, four, five.
And also after that, I do find another one as you do me.
One, two, three, four, five.
That is to confirm again, you start match.
Maybe I some of the wrong you do me one, two, three, four or five.
You do me one, two, three, four or five.
I'm going to enter.
Yeah you can see our super user created successfully.
So now our super user is not created.
And also I know server or Tarawallie still running.
So now let's check this out.
If you know, refresh it.
Yeah, you can see now we can actually successfully locked in, so if you're not picking the lock out
and if you now go to our locking again and hear our username, so our user name actually previous one
just like that, same as Amjad.
And also define the password as you do me two, three, four, five.
OK, so that is actually our username.
So I just have to defend that username and then the password.
I just simply defined the password because a login.
Yeah.
We can see successfully logged in.
So if you go to our musicians right now, you can see they have no data as a musician.
And as I told you, when you update your server, that is my SQL Server, our previous all the data
is totally gone.
So if you want to add some of the musicians that are like that is our musician that I just want to add
some of the data as a first name.
I just name it as the or Karzai and then Arion and I just bought instrument as a guitar, OK?
I just simply defined as a guitar.
Now we to save.
Yeah.
You can see that right now perfectly safe.
And now if you go to our database and here if you go to our musician.
Yeah.
You can see that it is by default automatically getting on of Dida and there is a first name, last
name and our instrument.
And also I have created one of the super user.
Now if you go to that, our authenticated user, yes.
You can see that there was a password that is our last login time and date and the reservoir username
is visible.
Email address is also available.
Perfect.
I hope, friend, everything is very much clear to you.
So, you know, next video will create some of the template for our this album and the musician page
and also will play some of the view pays for this one.
OK, so we can do that work.
In our next video, I will show you that things with a live example.
So thanks for watching and I will see you in the next video.