Drop foreign key to existing table are easy as creating a foreign key and adding columns to it. In laravel migration we can drop foreign key in laravel migration to existing table using dropForeign method of migration class. Major difference between creating new table and updating new table is Schema::create…
Tag: migration
How to Add or Update Index in Laravel Migration?
Add or Update Index in Laravel Migration can be implement easily using the migrations libraries index method. Migrations provides almost all feature to create the database schema and create and update index in laravel migration. As We know database index is used to improve the speed of tables. Index can…
How to Create Relations in Laravel Migration?
Laravel relation provides almost all feature to create the database schema and one of best feature is create relations in laravel migration. As We know relations are used to create the associations between the tables and there is three types of relations in mysql which is one-to-one, one-to-many, and many-to-many….
How to Set Default Null Value in Laravel Migration?
To set default null value in laravel migration we use nullable method of schema class. As we learnt about How to Add Default Value to Column in Laravel Migration? in our last article but sometimes we want to set null value to column instead of any number or string. Null…
How to Add Default Value to Column in Laravel Migration?
Default value to column is useful when we want to auto fill the default defined value of column during insertion of other values of table So In our this article i will show you to add default value to column in laravel migration. We can add any type of data…
How to Update Enum Field Value using Laravel Migration ?
Sometime after add the values in enum field we wanted to Update Enum Field Value using Laravel Migration so that we can work according to requirements. In our last article How to Create Enum Field in Laravel Migration ? we learnt to create the enum and today we are give…
How to Create Enum Field in Laravel Migration ?
In laravel while creating table schema for some columns we want to add column type enum field so in this article we will create Enum Field in Laravel Migration. We can easily add enum column as we add other varchar integer etc columns in laravel. Enum is useful when we…
How to Rollback Migration Laravel ?
In our recent article I showed you about creating migration in laravel and sometimes after creating migration we want to rollback migration laravel so in this article i will show you to rollback migration in laravel. Laravel artisan have multiple options to rollback the migration like we can rollback all…
How to rollback specific migration in laravel ?
In this article we will learn rollback specific migration in laravel, in our recent article i wrote about creating migration in laravel and sometimes after creating migration we want to rollback specific migration laravel so in this article i will show you to rollback a specific migration in laravel. Laravel…
How to change data type of column in laravel migration ?
In this blog post we will learn to change data type of column in laravel migration. Laravel covers most of the migration features like add, delete, indexing etc. but to modify the table like renaming column, change data type column to existing table laravel uses a separate package doctrine/dbal. In…