Migrations and seeds
This commit is contained in:
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
use Phinx\Seed\AbstractSeed;
|
||||
|
||||
class ProyectoTerrenoSeeder extends AbstractSeed
|
||||
{
|
||||
public function run(): void
|
||||
{
|
||||
$data = [
|
||||
[
|
||||
'id' => 1,
|
||||
'proyecto_id' => 8,
|
||||
'fecha' => '2022-12-31',
|
||||
'valor' => 1445406733,
|
||||
'tipo_moneda_id' => 2,
|
||||
],
|
||||
[
|
||||
'id' => 2,
|
||||
'proyecto_id' => 8,
|
||||
'fecha' => '2023-12-31',
|
||||
'valor' => 1502468086,
|
||||
'tipo_moneda_id' => 2,
|
||||
],
|
||||
[
|
||||
'id' => 3,
|
||||
'proyecto_id' => 6,
|
||||
'fecha' => '2023-12-31',
|
||||
'valor' => 2419867414,
|
||||
'tipo_moneda_id' => 2,
|
||||
],
|
||||
[
|
||||
'id' => 4,
|
||||
'proyecto_id' => 3,
|
||||
'fecha' => '2023-11-30',
|
||||
'valor' => 799188860,
|
||||
'tipo_moneda_id' => 1,
|
||||
],
|
||||
];
|
||||
|
||||
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
|
||||
$this->table('proyecto_terreno')
|
||||
->insert($data)
|
||||
->saveData();
|
||||
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user