Answers for "migration laravel when move project"

PHP
0

re migrate laravel

Try:
composer dump-autoload
php artisan config:cache

If not working also try:
php artisan migrate:refresh.
Posted by: Guest on July-02-2020
2

laravel create trigger migration

<?php

use Illuminate\Database\Migrations\Migration;

class CreateTrigger extends Migration
{
    public function up()
    {
        DB::unprepared('
                CREATE TRIGGER tr_after_main_insert AFTER INSERT ON `main` FOR EACH ROW
                    BEGIN
                        INSERT INTO `test`(`new_id`, `type`, `value`, `created_at`) VALUES (NEW.id, NEW.type, 1, NOW());
                    END
                ');
    }

    public function down()
    {
        DB::unprepared('DROP TRIGGER `tr_after_main_insert`');
    }
}
Posted by: Guest on June-23-2021

Code answers related to "migration laravel when move project"

Browse Popular Code Answers by Language