Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove incremental id from table #32

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ composer.lock
/phpunit.xml
.phpunit.result.cache
.php_cs.cache
/.idea
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ final class CreateDomainMessagesTable extends Migration
public function up()
{
Schema::create('domain_messages', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('event_id', 36);
$table->uuid('event_id')->primary();
$table->string('event_type', 100);
$table->string('event_stream', 36)->index();
$table->dateTime('recorded_at', 6)->index();
Expand Down
3 changes: 1 addition & 2 deletions src/Console/stubs/create_domain_messages_table.php.stub
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ class {{ migration }} extends Migration
public function up()
{
Schema::create('{{ table }}', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('event_id', 36);
$table->uuid('event_id')->primary();
$table->string('event_type', 100);
$table->string('event_stream', 36)->index();
$table->dateTime('recorded_at', 6)->index();
Expand Down
6 changes: 1 addition & 5 deletions tests/AggregateRootRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ protected function setUp(): void
parent::setUp();

Schema::create('event_store', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('event_id', 36);
$table->uuid('event_id')->primary();
$table->string('event_type', 100);
$table->string('event_stream', 36)->nullable()->index();
$table->dateTime('recorded_at', 6)->index();
Expand Down Expand Up @@ -75,7 +74,6 @@ public function it_can_persist_an_aggregate()
$this->persistAggregate(RegistrationAggregateRootRepository::class);

$this->assertDatabaseHas('domain_messages', [
'id' => 1,
'event_type' => 'tests.fixtures.user_was_registered',
]);
}
Expand Down Expand Up @@ -121,7 +119,6 @@ public function it_can_have_a_custom_connection()
$this->persistAggregate(RepositoryWithCustomConnection::class);

$this->assertDatabaseHas('domain_messages', [
'id' => 1,
'event_type' => 'tests.fixtures.user_was_registered',
], $connection);
}
Expand All @@ -132,7 +129,6 @@ public function it_can_have_a_custom_table()
$this->persistAggregate(RepositoryWithCustomTable::class);

$this->assertDatabaseHas('event_store', [
'id' => 1,
'event_type' => 'tests.fixtures.user_was_registered',
]);
}
Expand Down
1 change: 0 additions & 1 deletion tests/LaravelMessageRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public function it_can_persists_messages()
$this->repository->persist($message);

$this->assertDatabaseHas('domain_messages', [
'id' => 1,
'event_type' => 'tests.fixtures.user_was_registered',
]);
}
Expand Down