37 lines
664 B
PHP
Executable File
37 lines
664 B
PHP
Executable File
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class MigrationDataset extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'source_id',
|
|
'key',
|
|
'title',
|
|
'state',
|
|
'schema',
|
|
'records_count',
|
|
'meta'
|
|
];
|
|
|
|
protected $casts = [
|
|
'schema' => 'array',
|
|
'meta' => 'array',
|
|
];
|
|
|
|
public function source()
|
|
{
|
|
return $this->belongsTo(MigrationSource::class, 'source_id');
|
|
}
|
|
|
|
public function records()
|
|
{
|
|
return $this->hasMany(MigrationRecord::class, 'dataset_id');
|
|
}
|
|
}
|