Support the ongoing development of Laravel.io →
posted 6 years ago
Last updated 2 years ago.
0
php artisan make:migration table_name_here

Only generates the migration file/class and its stubbed methods up()/down(). You need to code out your schema.

https://laravel.com/docs/5.4/migrations#migration-structure


    public function up()
    {
        Schema::create('companies', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name');
            $table->timestamps();

        });
    }

When your schema is done within the up() method, you can then run the migration with

php artisan migrate

0

Migration only creates the Migration Class. You need to create the schema by yourself in the up function. It's easy. You can get a sample schema from the documentation.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.