Files
opensourcepos/app/Database/Migrations/20230307000000_int_to_tinyint.php
jarebear6expepjozn6rakjq5iczi3irqwphcvbswgkahd6b6twnxxid d879ab6913 update int(1) columns in _customers and _cash_up tables to use tinyint (#3709)
2023-04-27 21:54:12 -04:00

22 lines
682 B
PHP

<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class IntToTinyint extends Migration
{
public function up(): void
{
$this->db->query('ALTER TABLE ' . $this->db->prefixTable('customers') . ' MODIFY `consent` tinyint NOT NULL DEFAULT 0');
$this->db->query('ALTER TABLE ' . $this->db->prefixTable('cash_up') . ' MODIFY `note` tinyint NOT NULL DEFAULT 0');
}
public function down()
{
$this->db->query('ALTER TABLE ' . $this->db->prefixTable('customers') . ' MODIFY `consent` int NOT NULL DEFAULT 0');
$this->db->query('ALTER TABLE ' . $this->db->prefixTable('cash_up') . ' MODIFY `note` int NOT NULL DEFAULT 0');
}
}