Files
safekat/ci4/app/Database/Migrations/2025-05-08-190000_CreateSelectorCalidadImpresion.php

77 lines
2.2 KiB
PHP
Executable File

<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class CreateSelectorCalidadImpresion extends Migration
{
public function up()
{
$this->forge->addField([
'id' => [
'type' => 'INT',
'constraint' => 11,
'unsigned' => true,
'auto_increment' => true,
],
'alias' => [
'type' => 'VARCHAR',
'constraint' => 255,
],
'cliente_id' => [
'type' => 'INT',
'constraint' => 10,
'unsigned' => true,
'null' => true,
],
'isPod' => [
'type' => 'TINYINT',
'constraint' => 1,
'default' => 0,
],
'input_isColor' => [
'type' => 'TINYINT',
'constraint' => 1,
'default' => 0,
],
'input_isHq' => [
'type' => 'TINYINT',
'constraint' => 1,
'default' => 0,
],
'output_isColor' => [
'type' => 'TINYINT',
'constraint' => 1,
'default' => 0,
],
'output_isHq' => [
'type' => 'TINYINT',
'constraint' => 1,
'default' => 0,
],
'created_at' => [
'type' => 'DATETIME',
'null' => true,
],
'updated_at' => [
'type' => 'DATETIME',
'null' => true,
],
'deleted_at' => [
'type' => 'DATETIME',
'null' => true,
],
]);
$this->forge->addKey('id', true);
$this->forge->addForeignKey('cliente_id', 'clientes', 'id', 'CASCADE', 'SET NULL');
$this->forge->createTable('selector_calidad_impresion');
}
public function down()
{
$this->forge->dropTable('selector_calidad_impresion');
}
}