Skip to content

Commit 8e0f3ba

Browse files
committed
Add Nova migrations
1 parent 095dcf0 commit 8e0f3ba

File tree

4 files changed

+79
-0
lines changed

4 files changed

+79
-0
lines changed

tests/database/baseline.sqlite

36 KB
Binary file not shown.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
class CreateActionEventsTable extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*
12+
* @return void
13+
*/
14+
public function up()
15+
{
16+
Schema::create('action_events', function (Blueprint $table) {
17+
$table->id();
18+
$table->char('batch_id', 36);
19+
$table->unsignedBigInteger('user_id')->index();
20+
$table->string('name');
21+
$table->string('actionable_type');
22+
$table->unsignedBigInteger('actionable_id');
23+
$table->string('target_type');
24+
$table->unsignedBigInteger('target_id');
25+
$table->string('model_type');
26+
$table->unsignedBigInteger('model_id')->nullable();
27+
$table->text('fields');
28+
$table->string('status', 25)->default('running');
29+
$table->text('exception');
30+
$table->timestamps();
31+
32+
$table->index(['actionable_type', 'actionable_id']);
33+
$table->index(['batch_id', 'model_type', 'model_id']);
34+
});
35+
}
36+
37+
/**
38+
* Reverse the migrations.
39+
*
40+
* @return void
41+
*/
42+
public function down()
43+
{
44+
Schema::dropIfExists('action_events');
45+
}
46+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
class AddFieldsToActionEventsTable extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*
12+
* @return void
13+
*/
14+
public function up()
15+
{
16+
Schema::table('action_events', function (Blueprint $table) {
17+
$table->text('original')->nullable();
18+
$table->text('changes')->nullable();
19+
});
20+
}
21+
22+
/**
23+
* Reverse the migrations.
24+
*
25+
* @return void
26+
*/
27+
public function down()
28+
{
29+
Schema::table('action_events', function (Blueprint $table) {
30+
$table->dropColumn('original', 'changes');
31+
});
32+
}
33+
}

tests/database/testing.sqlite

36 KB
Binary file not shown.

0 commit comments

Comments
 (0)