Compare commits
4 Commits
0e7d7200b6
...
5f4f5d1501
Author | SHA1 | Date | |
---|---|---|---|
5f4f5d1501 | |||
91cc28e681 | |||
ef01ab3c55 | |||
e41ffd505b |
@ -21,7 +21,7 @@ final class Categoria extends AbstractMigration
|
||||
$this->table('categorias')
|
||||
->addColumn('nombre', 'string')
|
||||
->addColumn('tipo_id', 'integer')
|
||||
->addForeignKey('tipo_id', 'tipos_categoria')
|
||||
->addForeignKey('tipo_id', 'tipos_categoria', ['delete' => 'cascade', 'update' => 'cascade'])
|
||||
->create();
|
||||
}
|
||||
}
|
||||
|
@ -21,9 +21,9 @@ final class Cuenta extends AbstractMigration
|
||||
$this->table('cuentas')
|
||||
->addColumn('nombre', 'string')
|
||||
->addColumn('categoria_id', 'integer')
|
||||
->addForeignKey('categoria_id', 'categorias')
|
||||
->addForeignKey('categoria_id', 'categorias', ['delete' => 'cascade', 'update' => 'cascade'])
|
||||
->addColumn('tipo_id', 'integer')
|
||||
->addForeignKey('tipo_id', 'tipos_cuenta')
|
||||
->addForeignKey('tipo_id', 'tipos_cuenta', ['delete' => 'cascade', 'update' => 'cascade'])
|
||||
->create();
|
||||
}
|
||||
}
|
||||
|
@ -20,10 +20,10 @@ final class EstadoConeccion extends AbstractMigration
|
||||
{
|
||||
$this->table('estados_coneccion')
|
||||
->addColumn('coneccion_id', 'integer')
|
||||
->addForeignKey('coneccion_id', 'conecciones')
|
||||
->addForeignKey('coneccion_id', 'conecciones', ['delete' => 'cascade', 'update' => 'cascade'])
|
||||
->addColumn('fecha', 'date')
|
||||
->addColumn('tipo_id', 'integer')
|
||||
->addForeignKey('tipo_id', 'tipos_estado_coneccion')
|
||||
->addForeignKey('tipo_id', 'tipos_estado_coneccion', ['delete' => 'cascade', 'update' => 'cascade'])
|
||||
->create();
|
||||
}
|
||||
}
|
||||
|
@ -20,9 +20,9 @@ final class Transaccion extends AbstractMigration
|
||||
{
|
||||
$this->table('transacciones')
|
||||
->addColumn('debito_id', 'integer')
|
||||
->addForeignKey('debito_id', 'cuentas')
|
||||
->addForeignKey('debito_id', 'cuentas', ['delete' => 'cascade', 'update' => 'cascade'])
|
||||
->addColumn('credito_id', 'integer')
|
||||
->addForeignKey('credito_id', 'cuentas')
|
||||
->addForeignKey('credito_id', 'cuentas', ['delete' => 'cascade', 'update' => 'cascade'])
|
||||
->addColumn('fecha', 'datetime')
|
||||
->addColumn('glosa', 'string')
|
||||
->addColumn('detalle', 'text')
|
||||
|
@ -20,7 +20,7 @@ final class CuentaMoneda extends AbstractMigration
|
||||
{
|
||||
$this->table('cuentas')
|
||||
->addColumn('moneda_id', 'integer')
|
||||
->addForeignKey('moneda_id', 'monedas')
|
||||
->addForeignKey('moneda_id', 'monedas', ['delete' => 'cascade', 'update' => 'cascade'])
|
||||
->update();
|
||||
}
|
||||
}
|
||||
|
@ -21,9 +21,9 @@ final class TipoCambio extends AbstractMigration
|
||||
$this->table('tipos_cambio')
|
||||
->addColumn('fecha', 'datetime')
|
||||
->addColumn('desde_id', 'integer')
|
||||
->addForeignKey('desde_id', 'monedas')
|
||||
->addForeignKey('desde_id', 'monedas', ['delete' => 'cascade', 'update' => 'cascade'])
|
||||
->addColumn('hasta_id', 'integer')
|
||||
->addForeignKey('hasta_id', 'monedas')
|
||||
->addForeignKey('hasta_id', 'monedas', ['delete' => 'cascade', 'update' => 'cascade'])
|
||||
->addColumn('valor', 'double')
|
||||
->create();
|
||||
}
|
||||
|
27
api/db/migrations/20220325185534_queue.php
Normal file
27
api/db/migrations/20220325185534_queue.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class Queue extends AbstractMigration
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change(): void
|
||||
{
|
||||
$this->table('queue')
|
||||
->addColumn('command', 'string')
|
||||
->addColumn('created', 'datetime')
|
||||
->addColumn('processed', 'boolean', ['default' => 0])
|
||||
->create();
|
||||
}
|
||||
}
|
28
api/db/migrations/20220325185539_queue_arguments.php
Normal file
28
api/db/migrations/20220325185539_queue_arguments.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class QueueArguments extends AbstractMigration
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change(): void
|
||||
{
|
||||
$this->table('queue_arguments')
|
||||
->addColumn('queue_id', 'integer')
|
||||
->addForeignKey('queue_id', 'queue', ['delete' => 'cascade', 'update' => 'cascade'])
|
||||
->addColumn('argument', 'string', ['length' => 100])
|
||||
->addColumn('value', 'string')
|
||||
->create();
|
||||
}
|
||||
}
|
29
api/db/migrations/20220325191129_consolidados.php
Normal file
29
api/db/migrations/20220325191129_consolidados.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class Consolidados extends AbstractMigration
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function change(): void
|
||||
{
|
||||
$this->table('consolidados')
|
||||
->addColumn('cuenta_id', 'integer')
|
||||
->addForeignKey('cuenta_id', 'cuentas', ['delete' => 'cascade', 'update' => 'cascade'])
|
||||
->addColumn('fecha', 'date')
|
||||
->addColumn('periodo', 'string', ['length' => 50])
|
||||
->addColumn('saldo', 'double')
|
||||
->create();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user