diff --git a/src/commands/MigrationCommand.php b/src/commands/MigrationCommand.php index 6d22f1e..b3057d6 100644 --- a/src/commands/MigrationCommand.php +++ b/src/commands/MigrationCommand.php @@ -31,7 +31,7 @@ public function __construct() $app = app(); $app['view']->addNamespace('countries',substr(__DIR__,0,-8).'views'); } - + /** * Execute the console command. * @@ -112,7 +112,8 @@ protected function createMigration() } //Create the seeder - $seeder_file = $this->laravel->path."/../database/seeds/CountriesSeeder.php"; + $seederPath = is_dir(database_path('seeds')) ? database_path('seeds') : database_path('seeders'); + $seeder_file = $seederPath."/CountriesSeeder.php"; $output = "make('countries::generators.seeder')->render(); if (!file_exists( $seeder_file )) { @@ -127,7 +128,7 @@ protected function createMigration() return true; } - + /** * BC for older laravel versions */ diff --git a/src/views/generators/migration.blade.php b/src/views/generators/migration.blade.php index c0b1b65..67ea6b2 100644 --- a/src/views/generators/migration.blade.php +++ b/src/views/generators/migration.blade.php @@ -12,15 +12,15 @@ public function up() // Creates the users table Schema::create(\Config::get('countries.table_name'), function($table) { - $table->integer('id')->unsigned()->index(); + $table->unsignedBigInteger('id')->index(); $table->string('capital', 255)->nullable(); $table->string('citizenship', 255)->nullable(); $table->string('country_code', 3)->default(''); $table->string('currency', 255)->nullable(); $table->string('currency_code', 255)->nullable(); $table->string('currency_sub_unit', 255)->nullable(); - $table->string('currency_symbol', 3)->nullable(); - $table->integer('currency_decimals')->nullable(); + $table->string('currency_symbol', 3)->nullable(); + $table->integer('currency_decimals')->nullable(); $table->string('full_name', 255)->nullable(); $table->string('iso_3166_2', 2)->default(''); $table->string('iso_3166_3', 3)->default('');