feat(db show): added migrations for timestamps

This commit is contained in:
Michael 2025-03-05 19:42:55 +01:00
parent 0fca506c4c
commit 607c4320d7
4 changed files with 127 additions and 0 deletions

View file

@ -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::table('cc_show', function (Blueprint $table) {
foreach (['created_at', 'updated_at'] as $column) {
if (!Schema::hasColumn('cc_show', $column)) {
$table->timestamp($column)->nullable();
}
}
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('cc_show', function (Blueprint $table) {
});
}
};

View file

@ -0,0 +1,32 @@
<?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::table('cc_show_days', function (Blueprint $table) {
foreach (['created_at', 'updated_at'] as $column) {
if (!Schema::hasColumn('cc_show_days', $column)) {
$table->timestamp($column)->nullable();
}
}
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('cc_show_days', function (Blueprint $table) {
//
});
}
};

View file

@ -0,0 +1,32 @@
<?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::table('cc_show_hosts', function (Blueprint $table) {
foreach (['created_at', 'updated_at'] as $column) {
if (!Schema::hasColumn('cc_show_hosts', $column)) {
$table->timestamp($column)->nullable();
}
}
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('cc_show_hosts', function (Blueprint $table) {
//
});
}
};

View file

@ -0,0 +1,32 @@
<?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::table('cc_show_instances', function (Blueprint $table) {
foreach (['created_at', 'updated_at'] as $column) {
if (!Schema::hasColumn('cc_show_instances', $column)) {
$table->timestamp($column)->nullable();
}
}
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('cc_show_instances', function (Blueprint $table) {
//
});
}
};