Normalise tagline/tearline/origin
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 39s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 1m51s
Create Docker Image / Final Docker Image Manifest (push) Successful in 10s

This commit is contained in:
2024-06-03 19:08:40 +10:00
parent 1d354da6e3
commit 8fb3a21fcd
29 changed files with 313 additions and 88 deletions

View File

@@ -0,0 +1,81 @@
<?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('taglines', function (Blueprint $table) {
$table->id();
$table->timestamp('created_at');
$table->softDeletes();
$table->string('value')->unique();
});
Schema::create('tearlines', function (Blueprint $table) {
$table->id();
$table->timestamp('created_at');
$table->softDeletes();
$table->string('value')->unique();
});
Schema::create('origins', function (Blueprint $table) {
$table->id();
$table->timestamp('created_at');
$table->softDeletes();
$table->string('value')->unique();
});
Schema::table('echomails', function (Blueprint $table) {
$table->bigInteger('tagline_id')->nullable();
$table->foreign('tagline_id')->references('id')->on('taglines');
$table->bigInteger('tearline_id')->nullable();
$table->foreign('tearline_id')->references('id')->on('tearlines');
$table->bigInteger('origin_id')->nullable();
$table->foreign('origin_id')->references('id')->on('origins');
});
Schema::table('netmails', function (Blueprint $table) {
$table->bigInteger('tagline_id')->nullable();
$table->foreign('tagline_id')->references('id')->on('taglines');
$table->bigInteger('tearline_id')->nullable();
$table->foreign('tearline_id')->references('id')->on('tearlines');
$table->bigInteger('origin_id')->nullable();
$table->foreign('origin_id')->references('id')->on('origins');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('netmails', function (Blueprint $table) {
$table->dropForeign(['tagline_id']);
$table->dropForeign(['tearline_id']);
$table->dropForeign(['origin_id']);
$table->dropColumn(['tagline_id','tearline_id','origin_id']);
});
Schema::table('echomails', function (Blueprint $table) {
$table->dropForeign(['tagline_id']);
$table->dropForeign(['tearline_id']);
$table->dropForeign(['origin_id']);
$table->dropColumn(['tagline_id','tearline_id','origin_id']);
});
Schema::dropIfExists('origins');
Schema::dropIfExists('tearlines');
Schema::dropIfExists('taglines');
}
};