This repository was archived by the owner on Jun 1, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +17
-10
lines changed
Expand file tree Collapse file tree 3 files changed +17
-10
lines changed Original file line number Diff line number Diff line change 66 - 5.6
77 - hhvm
88 - 7
9-
10- matrix:
11- allow_failures:
12- - php: 7
139
1410before_script:
1511 - travis_retry composer self-update
Original file line number Diff line number Diff line change 22
33All Notable changes to `activitylog` will be documented in this file
44
5+ ### 2.4.2 - 2016-03-23
6+ - Make sure the migrations are not published twice
7+
58### 2.4.1
69- Added `userModel` configuration
710
Original file line number Diff line number Diff line change @@ -20,17 +20,15 @@ public function boot()
2020 {
2121 // Publish a config file
2222 $this->publishes([
23- __DIR__. '/../../config/activitylog.php' => config_path('activitylog.php'),
23+ __DIR__ . '/../../config/activitylog.php' => config_path('activitylog.php'),
2424 ], 'config');
2525
26- $files = glob(database_path('/migrations/*_create_activity_log_table.php'));
27-
28- if (! $files) {
29- // Publish your migrations
26+ if (!$this->migrationHasAlreadyBeenPublished()) {
27+ // Publish migration
3028 $timestamp = date('Y_m_d_His', time());
3129
3230 $this->publishes([
33- __DIR__.' /../../migrations/create_activity_log_table.stub' => database_path(' /migrations/'. $timestamp.' _create_activity_log_table.php' ),
31+ __DIR__ . " /../../migrations/create_activity_log_table.stub" => database_path(" /migrations/{ $timestamp} _create_activity_log_table.php" ),
3432 ], 'migrations');
3533 }
3634 }
@@ -60,4 +58,14 @@ public function provides()
6058 {
6159 return [];
6260 }
61+
62+ /**
63+ * @return bool
64+ */
65+ protected function migrationHasAlreadyBeenPublished()
66+ {
67+ $files = glob(database_path('/migrations/*_create_activity_log_table.php'));
68+
69+ return count($files) > 0;
70+ }
6371}
You can’t perform that action at this time.
0 commit comments