first commit
This commit is contained in:
35
app/Models/Index.php
Normal file
35
app/Models/Index.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class Index extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'indexes';
|
||||
|
||||
protected $fillable = [
|
||||
'table_id',
|
||||
'index_name',
|
||||
'columns',
|
||||
'is_unique',
|
||||
'is_primary',
|
||||
'index_type',
|
||||
'definition',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'columns' => 'array',
|
||||
'is_unique' => 'boolean',
|
||||
'is_primary' => 'boolean',
|
||||
];
|
||||
|
||||
public function table(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Table::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user