<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20240215235908 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE tjo_contract (id INT AUTO_INCREMENT NOT NULL, contractor_id VARCHAR(255) NOT NULL, contractor_name VARCHAR(255) NOT NULL, contract_status VARCHAR(255) NOT NULL, contract_start_date DATETIME NOT NULL COMMENT \'(DC2Type:datetime)\', contract_end_date DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime)\', contract_update_date DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime)\', contract_base_unit VARCHAR(255) NOT NULL, contract_amount NUMERIC(10, 2) NOT NULL, deposit NUMERIC(10, 2) NOT NULL, monthly_fee NUMERIC(10, 2) NOT NULL, note LONGTEXT DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_bin` ENGINE = InnoDB');
$this->addSql('ALTER TABLE dtb_base_info DROP site_kit_site_id, DROP site_kit_site_secret');
$this->addSql('ALTER TABLE dtb_cart CHANGE total_price total_price NUMERIC(12, 2) UNSIGNED DEFAULT \'0\' NOT NULL, CHANGE delivery_fee_total delivery_fee_total NUMERIC(12, 2) UNSIGNED DEFAULT \'0\' NOT NULL');
$this->addSql('ALTER TABLE dtb_cart_item CHANGE price price NUMERIC(12, 2) DEFAULT \'0\' NOT NULL');
$this->addSql('ALTER TABLE dtb_customer DROP plg_mailmagazine_flg, CHANGE buy_total buy_total NUMERIC(12, 2) UNSIGNED DEFAULT \'0\'');
$this->addSql('ALTER TABLE dtb_order CHANGE subtotal subtotal NUMERIC(12, 2) UNSIGNED DEFAULT \'0\' NOT NULL, CHANGE discount discount NUMERIC(12, 2) UNSIGNED DEFAULT \'0\' NOT NULL, CHANGE delivery_fee_total delivery_fee_total NUMERIC(12, 2) UNSIGNED DEFAULT \'0\' NOT NULL, CHANGE charge charge NUMERIC(12, 2) UNSIGNED DEFAULT \'0\' NOT NULL, CHANGE tax tax NUMERIC(12, 2) UNSIGNED DEFAULT \'0\' NOT NULL, CHANGE total total NUMERIC(12, 2) UNSIGNED DEFAULT \'0\' NOT NULL, CHANGE payment_total payment_total NUMERIC(12, 2) UNSIGNED DEFAULT \'0\' NOT NULL');
$this->addSql('ALTER TABLE dtb_order_item CHANGE price price NUMERIC(12, 2) DEFAULT \'0\' NOT NULL');
$this->addSql('ALTER TABLE dtb_payment CHANGE charge charge NUMERIC(12, 2) UNSIGNED DEFAULT \'0\'');
$this->addSql('ALTER TABLE plg_coupon CHANGE discount_price discount_price NUMERIC(12, 2) UNSIGNED DEFAULT \'0\', CHANGE coupon_lower_limit coupon_lower_limit NUMERIC(12, 2) UNSIGNED DEFAULT \'0\'');
$this->addSql('ALTER TABLE plg_coupon_order CHANGE discount discount NUMERIC(12, 2) UNSIGNED DEFAULT \'0\' NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE tjo_contract');
$this->addSql('ALTER TABLE dtb_base_info ADD site_kit_site_id VARCHAR(255) DEFAULT NULL, ADD site_kit_site_secret VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE dtb_cart CHANGE total_price total_price NUMERIC(12, 2) UNSIGNED DEFAULT \'0.00\' NOT NULL, CHANGE delivery_fee_total delivery_fee_total NUMERIC(12, 2) UNSIGNED DEFAULT \'0.00\' NOT NULL');
$this->addSql('ALTER TABLE dtb_cart_item CHANGE price price NUMERIC(12, 2) DEFAULT \'0.00\' NOT NULL');
$this->addSql('ALTER TABLE dtb_customer ADD plg_mailmagazine_flg SMALLINT UNSIGNED DEFAULT 0, CHANGE buy_total buy_total NUMERIC(12, 2) UNSIGNED DEFAULT \'0.00\'');
$this->addSql('ALTER TABLE dtb_order CHANGE subtotal subtotal NUMERIC(12, 2) UNSIGNED DEFAULT \'0.00\' NOT NULL, CHANGE discount discount NUMERIC(12, 2) UNSIGNED DEFAULT \'0.00\' NOT NULL, CHANGE delivery_fee_total delivery_fee_total NUMERIC(12, 2) UNSIGNED DEFAULT \'0.00\' NOT NULL, CHANGE charge charge NUMERIC(12, 2) UNSIGNED DEFAULT \'0.00\' NOT NULL, CHANGE tax tax NUMERIC(12, 2) UNSIGNED DEFAULT \'0.00\' NOT NULL, CHANGE total total NUMERIC(12, 2) UNSIGNED DEFAULT \'0.00\' NOT NULL, CHANGE payment_total payment_total NUMERIC(12, 2) UNSIGNED DEFAULT \'0.00\' NOT NULL');
$this->addSql('ALTER TABLE dtb_order_item CHANGE price price NUMERIC(12, 2) DEFAULT \'0.00\' NOT NULL');
$this->addSql('ALTER TABLE dtb_payment CHANGE charge charge NUMERIC(12, 2) UNSIGNED DEFAULT \'0.00\'');
$this->addSql('ALTER TABLE plg_coupon CHANGE discount_price discount_price NUMERIC(12, 2) UNSIGNED DEFAULT \'0.00\', CHANGE coupon_lower_limit coupon_lower_limit NUMERIC(12, 2) UNSIGNED DEFAULT \'0.00\'');
$this->addSql('ALTER TABLE plg_coupon_order CHANGE discount discount NUMERIC(12, 2) UNSIGNED DEFAULT \'0.00\' NOT NULL');
}
}