Skip to content

Commit

Permalink
🐛 Fix migration files
Browse files Browse the repository at this point in the history
  • Loading branch information
nagi1 committed Apr 22, 2021
1 parent bc4fe93 commit febd673
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateLaravelRatingTable extends Migration
class CreateRatingsTable extends Migration
{
public function up()
{
Expand All @@ -18,4 +18,9 @@ public function up()
$table->timestamps();
});
}

public function down()
{
Schema::dropIfExists('ratings');
}
}
4 changes: 2 additions & 2 deletions src/LaravelRatingServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ class LaravelRatingServiceProvider extends ServiceProvider
public function boot()
{
$this->publishes([
__DIR__.'/../database/migrations/create_ratings_table.php' => app()->basePath().'/database/migrations/'.date('Y_m_d_His').'_create_ratings_table.php',
__DIR__.'/../database/migrations/create_ratings_table.php.stub' => app()->basePath().'/database/migrations/'.date('Y_m_d_His', time() + 1).'_create_ratings_table.php',

__DIR__.'/../database/migrations/add_type_column_to_ratings_table.php' => app()->basePath().'/database/migrations/'.date('Y_m_d_His').'_add_type_column_to_ratings_table.php',
__DIR__.'/../database/migrations/add_type_column_to_ratings_table.php.stub' => app()->basePath().'/database/migrations/'.date('Y_m_d_His', time() + 2).'_add_type_column_to_ratings_table.php',
], 'laravelRatings');
}

Expand Down
6 changes: 3 additions & 3 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ public function getEnvironmentSetUp($app)
]);


include_once __DIR__.'/../database/migrations/create_ratings_table.php';
include_once __DIR__.'/../database/migrations/add_type_column_to_ratings_table.php';
include_once __DIR__.'/../database/migrations/create_ratings_table.php.stub';
include_once __DIR__.'/../database/migrations/add_type_column_to_ratings_table.php.stub';
include_once __DIR__.'/database/migrations/create_posts_table.php';
include_once __DIR__.'/database/migrations/create_users_table.php';

(new \CreateLaravelRatingTable())->up();
(new \CreateRatingsTable())->up();
(new \AddTypeColumnToRatingsTable())->up();
(new \CreatePostsTable())->up();
(new \CreateUsersTable())->up();
Expand Down

0 comments on commit febd673

Please sign in to comment.