File tree Expand file tree Collapse file tree 2 files changed +45
-3
lines changed Expand file tree Collapse file tree 2 files changed +45
-3
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ use Illuminate\Database\Migrations\Migration;
4
+ use Illuminate\Database\Schema\Blueprint;
5
+ use Illuminate\Support\Facades\Schema;
6
+
7
+ return new class extends Migration
8
+ {
9
+ /**
10
+ * Run the migrations.
11
+ */
12
+ public function up(): void
13
+ {
14
+ Schema::table('wallets_logs', function (Blueprint $table) {
15
+ if (!Schema::hasColumn('wallets_logs', 'detail')) {
16
+ $table->string('detail')->nullable()->after('status');
17
+ }
18
+ if (!Schema::hasColumn('wallets_logs', 'reference')) {
19
+ $table->string('reference')->nullable()->after('ip');
20
+ }
21
+ });
22
+ }
23
+
24
+ /**
25
+ * Reverse the migrations.
26
+ */
27
+ public function down(): void
28
+ {
29
+ Schema::table('wallets_logs', function (Blueprint $table) {
30
+ if (Schema::hasColumn('wallets_logs', 'detail')) {
31
+ $table->dropColumn('detail');
32
+ }
33
+ if (Schema::hasColumn('wallets_logs', 'reference')) {
34
+ $table->dropColumn('reference');
35
+ }
36
+ });
37
+ }
38
+ };
Original file line number Diff line number Diff line change @@ -18,13 +18,17 @@ public function configurePackage(Package $package): void
18
18
->name ('laravel-pay-pocket ' )
19
19
->hasConfigFile ()
20
20
->hasViews ()
21
- ->hasMigrations ('create_wallets_logs_table ' , 'create_wallets_table ' );
21
+ ->hasMigrations (
22
+ 'create_wallets_logs_table ' ,
23
+ 'create_wallets_table ' ,
24
+ 'update_wallets_logs_table '
25
+ );
22
26
}
23
27
24
28
public function bootingPackage ()
25
29
{
26
30
$ this ->publishes ([
27
- __DIR__ . '/../Enums/ ' => app_path ('Enums ' ),
31
+ __DIR__ . '/../Enums/ ' => app_path ('Enums ' ),
28
32
], 'pay-pocket-wallets ' );
29
33
}
30
- }
34
+ }
You can’t perform that action at this time.
0 commit comments