Actualizacion de migraciones
This commit is contained in:
@ -20,9 +20,9 @@ final class CreateBroker extends AbstractMigration
|
||||
public function change(): void
|
||||
{
|
||||
$this->table('brokers', ['id' => false, 'primary_key' => ['rut']])
|
||||
->addColumn('rut', 'integer', ['identity' => true, 'signed' => false])
|
||||
->addColumn('digit', 'string', ['length' => 1])
|
||||
->addColumn('name', 'string', ['length' => 255])
|
||||
->addColumn('rut', 'integer', ['identity' => true, 'signed' => false, 'null' => false])
|
||||
->addColumn('digit', 'string', ['length' => 1, 'null' => false])
|
||||
->addColumn('name', 'string', ['length' => 255, 'null' => false])
|
||||
->create();
|
||||
}
|
||||
}
|
||||
|
@ -24,9 +24,9 @@ final class CreateBrokerContract extends AbstractMigration
|
||||
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
|
||||
|
||||
$this->table('broker_contracts')
|
||||
->addColumn('broker_rut', 'integer', ['signed' => false])
|
||||
->addColumn('project_id', 'integer', ['signed' => false])
|
||||
->addColumn('commission', 'decimal', ['precision' => 10, 'scale' => 2])
|
||||
->addColumn('broker_rut', 'integer', ['signed' => false, 'null' => false])
|
||||
->addColumn('project_id', 'integer', ['signed' => false, 'null' => false])
|
||||
->addColumn('commission', 'decimal', ['precision' => 10, 'scale' => 2, 'null' => false])
|
||||
->addForeignKey('broker_rut', 'brokers', 'rut', ['delete' => 'cascade', 'update' => 'cascade'])
|
||||
->addForeignKey('project_id', 'proyecto', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
|
||||
->create();
|
||||
|
@ -24,9 +24,9 @@ final class CreateBrokerData extends AbstractMigration
|
||||
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
|
||||
|
||||
$this->table('broker_data')
|
||||
->addColumn('broker_rut', 'integer', ['signed' => false])
|
||||
->addColumn('broker_rut', 'integer', ['signed' => false, 'null' => false])
|
||||
->addColumn('representative_rut', 'integer', ['signed' => false, 'null' => true, 'default' => null])
|
||||
->addColumn('legalName', 'string', ['length' => 255, 'default' => null, 'null' => true])
|
||||
->addColumn('legal_name', 'string', ['length' => 255, 'default' => null, 'null' => true])
|
||||
->addForeignKey('broker_rut', 'brokers', ['rut'], ['delete' => 'CASCADE', 'update' => 'CASCADE'])
|
||||
->addForeignKey('representative_rut', 'personas', ['rut'], ['delete' => 'CASCADE', 'update' => 'CASCADE'])
|
||||
->create();
|
||||
|
@ -24,12 +24,12 @@ final class CreatePromotion extends AbstractMigration
|
||||
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
|
||||
|
||||
$this->table('promotions')
|
||||
->addColumn('price_id', 'integer', ['signed' => false])
|
||||
->addColumn('amount', 'decimal', ['precision' => 10, 'scale' => 2])
|
||||
->addColumn('start_date', 'date')
|
||||
->addColumn('end_date', 'date')
|
||||
->addColumn('valid_until', 'date')
|
||||
->addColumn('state', 'integer')
|
||||
->addColumn('price_id', 'integer', ['signed' => false, 'null' => false])
|
||||
->addColumn('amount', 'decimal', ['precision' => 10, 'scale' => 2, 'null' => false])
|
||||
->addColumn('start_date', 'date', ['null' => false])
|
||||
->addColumn('end_date', 'date', ['null' => false])
|
||||
->addColumn('valid_until', 'date', ['null' => false])
|
||||
->addColumn('state', 'integer', ['length' => 1, 'null' => false, 'default' => 0])
|
||||
->addForeignKey('price_id', 'prices', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
|
||||
->create();
|
||||
|
||||
|
@ -24,8 +24,8 @@ final class CreateReservation extends AbstractMigration
|
||||
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
|
||||
|
||||
$this->table('reservation')
|
||||
->addColumn('buyer_rut', 'integer', ['signed' => false])
|
||||
->addColumn('date', 'date')
|
||||
->addColumn('buyer_rut', 'integer', ['signed' => false, 'null' => false])
|
||||
->addColumn('date', 'date', ['null' => false])
|
||||
->addForeignKey('buyer_rut', 'personas', 'rut', ['delete' => 'cascade', 'update' => 'cascade'])
|
||||
->create();
|
||||
|
||||
|
@ -24,9 +24,9 @@ final class CreateBrokerContractState extends AbstractMigration
|
||||
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
|
||||
|
||||
$this->table('broker_contract_states')
|
||||
->addColumn('contract_id', 'integer', ['signed' => false])
|
||||
->addColumn('date', 'date')
|
||||
->addColumn('type', 'integer')
|
||||
->addColumn('contract_id', 'integer', ['signed' => false, 'null' => false])
|
||||
->addColumn('date', 'date', ['null' => false])
|
||||
->addColumn('type', 'integer', ['length' => 1, 'null' => false, 'default' => 0])
|
||||
->addForeignKey('contract_id', 'broker_contracts', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
|
||||
->create();
|
||||
|
||||
|
@ -24,10 +24,10 @@ final class CreateReservationDatas extends AbstractMigration
|
||||
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
|
||||
|
||||
$this->table('reservation_data')
|
||||
->addColumn('reservation_id', 'integer', ['signed' => false])
|
||||
->addColumn('type', 'integer', ['length' => 1, 'signed' => false])
|
||||
->addColumn('reference_id', 'integer', ['signed' => false])
|
||||
->addColumn('value', 'decimal', ['precision' => 10, 'scale' => 2, 'signed' => false, 'default' => 0.00])
|
||||
->addColumn('reservation_id', 'integer', ['signed' => false, 'null' => false])
|
||||
->addColumn('type', 'integer', ['length' => 1, 'signed' => false, 'null' => false])
|
||||
->addColumn('reference_id', 'integer', ['signed' => false, 'null' => false])
|
||||
->addColumn('value', 'decimal', ['precision' => 10, 'scale' => 2, 'signed' => false, 'default' => 0.00, 'null' => true])
|
||||
->create();
|
||||
|
||||
$this->execute('SET unique_checks=1; SET foreign_key_checks=1;');
|
||||
|
@ -24,9 +24,9 @@ final class CreateReservationStates extends AbstractMigration
|
||||
$this->execute("ALTER DATABASE COLLATE='utf8mb4_general_ci';");
|
||||
|
||||
$this->table('reservation_states')
|
||||
->addColumn('reservation_id', 'integer', ['signed' => false])
|
||||
->addColumn('date', 'date')
|
||||
->addColumn('type', 'integer')
|
||||
->addColumn('reservation_id', 'integer', ['signed' => false, 'null' => false])
|
||||
->addColumn('date', 'date', ['null' => false])
|
||||
->addColumn('type', 'integer', ['length' => 3, 'null' => false, 'default' => 0])
|
||||
->addForeignKey('reservation_id', 'reservation', 'id', ['delete' => 'cascade', 'update' => 'cascade'])
|
||||
->create();
|
||||
|
||||
|
Reference in New Issue
Block a user