Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
Pokey's Fatmata course of Lavallade, EPA, Dalip and Will, this is part five inside this feed you
will see the concept of migration and its very basic commands.
So if a part of project set up in the last video we had seen our first program inside Laravel.
Inside that video we had created a controller, a simple robot and a few file.
Also, we had seen a concept, something called BHP Optician.
So BHP Partition Inside Lamell is a command line to Orsi command line interface, which interacts with
lateral application.
So if I back to terminal, if I type the command called VSP Optician, now as we can see that we are
getting a command bolade each command of this command palette is for us for some specific task.
In the last video, as we had seen that by the help of this controller, we have completed the task
of creating a new controller class.
So each command of this partition is created to complete any single specific task.
Now, from this command palette and this time we will see the concept of migration, so we will use
a command from this command palette, something called make migration.
And here's the command.
The description is something, create a new migration file.
So before starting this migration, first of all, we need to understand that what is a migration file?
So migration file is a file which is going to provide a devilly structure.
It means inside this file will define a structure, something let's say for the users.
They will if we want some columns like Naem email, phone number.
So we will specify the name of columns as well as the data type, optionally we can pass the size as
well.
So these are the things means they structure related.
These are the things we will define inside migration files.
So let's get this started all about creating a migration file.
So firstly, when we create any migration file, it will go and is to inside this database and migration
filter by default.
When we install a label, set up these three migration files for will get inside this setup.
So when we open any of the migration file, as we can see that it's a glass and inside this glass we
have two methods call up motherhood and down motherhood upma that is going to provide the schema or
we can see the architecture of the will and the down method is going to simply drop that table from
the database.
When we migrate our migration into the database, the migrate come on behind the scene, use this up
method.
But when we run rule, demand means dropping a table so behind the scene don't matter.
Vilborg so let's create a migration file inside that migration file will definitively Sokcho add few
columns and migrate into databases.
So if I open Litsa Ed something called goateed inside this, what I will do will create a student's
table and say this is too unstable.
We will have the column called Name Email Litsa Each and something let's say for an underscore number.
So these are the columns and one more thing listed Jinto.
So these are the columns being to define inside students migration.
So back to terminal, first of all, will define a migration file.
So BHB addition lets meek migration and we create, let's say, Keat on the school students on the school
teeple or simply we will call it as something like this cricket student's table.
Now if I press enter, as we can see that migration heated back to full disclosure.
Go and reload and here we can get the migration file for our students typically.
So by default it provides the EITE column and two timestamp values like created ADD and updated.
And so what we want we want a few columns, let's say for the Naem so deeply and for the name we need
to store the name value into a Vacher field.
So it will be of a string type.
So we need two columns as assignee.
So inside this is string.
Let's pass the name column.
This is the column name and optionally we can pass the length of the field.
So this is 120 characters.
Next we need for the email address.
So if I copy pasting it to email field, let's say it is of eighty characters in length in the next
we each.
So Table eight should be the Intisar value.
So Intisar each.
And this is unsigned.
Now next we want phone number.
So number was also the string value, but in this case it is of twenty characters inland.
And finally we want Ajanta column.
So here instead of a string let's pass enum.
And here inside this email, as you can see that the intelligence is that the first read to pass the
column name solicited Chinta is the column name.
Next we have then.
Inside is a read to pass all available options, so Gentil, if you want something, me female.
Now, if you save all these changes now next, if you want to migrate this migration file into our database,
what we had created inside last for to this is the database.
We have configured that terminal PSP optician and type migrate.
This command is going to run all the pending migrations and migrate into our database.
So if I press enter, as you can see, that aggregate users migrated and here we have some added that
is already accessed, duplicate column name called email.
So I think that inside our students migration, we had actually written two times email address.
So here is the email first and email actually.
This is for Number Swaggy, and if I clear this console, then one more time addition migrate.
And before that, what I will do, simply take all the tables from DBI, go inside who are a drop.
I will drop all the tables inaudible sexist cards on this command so users a will created password resets
field jobs and finally the table.
What we had created call is to dance.
Back to Brazil is a structure, and he, as we can see, that we have a student stable go inside this
structure.
Here are the columns called NI E Mail, each phone number.
And to look at the data, I call Vacher, 120 characters in length, E.T. phone number enumerator with
all possible values and by default, three columns added called EDEK created out and updated at night.
If we want to drop all the tables, what we Catron simply go and type the command called BHB addition
my great galloon and passa flat call rule back behind the scene.
When we had on this command a task actually executed the method of every migration file.
But when we execute this command, partition migrates rule back.
It will go and find the last migrated files and run that down method.
So when we done this, come on, it will search for the latest migration of what we had done.
So these all migrations, what we have migrated.
So it will go inside each of the migration file and run the town method and inside down method.
We have to go on to draw up the table.
So if we go and pressing enter, as we can see that it has rolled back, all the tables go and Lutetia,
this structure and as we can see that we don't have any table knocking if we want to migrate all the
tables again in the same come on called BHP addition migrate.
Is there any command to migrate?
All this is the only come on to roll back first and migrate.
Yes, we have we have the same.
Come on.
Let's say that if we run this migrate, come on.
It has migrated all the tables inside DBRS.
If we go and see here, we have all the tables in some cases.
First we want to drop all the tables and in the next we want to create all the tables.
We want to execute two different commands, but inside a single line.
So simply type B, partition, migrate and Hillsville type called refresh.
If I press enter as we can see that first it has rolled back all the tables and in the second stage
it has migrated all the tables.
So this is all about guys migration, which has provided the table schema for the database.
And as we know that the tables are the storage area will put all data.
So in the next video, we will discuss the concept of Cedar's.
By the help of Setas, we put our dummy data or Feek data for the purpose of testing so far this session.
Guys, thanks for watching and have a great.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.