-
Notifications
You must be signed in to change notification settings - Fork 281
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
09fc6c5
commit 2d82549
Showing
12 changed files
with
282 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
models: | ||
Journey: | ||
uuid | ||
name: string | ||
relationships: | ||
belongsToMany: Diary | ||
Diary: | ||
uuid | ||
relationships: | ||
belongsToMany: Journey |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ models: | |
name: string | ||
user_id: id | ||
relationships: | ||
belongstoMany: Diary | ||
belongsToMany: Diary |
31 changes: 31 additions & 0 deletions
31
tests/fixtures/migrations/belongs-to-many-key-constraints-using-ulid-columns-diary-model.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
*/ | ||
public function up(): void | ||
{ | ||
Schema::disableForeignKeyConstraints(); | ||
|
||
Schema::create('diaries', function (Blueprint $table) { | ||
$table->ulid('id')->primary(); | ||
$table->timestamps(); | ||
}); | ||
|
||
Schema::enableForeignKeyConstraints(); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
*/ | ||
public function down(): void | ||
{ | ||
Schema::dropIfExists('diaries'); | ||
} | ||
}; |
33 changes: 33 additions & 0 deletions
33
.../fixtures/migrations/belongs-to-many-key-constraints-using-ulid-columns-journey-model.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
*/ | ||
public function up(): void | ||
{ | ||
Schema::disableForeignKeyConstraints(); | ||
|
||
Schema::create('journeys', function (Blueprint $table) { | ||
$table->ulid('id')->primary(); | ||
$table->string('name'); | ||
$table->foreignUlid('user_id')->constrained()->cascadeOnDelete()->cascadeOnUpdate(); | ||
$table->timestamps(); | ||
}); | ||
|
||
Schema::enableForeignKeyConstraints(); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
*/ | ||
public function down(): void | ||
{ | ||
Schema::dropIfExists('journeys'); | ||
} | ||
}; |
31 changes: 31 additions & 0 deletions
31
tests/fixtures/migrations/belongs-to-many-key-constraints-using-uuid-columns-diary-model.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
*/ | ||
public function up(): void | ||
{ | ||
Schema::disableForeignKeyConstraints(); | ||
|
||
Schema::create('diaries', function (Blueprint $table) { | ||
$table->uuid('id')->primary(); | ||
$table->timestamps(); | ||
}); | ||
|
||
Schema::enableForeignKeyConstraints(); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
*/ | ||
public function down(): void | ||
{ | ||
Schema::dropIfExists('diaries'); | ||
} | ||
}; |
28 changes: 28 additions & 0 deletions
28
.../fixtures/migrations/belongs-to-many-key-constraints-using-uuid-columns-journey-model.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
*/ | ||
public function up(): void | ||
{ | ||
Schema::create('journeys', function (Blueprint $table) { | ||
$table->uuid('id')->primary(); | ||
$table->string('name'); | ||
$table->timestamps(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
*/ | ||
public function down(): void | ||
{ | ||
Schema::dropIfExists('journeys'); | ||
} | ||
}; |
31 changes: 31 additions & 0 deletions
31
tests/fixtures/migrations/belongs-to-many-pivot-key-constraints-using-ulid-columns.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
*/ | ||
public function up(): void | ||
{ | ||
Schema::disableForeignKeyConstraints(); | ||
|
||
Schema::create('diary_journey', function (Blueprint $table) { | ||
$table->foreignUlid('diary_id')->constrained()->cascadeOnDelete()->cascadeOnUpdate(); | ||
$table->foreignUlid('journey_id')->constrained()->cascadeOnDelete()->cascadeOnUpdate(); | ||
}); | ||
|
||
Schema::enableForeignKeyConstraints(); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
*/ | ||
public function down(): void | ||
{ | ||
Schema::dropIfExists('diary_journey'); | ||
} | ||
}; |
31 changes: 31 additions & 0 deletions
31
tests/fixtures/migrations/belongs-to-many-pivot-key-constraints-using-uuid-columns.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
*/ | ||
public function up(): void | ||
{ | ||
Schema::disableForeignKeyConstraints(); | ||
|
||
Schema::create('diary_journey', function (Blueprint $table) { | ||
$table->foreignUuid('diary_id')->constrained()->cascadeOnDelete()->cascadeOnUpdate(); | ||
$table->foreignUuid('journey_id')->constrained()->cascadeOnDelete()->cascadeOnUpdate(); | ||
}); | ||
|
||
Schema::enableForeignKeyConstraints(); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
*/ | ||
public function down(): void | ||
{ | ||
Schema::dropIfExists('diary_journey'); | ||
} | ||
}; |