update
This commit is contained in:
+33
@@ -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
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
|
||||
Schema::table('bio_specimens', function (Blueprint $table) {
|
||||
if (!Schema::hasColumn('bio_specimens', 'atcc')) {
|
||||
$table->string('atcc', 150)->nullable()->after('strain');
|
||||
}
|
||||
if (!Schema::hasColumn('bio_specimens', 'sampleid')) {
|
||||
$table->string('sampleid', 150)->nullable()->after('atcc');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('bio_specimens', function (Blueprint $table) {
|
||||
if (Schema::hasColumn('bio_specimens', 'atcc')) {
|
||||
$table->dropColumn('atcc');
|
||||
}
|
||||
if (Schema::hasColumn('bio_specimens', 'sampleid')) {
|
||||
$table->dropColumn('sampleid');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user