app/DoctrineMigrations/Version20240625060406.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20240625060406 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         $this->addSql("SET foreign_key_checks = 0;");
  18.         $this->addSql("
  19.         DELETE FROM dtb_order_item;
  20.         DELETE FROM dtb_estimate_item;
  21.         DELETE FROM dtb_mail_history;
  22.         DELETE FROM dtb_estimate_mail_history;
  23.         DELETE FROM dtb_shipping;
  24.         DELETE FROM dtb_estimate_shipping;
  25.         DELETE FROM dtb_order;
  26.         DELETE FROM dtb_estimate;
  27.         ALTER TABLE dtb_order AUTO_INCREMENT = 1;
  28.         ALTER TABLE dtb_estimate AUTO_INCREMENT = 1;
  29.         
  30.         DELETE FROM dtb_cart_item;
  31.         DELETE FROM dtb_cart;
  32.         DELETE FROM dtb_estimate_cart_item;
  33.         DELETE FROM dtb_estimate_cart;
  34.         DELETE FROM dtb_customer_favorite_product;
  35.         DELETE FROM dtb_product_tag;
  36.         DELETE FROM dtb_product_stock;
  37.         ALTER TABLE dtb_product_stock AUTO_INCREMENT = 1;
  38.         DELETE FROM dtb_product_image;
  39.         DELETE FROM dtb_product_class;
  40.         ALTER TABLE dtb_product_class AUTO_INCREMENT = 1;
  41.         DELETE FROM dtb_product_category;
  42.         DELETE FROM dtb_product;
  43.         ALTER TABLE dtb_product AUTO_INCREMENT = 1;
  44.         
  45.         DELETE FROM dtb_class_category;
  46.         DELETE FROM dtb_class_name;
  47.         DELETE FROM dtb_category;
  48.         DELETE FROM dtb_tag;
  49.         ALTER TABLE dib_class_category AUTO_INCREMENT = 1;
  50.         ALTER TABLE dtb_class_name AUTO_INCREMENT = 1;
  51.         ALTER TABLE dtb_category AUTO_INCREMENT = 1;
  52.         ALTER TABLE dtb_tag AUTO_INCREMENT = 1;
  53.         ");
  54.         $this->addSql("SET foreign_key_checks = 1;");
  55.         $this->addSql("
  56.             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
  57.             (NULL, 1, 1, 'プリントステッカー', NULL, NULL, NULL, NULL, NULL, '2024-05-01 08:02:14', '2024-05-14 08:32:09', 'product'),
  58.             (NULL, 1, 1, 'カッティングステッカー', NULL, NULL, NULL, NULL, NULL, '2024-05-23 07:21:47', '2024-05-23 07:21:47', 'product');
  59.         ");
  60.         $this->addSql("
  61.             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
  62.             (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'),
  63.             (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');
  64.         ");
  65.         $this->addSql("
  66.             INSERT INTO `dtb_product_stock` (`id`, `product_class_id`, `creator_id`, `stock`, `create_date`, `update_date`, `discriminator_type`) VALUES
  67.             (NULL, 1, 1, NULL, '2024-05-01 08:02:14', '2024-05-01 08:02:14', 'productstock'),
  68.             (NULL, 2, 1, NULL, '2024-05-23 07:21:47', '2024-05-23 07:21:47', 'productstock');
  69.         ");
  70.     }
  71.     public function down(Schema $schema): void
  72.     {
  73.         // this down() migration is auto-generated, please modify it to your needs
  74.     }
  75. }