migrations/Version20240306211104.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 Version20240306211104 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $this->addSql('CREATE TABLE sale_shipment_pedidos_ya (id INT NOT NULL, dispatcher_user_id INT DEFAULT NULL, name VARCHAR(100) NOT NULL, city VARCHAR(255) NOT NULL, phone VARCHAR(15) NOT NULL, address VARCHAR(255) NOT NULL, instructions VARCHAR(255) DEFAULT NULL, estimate_id VARCHAR(40) NOT NULL, delivery_offer_id VARCHAR(40) NOT NULL, confirmation_code VARCHAR(40) NOT NULL, delivery_mode VARCHAR(20) NOT NULL, api_status VARCHAR(20) NOT NULL, distance INT NOT NULL, delivery_time_from DATETIME DEFAULT NULL, delivery_time_to DATETIME DEFAULT NULL, share_location_url VARCHAR(200) NOT NULL, online_support_url VARCHAR(200) NOT NULL, confirmation_time_limit DATETIME NOT NULL, pricing INT NOT NULL, seller_latitude NUMERIC(20, 16) NOT NULL, seller_longitude NUMERIC(20, 16) NOT NULL, client_latitude NUMERIC(20, 16) NOT NULL, client_longitude NUMERIC(20, 16) NOT NULL, dispatch_observation VARCHAR(400) NOT NULL, dispatched_at DATETIME DEFAULT NULL, delivered_at DATETIME DEFAULT NULL, INDEX IDX_B00B7BE3E802A6A1 (dispatcher_user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('ALTER TABLE sale_shipment_pedidos_ya ADD CONSTRAINT FK_B00B7BE3E802A6A1 FOREIGN KEY (dispatcher_user_id) REFERENCES user (id)');
  20.         $this->addSql('ALTER TABLE sale_shipment_pedidos_ya ADD CONSTRAINT FK_B00B7BE3BF396750 FOREIGN KEY (id) REFERENCES sale_shipment (id) ON DELETE CASCADE');
  21.     }
  22.     public function down(Schema $schema): void
  23.     {
  24.         // this down() migration is auto-generated, please modify it to your needs
  25.         $this->addSql('DROP TABLE sale_shipment_pedidos_ya');
  26.     }
  27. }