user897237
user897237

Reputation: 621

How can I create migration from existing database?

How can I create migration from existing database? I wanted to do this with Xerton. I try do execute:

php artisan make:migration

But I'm getting this error:

Not enough arguments (missing: "name").

Is it possible to migrate the existing database at once? Without having to migrate the tables separately?

Upvotes: 0

Views: 3798

Answers (3)

user10286245
user10286245

Reputation:

When you create a migration you have to specify the name of the migration like this :

php artisan make:migration create_users_table
php artisan make:migration add_votes_to_users_table

With Xerton :

Run php artisan migrate:generate to create migrations for all the table

Upvotes: 2

Nebster
Nebster

Reputation: 914

According to Xerton documentation you have to use php artisan migrate:generate command to generate migrations from existing database.

php artisan make:migration [name] is used to create new migration.

Upvotes: 0

dparoli
dparoli

Reputation: 9171

After you've correctly installed Xethron you could run this commands:

php artisan migrate:generate // to create migrations for all the tables
php artisan migrate:generate table1,table2,table3,table4,table5 // for specific tables

Upvotes: 1

Related Questions