Migrations and seeds

This commit is contained in:
Juan Pablo Vial
2024-12-18 19:48:00 -03:00
parent 70710b24c5
commit d6b735f2aa
214 changed files with 1387167 additions and 4747 deletions

View File

@ -0,0 +1,18 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateAction extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('action')
->addColumn('description', 'string', ['length' => 50, 'null' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,26 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateAgente extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('agente')
->addColumn('tipo', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->addColumn('rut', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->addColumn('descripcion', 'string', ['length' => 100, 'default' => null, 'null' => true])
->addColumn('representante', 'string', ['length' => 100, 'default' => null, 'null' => true])
->addColumn('telefono', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->addColumn('correo', 'string', ['length' => 50, 'default' => null, 'null' => true])
->addColumn('direccion', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->addColumn('giro', 'mediumtext', ['default' => null, 'null' => true])
->addColumn('abreviacion', 'string', ['length' => 20, 'default' => null, 'null' => true])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,21 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateAgenteTipo extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('agente_tipo')
->addColumn('agente', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('tipo', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addForeignKey('agente', 'agente', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->addForeignKey('tipo', 'tipo_agente', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,26 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateAvanceConstruccion extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('avance_construccion')
->addColumn('proyecto', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('fecha', 'date', ['null' => false])
->addColumn('numero', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('avance', 'double', ['null' => false, 'signed' => false])
->addColumn('estado_pago', 'double', ['null' => false, 'signed' => false])
->addColumn('pagado', 'integer', ['length' => 10, 'default' => null, 'null' => true, 'signed' => false])
->addColumn('uf', 'double', ['default' => null, 'null' => true, 'signed' => false])
->addColumn('fecha_pagado', 'date', ['default' => null, 'null' => true])
->addForeignKey('proyecto', 'proyecto', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,18 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateBackup extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('backup')
->addColumn('date', 'datetime', ['default' => null, 'null' => true])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,18 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateBanco extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('banco')
->addColumn('nombre', 'string', ['length' => 20, 'default' => null, 'null' => true])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,20 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateBonoPie extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('bono_pie')
->addColumn('valor', 'float', ['default' => null, 'null' => true])
->addColumn('pago', 'integer', ['length' => 11, 'default' => null, 'null' => true, 'signed' => false])
->addForeignKey('pago', 'pago', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,23 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateCartolas extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('cartolas')
->addColumn('cuenta_id', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('fecha', 'date', ['null' => false])
->addColumn('cargos', 'bigint', ['length' => 20, 'default' => 0, 'null' => false, 'signed' => false])
->addColumn('abonos', 'bigint', ['length' => 20, 'default' => 0, 'null' => false, 'signed' => false])
->addColumn('saldo', 'bigint', ['length' => 20, 'default' => 0, 'null' => false])
->addForeignKey('cuenta_id', 'cuenta', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,18 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateCategoriasCentrosCostos extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('categorias_centros_costos')
->addColumn('descripcion', 'string', ['length' => 255, 'null' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,24 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateCentrosCostos extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('centros_costos')
->addColumn('tipo_centro_id', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('categoria_id', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('tipo_cuenta_id', 'integer', ['length' => 10, 'default' => null, 'null' => true, 'signed' => false])
->addColumn('cuenta_contable', 'string', ['length' => 100, 'null' => false])
->addColumn('descripcion', 'mediumtext', ['null' => false])
->addForeignKey('tipo_centro_id', 'tipos_centros_costos', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->addForeignKey('categoria_id', 'categorias_centros_costos', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,23 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateCierre extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('cierre')
->addColumn('proyecto', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('precio', 'double', ['null' => false])
->addColumn('fecha', 'date', ['null' => false])
->addColumn('relacionado', 'integer', ['length' => 1, 'default' => 0])
->addColumn('propietario', 'integer', ['length' => 10, 'default' => 0, 'signed' => false])
->addForeignKey('proyecto', 'proyecto', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,26 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateCobro extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('cobro')
->addColumn('proyecto', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->addColumn('agente', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->addColumn('tipo', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->addColumn('fecha', 'date', ['default' => null, 'null' => true])
->addColumn('valor', 'float', ['default' => null, 'null' => true])
->addColumn('iva', 'float', ['default' => 0])
->addColumn('uf', 'float', ['default' => null, 'null' => true])
->addColumn('identificador', 'string', ['length' => 50, 'default' => null, 'null' => true])
->addColumn('glosa', 'mediumtext', ['default' => null, 'null' => true])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,21 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateComentario extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('comentario')
->addColumn('venta', 'integer', ['length' => 10, 'default' => null, 'null' => true, 'signed' => false])
->addColumn('fecha', 'datetime', ['default' => null, 'null' => true])
->addColumn('texto', 'blob', ['default' => null, 'null' => true])
->addColumn('estado', 'integer', ['length' => 11, 'default' => 1])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,20 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateComuna extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('comuna')
->addColumn('descripcion', 'string', ['length' => 50, 'null' => false])
->addColumn('provincia', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addForeignKey('provincia', 'provincia', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,19 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateConfigurations extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('configurations')
->addColumn('name', 'string', ['length' => 30, 'null' => false])
->addColumn('value', 'string', ['length' => 255, 'null' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,20 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateCosto extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('costo')
->addColumn('proyecto', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->addColumn('tipo', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->addColumn('valor', 'float', ['default' => null, 'null' => true])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,24 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateCredito extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('credito')
->addColumn('banco', 'string', ['length' => 50, 'default' => null, 'null' => true])
->addColumn('valor', 'float', ['default' => null, 'null' => true])
->addColumn('fecha', 'date', ['default' => null, 'null' => true])
->addColumn('uf', 'float', ['default' => null, 'null' => true])
->addColumn('abonado', 'integer', ['length' => 1, 'default' => 0])
->addColumn('fecha_abono', 'date', ['default' => null, 'null' => true])
->addColumn('pago', 'integer', ['length' => 11, 'null' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,22 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateCuenta extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('cuenta')
->addColumn('inmobiliaria', 'integer', ['length' => 8, 'null' => false, 'signed' => false])
->addColumn('banco', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('cuenta', 'string', ['length' => 50, 'null' => false])
->addForeignKey('inmobiliaria', 'inmobiliaria', 'rut', ['delete' => 'cascade', 'update' => 'cascade'])
->addForeignKey('banco', 'banco', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,30 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateCuota extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('cuota')
->addColumn('pie', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('fecha', 'date', ['null' => false])
->addColumn('valor_$', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('estado', 'boolean', ['length' => 1, 'default' => 0])
->addColumn('banco', 'string', ['length' => 20, 'null' => false])
->addColumn('fecha_pago', 'date', ['default' => null, 'null' => true])
->addColumn('abonado', 'boolean', ['length' => 1, 'default' => 0])
->addColumn('fecha_abono', 'date', ['default' => null, 'null' => true])
->addColumn('uf', 'double', ['default' => 0])
->addColumn('pago', 'integer', ['length' => 10, 'default' => null, 'null' => true, 'signed' => false])
->addColumn('numero', 'integer', ['length' => 10, 'default' => null, 'null' => true, 'signed' => false])
->addForeignKey('pago', 'pago', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->addForeignKey('pie', 'pie', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,23 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateDepositos extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('depositos')
->addColumn('cuenta_id', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('capital', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('futuro', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('inicio', 'date', ['null' => false])
->addColumn('termino', 'date', ['null' => false])
->addForeignKey('cuenta_id', 'cuenta', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,22 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateDireccion extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('direccion')
->addColumn('calle', 'string', ['length' => 255, 'null' => false])
->addColumn('numero', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('extra', 'string', ['length' => 255, 'null' => false])
->addColumn('comuna', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addForeignKey('comuna', 'comuna', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,24 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateEntrega extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('entrega')
->addColumn('fecha', 'date', ['null' => false])
->addColumn('fondo_operacion', 'integer', ['length' => 11, 'default' => 0])
->addColumn('fondo_reserva', 'integer', ['length' => 11, 'default' => 0])
->addColumn('fecha_fondo_operacion', 'date', ['default' => null, 'null' => true])
->addColumn('fecha_fondo_reserva', 'date', ['default' => null, 'null' => true])
->addColumn('pago_operacion', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->addColumn('pago_reserva', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,23 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateEscritura extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('escritura')
->addColumn('valor', 'bigint', ['length' => 20, 'null' => false])
->addColumn('fecha', 'date', ['null' => false])
->addColumn('uf', 'float', ['default' => null, 'null' => true])
->addColumn('abonado', 'integer', ['length' => 11, 'default' => 0])
->addColumn('fecha_abono', 'date', ['default' => null, 'null' => true])
->addColumn('pago', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,22 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateEstadoCierre extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('estado_cierre')
->addColumn('cierre', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('tipo', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('fecha', 'date', ['null' => false])
->addForeignKey('cierre', 'cierre', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->addForeignKey('tipo', 'tipo_estado_cierre', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,20 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateEstadoCobro extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('estado_cobro')
->addColumn('cobro', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('fecha', 'date', ['null' => false])
->addColumn('estado', 'integer', ['length' => 11, 'null' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,21 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateEstadoPago extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('estado_pago')
->addColumn('pago', 'integer', ['length' => 11, 'null' => false, 'signed' => false])
->addColumn('fecha', 'date', ['null' => false])
->addColumn('estado', 'integer', ['length' => 11, 'null' => false])
->addForeignKey('estado', 'tipo_estado_pago', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,22 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateEstadoPrecio extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('estado_precio')
->addColumn('precio', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('fecha', 'date', ['null' => false])
->addColumn('estado', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addForeignKey('precio', 'precio', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->addForeignKey('estado', 'tipo_estado_precio', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,20 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateEstadoProblema extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('estado_problema')
->addColumn('problema', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->addColumn('fecha', 'date', ['default' => null, 'null' => true])
->addColumn('estado', 'enum', ['length' => 'ingreso','revision','correccion','ok', 'default' => null, 'null' => true])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,22 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateEstadoProyecto extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('estado_proyecto')
->addColumn('proyecto', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('estado', 'integer', ['length' => 11, 'null' => false, 'signed' => false])
->addColumn('fecha', 'date', ['null' => false])
->addForeignKey('proyecto', 'proyecto', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->addForeignKey('estado', 'tipo_estado_proyecto', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,20 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateEstadoProyectoAgente extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('estado_proyecto_agente')
->addColumn('agente', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('fecha', 'date', ['null' => false])
->addColumn('tipo', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,20 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateEstadoUnidadBloqueada extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('estado_unidad_bloqueada')
->addColumn('unidad', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('fecha', 'date', ['null' => false])
->addColumn('tipo', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,22 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateEstadoVenta extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('estado_venta')
->addColumn('venta', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('estado', 'integer', ['length' => 11, 'default' => 1, 'null' => false, 'signed' => false])
->addColumn('fecha', 'date', ['null' => false])
->addForeignKey('estado', 'tipo_estado_venta', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->addForeignKey('venta', 'venta', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,21 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateEstadosCuentas extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('estados_cuentas')
->addColumn('cuenta_id', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('fecha', 'date', ['null' => false])
->addColumn('active', 'boolean', ['length' => 1, 'null' => false])
->addForeignKey('cuenta_id', 'cuenta', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,19 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateEtapaProyecto extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('etapa_proyecto')
->addColumn('descripcion', 'string', ['length' => 20, 'default' => null, 'null' => true])
->addColumn('orden', 'integer', ['length' => 10, 'default' => null, 'null' => true, 'signed' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,25 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateFacturaProyectoOperador extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('factura_proyecto_operador')
->addColumn('proyecto_id', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('operador_id', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('factura', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('valor_uf', 'double', ['null' => false, 'signed' => false])
->addColumn('valor_neto', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('iva', 'integer', ['length' => 10, 'default' => 0, 'signed' => false])
->addForeignKey('proyecto_id', 'proyecto', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->addForeignKey('operador_id', 'agente', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,22 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateFacturaVenta extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('factura_venta')
->addColumn('factura_id', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('venta_id', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('valor', 'double', ['null' => false])
->addForeignKey('factura_id', 'factura_proyecto_operador', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->addForeignKey('venta_id', 'venta', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,22 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateFacturas extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('facturas')
->addColumn('venta_id', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('index', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('proporcion', 'double', ['null' => false, 'signed' => false])
->addColumn('data', 'text', ['null' => false])
->addForeignKey('venta_id', 'venta', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,25 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateInmobiliaria extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('inmobiliaria', ['id' => '`rut`'])
->addColumn('rut', 'integer', ['length' => 8, 'null' => false, 'signed' => false])
->addColumn('dv', 'char', ['length' => 1, 'default' => null, 'null' => true])
->addColumn('razon', 'string', ['length' => 255, 'default' => null, 'null' => true])
->addColumn('abreviacion', 'string', ['length' => 50, 'default' => null, 'null' => true])
->addColumn('cuenta', 'string', ['length' => 50, 'default' => null, 'null' => true])
->addColumn('banco', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->addColumn('sociedad', 'integer', ['length' => 10, 'default' => null, 'null' => true, 'signed' => false])
->addColumn('sigla', 'string', ['length' => 4, 'default' => null, 'null' => true])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,22 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateInmobiliariasNubox extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('inmobiliarias_nubox')
->addColumn('inmobiliaria_rut', 'integer', ['length' => 8, 'null' => false, 'signed' => false])
->addColumn('alias', 'string', ['length' => 100, 'null' => false])
->addColumn('usuario', 'string', ['length' => 100, 'null' => false])
->addColumn('contraseña', 'string', ['length' => 100, 'null' => false])
->addForeignKey('inmobiliaria_rut', 'inmobiliaria', 'rut', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,19 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateLocations extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('locations')
->addColumn('controller', 'string', ['length' => 50, 'null' => false])
->addColumn('action', 'string', ['length' => 100, 'null' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,23 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateLogins extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('logins')
->addColumn('user_id', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('time', 'datetime', ['null' => false])
->addColumn('selector', 'string', ['length' => 255, 'null' => false])
->addColumn('token', 'string', ['length' => 255, 'null' => false])
->addColumn('status', 'integer', ['length' => 1, 'default' => 1, 'null' => false])
->addForeignKey('user_id', 'users', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,25 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateMovimientos extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('movimientos')
->addColumn('cuenta_id', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('fecha', 'date', ['null' => false])
->addColumn('glosa', 'text', ['null' => false])
->addColumn('documento', 'string', ['length' => 50, 'null' => false])
->addColumn('cargo', 'bigint', ['length' => 20, 'default' => 0, 'null' => false, 'signed' => false])
->addColumn('abono', 'bigint', ['length' => 20, 'default' => 0, 'null' => false, 'signed' => false])
->addColumn('saldo', 'bigint', ['length' => 20, 'default' => 0, 'null' => false])
->addForeignKey('cuenta_id', 'cuenta', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,27 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateMovimientosDetalles extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('movimientos_detalles')
->addColumn('movimiento_id', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('centro_costo_id', 'integer', ['length' => 10, 'default' => null, 'null' => true, 'signed' => false])
->addColumn('categoria', 'string', ['length' => 100, 'default' => null, 'null' => true])
->addColumn('detalle', 'text', ['default' => null, 'null' => true])
->addColumn('rut', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->addColumn('digito', 'string', ['length' => 1, 'default' => null, 'null' => true])
->addColumn('nombres', 'string', ['length' => 255, 'default' => null, 'null' => true])
->addColumn('identificador', 'string', ['length' => 100, 'default' => null, 'null' => true])
->addForeignKey('movimiento_id', 'movimientos', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->addForeignKey('centro_costo_id', 'centros_costos', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,29 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreatePagare extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('pagare')
->addColumn('proyecto', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('moneda', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('capital', 'double', ['default' => 0, 'null' => false, 'signed' => false])
->addColumn('tasa', 'double', ['default' => 0, 'null' => false, 'signed' => false])
->addColumn('fecha', 'date', ['null' => false])
->addColumn('fecha_banco', 'date', ['default' => '0000-00-00', 'null' => false])
->addColumn('duracion', 'integer', ['length' => 10, 'default' => 0, 'null' => false, 'signed' => false])
->addColumn('uf', 'double', ['default' => 0, 'null' => false, 'signed' => false])
->addColumn('abonado', 'integer', ['length' => 10, 'default' => 0, 'null' => false, 'signed' => false])
->addColumn('estado_pago', 'integer', ['length' => 10, 'default' => 99999999, 'null' => false, 'signed' => false])
->addForeignKey('moneda', 'tipo_moneda_pagare', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->addForeignKey('proyecto', 'proyecto', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,25 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreatePago extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('pago')
->addColumn('valor', 'double', ['null' => false])
->addColumn('banco', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->addColumn('tipo', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->addColumn('identificador', 'string', ['length' => 50, 'default' => null, 'null' => true])
->addColumn('fecha', 'date', ['default' => null, 'null' => true])
->addColumn('uf', 'double', ['default' => null, 'null' => true])
->addColumn('pagador', 'string', ['length' => 50, 'default' => null, 'null' => true])
->addColumn('asociado', 'integer', ['length' => 10, 'default' => null, 'null' => true, 'signed' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,21 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreatePagosCentrosCostos extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('pagos_centros_costos')
->addColumn('pago_id', 'integer', ['length' => 11, 'null' => false, 'signed' => false])
->addColumn('centro_costo_id', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addForeignKey('pago_id', 'pago', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->addForeignKey('centro_costo_id', 'centros_costos', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,21 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreatePermissions extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('permissions')
->addColumn('type', 'integer', ['length' => 1, 'null' => false, 'signed' => false])
->addColumn('ext_id', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('action_id', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('status', 'integer', ['length' => 1, 'default' => 1, 'null' => false, 'signed' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,23 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreatePie extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('pie')
->addColumn('fecha', 'date', ['null' => false])
->addColumn('valor', 'double', ['null' => false, 'signed' => false])
->addColumn('uf', 'double', ['default' => null, 'null' => true, 'signed' => false])
->addColumn('cuotas', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('asociado', 'integer', ['length' => 11, 'default' => 0])
->addColumn('reajuste', 'integer', ['length' => 11, 'default' => null, 'null' => true, 'signed' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,20 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreatePrecio extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('precio')
->addColumn('unidad', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('valor', 'double', ['null' => false])
->addForeignKey('unidad', 'unidad', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,19 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateProblema extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('problema')
->addColumn('venta', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->addColumn('descripcion', 'mediumtext', ['default' => null, 'null' => true])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,22 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreatePromocion extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('promocion')
->addColumn('proyecto', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('descripcion', 'string', ['length' => 50, 'null' => false])
->addColumn('titulo', 'string', ['length' => 20, 'null' => false])
->addColumn('fecha_inicio', 'date', ['null' => false])
->addForeignKey('proyecto', 'proyecto', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,21 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreatePromocionVenta extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('promocion_venta', ['id' => '`promocion`,`venta`'])
->addColumn('promocion', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('venta', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('valor', 'double', ['null' => false, 'signed' => false])
->addForeignKey('promocion', 'promocion', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,22 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreatePropiedad extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('propiedad')
->addColumn('unidad_principal', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('estacionamientos', 'string', ['length' => 20, 'default' => null, 'null' => true])
->addColumn('bodegas', 'string', ['length' => 20, 'default' => null, 'null' => true])
->addColumn('estado', 'integer', ['length' => 11, 'default' => 1])
->addForeignKey('unidad_principal', 'unidad', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,23 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreatePropiedadUnidad extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('propiedad_unidad')
->addColumn('propiedad', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('unidad', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('principal', 'integer', ['length' => 1, 'default' => 0, 'null' => false, 'signed' => false])
->addColumn('valor', 'double', ['default' => 0, 'null' => false, 'signed' => false])
->addForeignKey('unidad', 'unidad', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->addForeignKey('propiedad', 'propiedad', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,30 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreatePropietario extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('propietario', ['id' => '`rut`'])
->addColumn('rut', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('dv', 'char', ['length' => 1, 'null' => false])
->addColumn('nombres', 'string', ['length' => 255, 'null' => false])
->addColumn('apellido_paterno', 'string', ['length' => 50, 'null' => false])
->addColumn('apellido_materno', 'string', ['length' => 50, 'null' => false])
->addColumn('sexo', 'string', ['length' => 1, 'default' => null, 'null' => true])
->addColumn('estado_civil', 'string', ['length' => 50, 'default' => null, 'null' => true])
->addColumn('profesion', 'string', ['length' => 100, 'default' => null, 'null' => true])
->addColumn('direccion', 'integer', ['length' => 10, 'default' => 0, 'null' => false, 'signed' => false])
->addColumn('telefono', 'integer', ['length' => 10, 'default' => 0, 'signed' => false])
->addColumn('email', 'string', ['length' => 100, 'default' => null, 'null' => true])
->addColumn('representante', 'integer', ['length' => 10, 'default' => 0])
->addColumn('otro', 'integer', ['length' => 11, 'default' => 0])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,20 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateProvincia extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('provincia')
->addColumn('descripcion', 'string', ['length' => 50, 'null' => false])
->addColumn('region', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addForeignKey('region', 'region', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,24 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateProyectista extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('proyectista')
->addColumn('rut', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->addColumn('nombre', 'string', ['length' => 50, 'default' => null, 'null' => true])
->addColumn('tipo', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->addColumn('representante', 'string', ['length' => 255, 'default' => null, 'null' => true])
->addColumn('telefono', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->addColumn('correo', 'string', ['length' => 100, 'default' => null, 'null' => true])
->addColumn('direccion', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,20 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateProyectistas extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('proyectistas')
->addColumn('proyecto', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->addColumn('proyectista', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->addColumn('fecha', 'date', ['default' => null, 'null' => true])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,27 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateProyecto extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('proyecto')
->addColumn('inmobiliaria', 'integer', ['length' => 10, 'default' => null, 'null' => true, 'signed' => false])
->addColumn('descripcion', 'mediumtext', ['null' => false])
->addColumn('direccion', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('superficie_terreno', 'float', ['default' => 0, 'null' => false, 'signed' => false])
->addColumn('valor_terreno', 'float', ['default' => 0, 'null' => false, 'signed' => false])
->addColumn('corredor', 'float', ['default' => 0, 'null' => false, 'signed' => false])
->addColumn('superficie_sobre_nivel', 'float', ['default' => 0, 'null' => false, 'signed' => false])
->addColumn('superficie_bajo_nivel', 'float', ['default' => 0, 'null' => false, 'signed' => false])
->addColumn('pisos', 'integer', ['length' => 10, 'default' => 0, 'null' => false, 'signed' => false])
->addColumn('subterraneos', 'integer', ['length' => 10, 'default' => 0, 'null' => false, 'signed' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,21 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateProyectoAgente extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('proyecto_agente')
->addColumn('proyecto', 'integer', ['length' => 10, 'default' => null, 'null' => true, 'signed' => false])
->addColumn('agente', 'integer', ['length' => 10, 'default' => null, 'null' => true, 'signed' => false])
->addColumn('fecha', 'date', ['default' => null, 'null' => true])
->addColumn('comision', 'float', ['default' => 0])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,23 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateProyectoTerreno extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('proyecto_terreno')
->addColumn('proyecto_id', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('fecha', 'date', ['null' => false])
->addColumn('valor', 'double', ['null' => false])
->addColumn('tipo_moneda_id', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addForeignKey('proyecto_id', 'proyecto', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->addForeignKey('tipo_moneda_id', 'tipo_moneda_pagare', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,26 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateProyectoTipoUnidad extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('proyecto_tipo_unidad')
->addColumn('proyecto', 'integer', ['length' => 10, 'default' => null, 'null' => true, 'signed' => false])
->addColumn('tipo', 'integer', ['length' => 10, 'default' => null, 'null' => true, 'signed' => false])
->addColumn('nombre', 'string', ['length' => 20, 'default' => null, 'null' => true])
->addColumn('abreviacion', 'string', ['length' => 20, 'default' => null, 'null' => true])
->addColumn('m2', 'float', ['default' => null, 'null' => true])
->addColumn('logia', 'float', ['default' => 0])
->addColumn('terraza', 'float', ['default' => 0])
->addColumn('descripcion', 'mediumtext', ['default' => null, 'null' => true])
->addForeignKey('proyecto', 'proyecto', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,20 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateRegion extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('region')
->addColumn('descripcion', 'string', ['length' => 50, 'null' => false])
->addColumn('numeral', 'char', ['length' => 4, 'null' => false])
->addColumn('numeracion', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,21 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateRegistries extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('registries')
->addColumn('user', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('action', 'string', ['length' => 255, 'null' => false])
->addColumn('time', 'datetime', ['default' => '0000-00-00', 'null' => false])
->addForeignKey('user', 'users', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,22 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateRegistryData extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('registry_data')
->addColumn('registry', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('column', 'string', ['length' => 50, 'null' => false])
->addColumn('old', 'string', ['length' => 255, 'null' => false])
->addColumn('new', 'string', ['length' => 255, 'null' => false])
->addForeignKey('registry', 'registries', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,19 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateRelacionAgentes extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('relacion_agentes')
->addColumn('agente1', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->addColumn('agente2', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,19 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateRelacionInmobiliarias extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('relacion_inmobiliarias')
->addColumn('padre', 'integer', ['length' => 11, 'default' => null, 'null' => true, 'signed' => false])
->addColumn('hijo', 'integer', ['length' => 11, 'default' => null, 'null' => true, 'signed' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,20 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateRemoteIp extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('remote_ip')
->addColumn('host', 'string', ['length' => 100, 'null' => false])
->addColumn('ip', 'string', ['length' => 15, 'null' => false])
->addColumn('updated', 'timestamp', ['default' => 'current_timestamp()', 'null' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,26 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateRenovacionPagare extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('renovacion_pagare')
->addColumn('pagare', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('insoluto', 'double', ['null' => false, 'signed' => false])
->addColumn('intereses', 'double', ['null' => false, 'signed' => false])
->addColumn('tasa', 'double', ['null' => false, 'signed' => false])
->addColumn('fecha', 'date', ['null' => false])
->addColumn('fecha_banco', 'date', ['null' => false])
->addColumn('uf', 'double', ['default' => 0, 'null' => false])
->addColumn('duracion', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addForeignKey('pagare', 'pagare', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,20 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateRoles extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('roles')
->addColumn('description', 'string', ['length' => 50, 'null' => false])
->addColumn('level', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('inherits', 'integer', ['length' => 10, 'default' => 0, 'signed' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,19 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateSubsidio extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('subsidio')
->addColumn('pago', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('subsidio', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,21 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateTipoAgente extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('tipo_agente')
->addColumn('descripcion', 'string', ['length' => 100, 'default' => null, 'null' => true])
->addColumn('icono', 'string', ['length' => 50, 'default' => null, 'null' => true])
->addColumn('color', 'string', ['length' => 6, 'default' => null, 'null' => true])
->addColumn('bgcolor', 'string', ['length' => 6, 'default' => null, 'null' => true])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,23 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateTipoCobro extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('tipo_cobro')
->addColumn('descripcion', 'string', ['length' => 20, 'default' => null, 'null' => true])
->addColumn('monto_base', 'string', ['length' => 20, 'default' => null, 'null' => true])
->addColumn('modificador', 'string', ['length' => 20, 'default' => null, 'null' => true])
->addColumn('monto_neto', 'string', ['length' => 20, 'default' => null, 'null' => true])
->addColumn('operacion', 'integer', ['length' => 11, 'default' => null, 'null' => true])
->addColumn('mod', 'float', ['default' => null, 'null' => true])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,20 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateTipoElemento extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('tipo_elemento')
->addColumn('descripcion', 'string', ['length' => 50, 'null' => false])
->addColumn('abreviacion', 'string', ['length' => 10, 'null' => false])
->addColumn('orden', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,19 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateTipoEstadoCierre extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('tipo_estado_cierre')
->addColumn('descripcion', 'string', ['length' => 50, 'null' => false])
->addColumn('vigente', 'integer', ['length' => 1, 'default' => 0, 'null' => false, 'signed' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,18 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateTipoEstadoCobro extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('tipo_estado_cobro')
->addColumn('descripcion', 'string', ['length' => 20, 'default' => null, 'null' => true])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,19 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateTipoEstadoPago extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('tipo_estado_pago')
->addColumn('descripcion', 'string', ['length' => 20, 'default' => null, 'null' => true])
->addColumn('active', 'integer', ['length' => 1, 'default' => 0])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,18 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateTipoEstadoPrecio extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('tipo_estado_precio')
->addColumn('descripcion', 'string', ['length' => 50, 'null' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,21 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateTipoEstadoProyecto extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('tipo_estado_proyecto')
->addColumn('descripcion', 'string', ['length' => 50, 'default' => null, 'null' => true])
->addColumn('orden', 'integer', ['length' => 10, 'default' => null, 'null' => true, 'signed' => false])
->addColumn('etapa', 'integer', ['length' => 10, 'default' => null, 'null' => true, 'signed' => false])
->addForeignKey('etapa', 'etapa_proyecto', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,18 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateTipoEstadoProyectoAgente extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('tipo_estado_proyecto_agente')
->addColumn('descripcion', 'string', ['length' => 255, 'null' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,19 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateTipoEstadoUnidadBloqueada extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('tipo_estado_unidad_bloqueada')
->addColumn('descripcion', 'string', ['length' => 255, 'null' => false])
->addColumn('activo', 'integer', ['length' => 1, 'null' => false, 'signed' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,19 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateTipoEstadoVenta extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('tipo_estado_venta')
->addColumn('descripcion', 'string', ['length' => 50, 'null' => false])
->addColumn('activa', 'integer', ['length' => 1, 'null' => false, 'signed' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,18 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateTipoMonedaPagare extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('tipo_moneda_pagare')
->addColumn('descripcion', 'string', ['length' => 50, 'null' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,18 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateTipoPago extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('tipo_pago')
->addColumn('descripcion', 'string', ['length' => 50, 'default' => null, 'null' => true])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,18 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateTipoProyectista extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('tipo_proyectista')
->addColumn('descripcion', 'string', ['length' => 20, 'default' => null, 'null' => true])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,19 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateTipoSociedad extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('tipo_sociedad')
->addColumn('descripcion', 'string', ['length' => 100, 'null' => false])
->addColumn('abreviacion', 'string', ['length' => 10, 'null' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,24 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateTipoTipologia extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('tipo_tipologia')
->addColumn('tipo', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('tipologia', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('cantidad', 'integer', ['length' => 10, 'null' => false])
->addColumn('elemento', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addForeignKey('elemento', 'tipo_elemento', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->addForeignKey('tipologia', 'tipologia', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->addForeignKey('tipo', 'proyecto_tipo_unidad', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,19 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateTipoUnidad extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('tipo_unidad')
->addColumn('descripcion', 'string', ['length' => 20, 'default' => null, 'null' => true])
->addColumn('orden', 'integer', ['length' => 10, 'default' => null, 'null' => true, 'signed' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,18 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateTipoValorCierre extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('tipo_valor_cierre')
->addColumn('descripcion', 'string', ['length' => 50, 'null' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,18 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateTipologia extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('tipologia')
->addColumn('descripcion', 'string', ['length' => 50, 'null' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,18 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateTiposCentrosCostos extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('tipos_centros_costos')
->addColumn('descripcion', 'string', ['length' => 50, 'null' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,18 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateTiposCuentasCostos extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('tipos_cuentas_costos')
->addColumn('descripcion', 'string', ['length' => 50, 'null' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,19 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateUf extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('uf', ['id' => '`fecha`'])
->addColumn('fecha', 'date', ['null' => false])
->addColumn('valor', 'float', ['default' => null, 'null' => true])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,33 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateUnidad extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('unidad')
->addColumn('proyecto', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('tipo', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('subtipo', 'string', ['length' => 20, 'default' => null, 'null' => true])
->addColumn('piso', 'integer', ['length' => 11, 'null' => false])
->addColumn('descripcion', 'string', ['length' => 30, 'null' => false])
->addColumn('abreviacion', 'string', ['length' => 10, 'null' => false])
->addColumn('m2', 'float', ['default' => null, 'null' => true])
->addColumn('terraza', 'float', ['default' => null, 'null' => true])
->addColumn('cubierta', 'float', ['default' => 0])
->addColumn('logia', 'float', ['default' => null, 'null' => true])
->addColumn('orientacion', 'char', ['length' => 2, 'default' => null, 'null' => true])
->addColumn('costo_inmobiliaria', 'float', ['default' => 0])
->addColumn('pt', 'integer', ['length' => 11, 'null' => false, 'signed' => false])
->addColumn('valor', 'float', ['default' => null, 'null' => true])
->addForeignKey('proyecto', 'proyecto', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->addForeignKey('pt', 'proyecto_tipo_unidad', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,19 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateUnidadBloqueada extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('unidad_bloqueada')
->addColumn('agente', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('unidad', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,22 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateUnidadCierre extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('unidad_cierre')
->addColumn('cierre', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('unidad', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('principal', 'integer', ['length' => 1, 'default' => 0, 'null' => false])
->addForeignKey('cierre', 'cierre', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->addForeignKey('unidad', 'unidad', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,20 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateUnidadProrrateo extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('unidad_prorrateo')
->addColumn('unidad_id', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('prorrateo', 'double', ['null' => false])
->addForeignKey('unidad_id', 'unidad', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,21 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateUserRoles extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('user_roles')
->addColumn('user', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('role', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addForeignKey('user', 'users', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->addForeignKey('role', 'roles', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,20 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateUsers extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('users')
->addColumn('name', 'string', ['length' => 50, 'null' => false])
->addColumn('password', 'string', ['length' => 255, 'default' => null, 'null' => true])
->addColumn('enabled', 'integer', ['length' => 1, 'default' => 1, 'null' => false])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

View File

@ -0,0 +1,22 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
class CreateValorCierre extends Phinx\Migration\AbstractMigration
{
public function change(): void
{
$this->execute('SET unique_checks=0; SET foreign_key_checks=0;');
$this->execute("ALTER DATABASE CHARACTER SET 'utf8mb4';");
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
$this->table('valor_cierre')
->addColumn('cierre', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('tipo', 'integer', ['length' => 10, 'null' => false, 'signed' => false])
->addColumn('valor', 'double', ['null' => false])
->addForeignKey('cierre', 'cierre', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->addForeignKey('tipo', 'tipo_valor_cierre', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
->create();
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
}
}

Some files were not shown because too many files have changed in this diff Show More