Integrate Mailer::class into System_Log::class, removed Zmodem Server/Client
This commit is contained in:
46
database/migrations/2023_12_10_143252_fix_mailer_id.php
Normal file
46
database/migrations/2023_12_10_143252_fix_mailer_id.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?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('system_logs',function (Blueprint $table) {
|
||||
$table->bigInteger('mailer_id')->nullable()->after('system_id');
|
||||
$table->foreign('mailer_id')->references('id')->on('mailers');
|
||||
});
|
||||
|
||||
DB::update('UPDATE system_logs SET mailer_id=? WHERE sessiontype=?',[1,2]);
|
||||
DB::update('UPDATE system_logs SET mailer_id=? WHERE sessiontype=?',[2,0]);
|
||||
DB::update('ALTER TABLE system_logs ALTER COLUMN mailer_id SET NOT NULL');
|
||||
|
||||
Schema::table('system_logs',function (Blueprint $table) {
|
||||
$table->dropColumn(['sessiontype']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('system_logs',function (Blueprint $table) {
|
||||
$table->integer('sessiontype')->nullable();
|
||||
});
|
||||
|
||||
DB::update('UPDATE system_logs SET sessiontype=? WHERE mailer_id=?',[0,2]);
|
||||
DB::update('UPDATE system_logs SET sessiontype=? WHERE mailer_id=?',[2,1]);
|
||||
DB::update('ALTER TABLE system_logs ALTER COLUMN sessiontype SET NOT NULL');
|
||||
|
||||
Schema::table('system_logs',function (Blueprint $table) {
|
||||
$table->dropForeign(['mailer_id']);
|
||||
$table->dropColumn(['mailer_id']);
|
||||
});
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user