first commit

This commit is contained in:
brusnitsyn
2026-03-23 00:51:38 +09:00
commit 07854e0a9d
110 changed files with 19528 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class SchemaChange extends Model
{
use HasFactory;
protected $fillable = [
'table_id',
'change_type',
'old_value',
'new_value',
'description',
'is_applied',
'detected_at',
];
protected $casts = [
'old_value' => 'array',
'new_value' => 'array',
'is_applied' => 'boolean',
'detected_at' => 'datetime',
];
public function table(): BelongsTo
{
return $this->belongsTo(Table::class);
}
public function scopePending($query)
{
return $query->where('is_applied', false);
}
public function scopeApplied($query)
{
return $query->where('is_applied', true);
}
}