jeudi 4 août 2016

Laravel 5.1 - make migrations not making any tables in the MySQL

I am not seeing any tables apart from Users table created in MySQL DB while using Laravel migrations. I have followed the steps given below

Laravel version : 5.1

1) set timezone to Asia/Kolkata 2) Added following files into Apps/Model

<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCardsTable  extends Migration
{

public function up()
{

     Schema::create('cards', function(Blueprint $table){
        $table->increments('id');
        $table->integer('user_id')->unsigned();
        $table->string('pin', 10); 
        $table->string('location',256);
        $table->datetime('daterequested');
        $table->datetime('datefulfilled');
        $table->integer('hitcount');
        $table->integer('fulfilledby');
        $table->timestamps();
        $table->softDeletes();
        $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');

});



}
public function down()
{
    Schema::drop('Cards');

}
}

3) Ran the command

php artisan make:migration create_cards_table

It displayed the message 'Created migration'

4) Ran the command php artisan migrate

5) No table is created in MySQL.

FYI, The only db configuration i made is in .env file . I haven't added anything to database.php in config directory (even though i edited username other db related information in the mysql array to match my own credentials)

Please let me know what am i doing wrong here.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire