Вход Регистрация
Файл: database/upgrades/2026_05_18_000001_remove_contacts_and_ignores.php
Строк: 50
<?php

declare(strict_types=1);

use 
IlluminateDatabaseMigrationsMigration;
use 
IlluminateDatabaseSchemaBlueprint;
use 
IlluminateSupportFacadesDB;
use 
IlluminateSupportFacadesSchema;

return new class extends 
Migration {
    public function 
up(): void
    
{
        
Schema::dropIfExists('contacts');
        
Schema::dropIfExists('ignores');

        
DB::table('settings')
            ->
whereIn('name', ['contactlist''ignorlist''limitcontact''limitignore'])
            ->
delete();

        
DB::table('notices')
            ->
whereIn('type', ['contact''ignore'])
            ->
delete();
    }

    public function 
down(): void
    
{
        
Schema::create('contacts', static function (Blueprint $table) {
            
$table->id();
            
$table->unsignedBigInteger('user_id');
            
$table->unsignedBigInteger('to_user_id');
            
$table->timestamps();
        });

        
Schema::create('ignores', static function (Blueprint $table) {
            
$table->id();
            
$table->unsignedBigInteger('user_id');
            
$table->unsignedBigInteger('to_user_id');
            
$table->timestamps();
        });
    }
};
Онлайн: 1
Реклама