Laravel Delete Migration

Today, We want to share with you Laravel Delete Migration.In this post we will show you wordpress plugin require another plugin, hear for laravel 6 migration we will give you demo and example for implement.In this post, we will learn about how to delete migration and model in laravel with an example.

Laravel Delete Migration

There are the Following The simple About laravel create migration and model Full Information With Example and source code.

As I will cover this Post with live Working example to develop Laravel – How to remove foreign key constraint using migration?, so the Adding & Removing column from existing database in Laravel usign migration is used for this example is following below.

READ :  jQuery Multidimensional Array name selector

How to delete a migration file in Laravel?

Phase 1:first of all simple create a Delete the migration file from app/database/migrations/ directory.

Phase 2:and then simple Run composer dump-autoload command to reset your autoload files.

Phase 3:after that you can Run migrate:rollback terminal to fire command to rollback the MySQL migration table from database.

Safely remove migration In Laravel

E-junkie: Sell digital downloads online

E-junkie Provides a Copy-paste buy-now, and cart buttons for selling downloads, codes and tangible products on any website, blog, social media, email and messenger!

Also see:

  1. The Top 10+ Best Webinar Software Platforms For 2020-2021
  2. Build Your Future Godaddy Careers And Jobs
  3. Introduction To Web Hosting Services

first of all Manually delete the migration file like path as a:

app/database/migrations/your_date_with_time_migration_file_name.php

and then Reset the composer autoload files: composer dump-autoload

Laravel – How to remove foreign key constraint using migration?

Wrong Column Migration:

Schema::create('products', function (Blueprint $table) {
    $table->increments('id');
    $table->string('product_name');
    $table->string('product_code')->unique();
    $table->string('product_varints_img_path');
    $table->string('sku', 60);
    $table->integer('product_id')->unsigned();
    $table->foreign('product_id')->references('id')->on('products')->onDelete('cascade');
    $table->timestamps();
});

Drop Column Migration:

Schema::table('products', function (Blueprint $table) {
    $table->dropForeign('user_product_id_foreign');
    $table->dropColumn('product_id');
});

Web Programming Tutorials Example with Demo

Read :

READ :  AngularJS Form submission and Retrieve All Inputs Values using PHP

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about laravel migration change column type.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.