Laravel-4-Generators icon indicating copy to clipboard operation
Laravel-4-Generators copied to clipboard

DB Migration not generated correctly.

Open gh4dp opened this issue 10 years ago • 3 comments

The following code is generated on the latest code of generators - i.e: "way/generators": "*" in my composer.json.

php artisan generate:scaffold --fields="sermon_id:integer,author_id:integer,album_id:integer,scheduleddate:date,description:string[80]" sermonmediae

As you can see the up() function really is not correct table generation script. I tried to fix this for last few tables but am tired of manually fixing this.

What causes this? How to fix this?

increments('id'); $table->integer,author_id('sermon_id')->integer,album_id()->integer,scheduleddate()->date,description()->string[80](); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::drop('sermonmediaes'); } ``` }

gh4dp avatar May 14 '14 19:05 gh4dp

Try adding a space after the comma, like this :

artisan generate:scaffold create_sermon_mediaes_table --fields="sermon_id:integer, author_id:integer, album_id:integer, scheduleddate:date, description:string[80]"

foxted avatar May 15 '14 06:05 foxted

Daniel - Correct, it will not work as it's generated. My question is, why it's generated this way? The answer is what Jeffery suggested.

Jeffery, Thanks a million! I still don't know why that formgeneration was removed and replaced by simple one liner like "views/create_sermon_mediaes_tables/create.blade.php" , but there has to be a good reason, just I dont get it for now.

In fact, I'm still a beginner and the only thing that helped me choose laravel over other was laravel-4-generators, which was building form upon scaffolding.

Thanks again, -dp

On Thu, May 15, 2014 at 2:35 AM, Valentin PRUGNAUD <[email protected]

wrote:

Try adding a space after the comma, like this :

artisan generate:migration create_sermon_mediaes_table --fields="sermon_id:integer, author_id:integer, album_id:integer, scheduleddate:date, description:string[80]"

— Reply to this email directly or view it on GitHubhttps://github.com/JeffreyWay/Laravel-4-Generators/issues/326#issuecomment-43173619 .

gh4dp avatar May 15 '14 13:05 gh4dp

Yes.... Jeffery, Laravel4 Generator with scaffolding is one of the reason I started struggling with Laravel over other framework.. namely Codeignitor. I wish it will come back same as before.

Thanks Jeff, I am learning slowly with laracast.

Zaheen

zaheen avatar May 15 '14 14:05 zaheen