<?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 Version20240625060406 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
$this->addSql("SET foreign_key_checks = 0;");
$this->addSql("
DELETE FROM dtb_order_item;
DELETE FROM dtb_estimate_item;
DELETE FROM dtb_mail_history;
DELETE FROM dtb_estimate_mail_history;
DELETE FROM dtb_shipping;
DELETE FROM dtb_estimate_shipping;
DELETE FROM dtb_order;
DELETE FROM dtb_estimate;
ALTER TABLE dtb_order AUTO_INCREMENT = 1;
ALTER TABLE dtb_estimate AUTO_INCREMENT = 1;
DELETE FROM dtb_cart_item;
DELETE FROM dtb_cart;
DELETE FROM dtb_estimate_cart_item;
DELETE FROM dtb_estimate_cart;
DELETE FROM dtb_customer_favorite_product;
DELETE FROM dtb_product_tag;
DELETE FROM dtb_product_stock;
ALTER TABLE dtb_product_stock AUTO_INCREMENT = 1;
DELETE FROM dtb_product_image;
DELETE FROM dtb_product_class;
ALTER TABLE dtb_product_class AUTO_INCREMENT = 1;
DELETE FROM dtb_product_category;
DELETE FROM dtb_product;
ALTER TABLE dtb_product AUTO_INCREMENT = 1;
DELETE FROM dtb_class_category;
DELETE FROM dtb_class_name;
DELETE FROM dtb_category;
DELETE FROM dtb_tag;
ALTER TABLE dib_class_category AUTO_INCREMENT = 1;
ALTER TABLE dtb_class_name AUTO_INCREMENT = 1;
ALTER TABLE dtb_category AUTO_INCREMENT = 1;
ALTER TABLE dtb_tag AUTO_INCREMENT = 1;
");
$this->addSql("SET foreign_key_checks = 1;");
$this->addSql("
INSERT INTO `dtb_product` (`id`, `creator_id`, `product_status_id`, `name`, `note`, `description_list`, `description_detail`, `search_word`, `free_area`, `create_date`, `update_date`, `discriminator_type`) VALUES
(NULL, 1, 1, 'プリントステッカー', NULL, NULL, NULL, NULL, NULL, '2024-05-01 08:02:14', '2024-05-14 08:32:09', 'product'),
(NULL, 1, 1, 'カッティングステッカー', NULL, NULL, NULL, NULL, NULL, '2024-05-23 07:21:47', '2024-05-23 07:21:47', 'product');
");
$this->addSql("
INSERT INTO `dtb_product_class` (`id`, `product_id`, `sale_type_id`, `class_category_id1`, `class_category_id2`, `delivery_duration_id`, `creator_id`, `product_code`, `stock`, `stock_unlimited`, `sale_limit`, `price01`, `price02`, `delivery_fee`, `visible`, `create_date`, `update_date`, `currency_code`, `point_rate`, `discriminator_type`) VALUES
(NULL, 1, 1, NULL, NULL, NULL, 1, NULL, NULL, 1, NULL, 0.00, 0.00, NULL, 1, '2024-05-01 08:02:14', '2024-05-14 08:32:08', 'JPY', NULL, 'productclass'),
(NULL, 2, 1, NULL, NULL, NULL, 1, NULL, NULL, 1, NULL, 0.00, 0.00, NULL, 1, '2024-05-23 07:21:47', '2024-05-23 07:21:47', 'JPY', NULL, 'productclass');
");
$this->addSql("
INSERT INTO `dtb_product_stock` (`id`, `product_class_id`, `creator_id`, `stock`, `create_date`, `update_date`, `discriminator_type`) VALUES
(NULL, 1, 1, NULL, '2024-05-01 08:02:14', '2024-05-01 08:02:14', 'productstock'),
(NULL, 2, 1, NULL, '2024-05-23 07:21:47', '2024-05-23 07:21:47', 'productstock');
");
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
}
}