<?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 Version20231226195712 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 bodega (id INT AUTO_INCREMENT NOT NULL, created_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, empresa_id INT DEFAULT NULL, bodega_nombre VARCHAR(100) DEFAULT NULL, bodega_multivende_id VARCHAR(255) DEFAULT NULL, bodega_codigo VARCHAR(100) DEFAULT NULL, bodega_descripcion VARCHAR(255) DEFAULT NULL, updated_at DATETIME DEFAULT NULL, bodega_sincronizacion_wf TINYINT(1) DEFAULT NULL, bodega_webfactura_id INT DEFAULT NULL, bodega_telefono VARCHAR(100) DEFAULT NULL, bodega_direccion VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE categoria (id INT AUTO_INCREMENT NOT NULL, created_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, updated_at DATETIME DEFAULT NULL, empresa_id INT DEFAULT NULL, categoria_multivende_id VARCHAR(150) DEFAULT NULL, categoria_nombre VARCHAR(100) DEFAULT NULL, categoria_codigo VARCHAR(100) DEFAULT NULL, categoria_multivende_updated_at DATETIME DEFAULT NULL, categoria_multivende_created_at DATETIME DEFAULT NULL, categoria_branch VARCHAR(100) DEFAULT NULL, categoria_descripcion VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE checkout (id INT AUTO_INCREMENT NOT NULL, created_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, empresa_id INT DEFAULT NULL, multivende_id VARCHAR(150) DEFAULT NULL, doc_folio INT DEFAULT NULL, fecha_creacion_multivende DATETIME DEFAULT NULL, fecha_ultima_actualizacion DATETIME DEFAULT NULL, observacion_wf VARCHAR(255) DEFAULT NULL, canal VARCHAR(70) DEFAULT NULL, cant_item INT DEFAULT NULL, sube_archivo INT DEFAULT NULL, pdf_url VARCHAR(255) DEFAULT NULL, doc_tipo_id INT DEFAULT NULL, client_id VARCHAR(100) DEFAULT NULL, doc_fecha_emision DATETIME DEFAULT NULL, upload_file_id VARCHAR(100) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE empresa (id INT AUTO_INCREMENT NOT NULL, created_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, empresa_rut VARCHAR(20) DEFAULT NULL, empresa_razon_social VARCHAR(100) DEFAULT NULL, webfactura_id INT DEFAULT NULL, webfactura_client_id VARCHAR(200) DEFAULT NULL, webfactura_client_secret VARCHAR(200) DEFAULT NULL, empresa_giro VARCHAR(255) DEFAULT NULL, empresa_direccion VARCHAR(100) DEFAULT NULL, empresa_comuna VARCHAR(100) DEFAULT NULL, empresa_ciudad VARCHAR(100) DEFAULT NULL, empresa_telefono VARCHAR(20) DEFAULT NULL, empresa_correo VARCHAR(100) DEFAULT NULL, precio_bruto TINYINT(1) DEFAULT NULL, precio_neto TINYINT(1) DEFAULT NULL, empresa_actividad_economica INT DEFAULT NULL, is_active TINYINT(1) DEFAULT NULL, modo_demo TINYINT(1) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE event_report (id INT AUTO_INCREMENT NOT NULL, created_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, observacion VARCHAR(255) DEFAULT NULL, method VARCHAR(10) DEFAULT NULL, content LONGTEXT DEFAULT NULL, controller_used VARCHAR(40) DEFAULT NULL, function_used VARCHAR(40) DEFAULT NULL, time_alive VARCHAR(100) DEFAULT NULL, ip_call VARCHAR(20) DEFAULT NULL, file_log_name VARCHAR(100) DEFAULT NULL, empresa_id INT NOT NULL, ruta_log VARCHAR(150) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE input_call (id INT AUTO_INCREMENT NOT NULL, created_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, method VARCHAR(20) DEFAULT NULL, content VARCHAR(255) DEFAULT NULL, controller_used VARCHAR(100) DEFAULT NULL, function_used VARCHAR(100) DEFAULT NULL, time_alive VARCHAR(30) DEFAULT NULL, ip_call VARCHAR(30) DEFAULT NULL, file_log_name VARCHAR(100) DEFAULT NULL, empresa_id INT DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE lista_precio (id INT AUTO_INCREMENT NOT NULL, created_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, empresa_id INT NOT NULL, precio_lista_multivende_id VARCHAR(150) DEFAULT NULL, currency VARCHAR(20) DEFAULT NULL, lista_precio_nombre VARCHAR(100) DEFAULT NULL, is_default TINYINT(1) DEFAULT NULL, lista_precio_codigo VARCHAR(100) DEFAULT NULL, lista_precio_descripcion VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE multivende_assoc (id INT AUTO_INCREMENT NOT NULL, empresa_id INT DEFAULT NULL, created_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, client_id VARCHAR(255) DEFAULT NULL, scopes VARCHAR(255) DEFAULT NULL, access_token LONGTEXT DEFAULT NULL, code VARCHAR(255) DEFAULT NULL, refresh_token VARCHAR(255) DEFAULT NULL, active INT DEFAULT NULL, client_secret VARCHAR(255) DEFAULT NULL, expires_at DATETIME DEFAULT NULL, refresh_token_expires_at DATETIME DEFAULT NULL, merchant_id VARCHAR(150) DEFAULT NULL, oauth_client_id VARCHAR(150) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE producto (id INT AUTO_INCREMENT NOT NULL, created_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, empresa_id INT DEFAULT NULL, impuesto TINYINT(1) DEFAULT NULL, concesionario TINYINT(1) DEFAULT NULL, producto_codigo VARCHAR(50) DEFAULT NULL, producto_codigo_interno VARCHAR(70) DEFAULT NULL, producto_multivende_id VARCHAR(100) DEFAULT NULL, producto_nombre VARCHAR(150) DEFAULT NULL, producto_alias VARCHAR(255) DEFAULT NULL, producto_modelo VARCHAR(50) DEFAULT NULL, producto_descripcion VARCHAR(255) DEFAULT NULL, producto_short_description LONGTEXT DEFAULT NULL, producto_fecha_creacion_multivende DATETIME DEFAULT NULL, producto_fecha_ultima_actualizacion DATETIME DEFAULT NULL, producto_categoria_id VARCHAR(100) DEFAULT NULL, producto_brand_id VARCHAR(100) DEFAULT NULL, producto_tipo_id VARCHAR(100) DEFAULT NULL, producto_garantia_id VARCHAR(100) DEFAULT NULL, producto_sincronizacion_wf TINYINT(1) DEFAULT NULL, updated_at DATETIME DEFAULT NULL, producto_precio_lista_id VARCHAR(100) DEFAULT NULL, producto_precio_neto INT DEFAULT NULL, producto_impuesto_tasa INT DEFAULT NULL, producto_iva INT DEFAULT NULL, producto_impuesto_adicional_tasa INT DEFAULT NULL, producto_impuesto_adicional_monto INT DEFAULT NULL, producto_precio_bruto INT DEFAULT NULL, producto_impuesto_codigo INT DEFAULT NULL, status_valid INT DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE producto_lista_precio (id INT AUTO_INCREMENT NOT NULL, created_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, updated_at DATETIME DEFAULT NULL, empresa_id INT DEFAULT NULL, net INT DEFAULT NULL, tax INT DEFAULT NULL, gross INT DEFAULT NULL, lista_precio_id VARCHAR(150) DEFAULT NULL, producto_codigo VARCHAR(100) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE queue_multivende (id INT AUTO_INCREMENT NOT NULL, created_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, updated_at DATETIME DEFAULT NULL, empresa_id INT DEFAULT NULL, multivende_id VARCHAR(150) DEFAULT NULL, status INT DEFAULT NULL, type INT DEFAULT NULL, multivende_updated_at DATETIME DEFAULT NULL, log_id INT DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE queue_type (id INT AUTO_INCREMENT NOT NULL, type_name VARCHAR(100) DEFAULT NULL, type_id INT DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE stock (id INT AUTO_INCREMENT NOT NULL, created_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, empresa_id INT DEFAULT NULL, updated_at DATETIME DEFAULT NULL, multivende_id VARCHAR(100) DEFAULT NULL, producto_codigo VARCHAR(100) DEFAULT NULL, multivende_updated_at DATETIME DEFAULT NULL, amount INT DEFAULT NULL, bodega_multivende_id VARCHAR(100) DEFAULT NULL, producto_version_id VARCHAR(100) DEFAULT NULL, sincronizacion_wf TINYINT(1) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE user (id INT AUTO_INCREMENT NOT NULL, created_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, email VARCHAR(180) NOT NULL, roles JSON NOT NULL COMMENT \'(DC2Type:json)\', password VARCHAR(255) NOT NULL, empresa_id INT DEFAULT NULL, is_active TINYINT(1) DEFAULT NULL, salt VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_8D93D649E7927C74 (email), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE version_producto (id INT AUTO_INCREMENT NOT NULL, created_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, updated_at DATETIME DEFAULT NULL, empresa_id INT DEFAULT NULL, producto_padre_multivende_id VARCHAR(150) DEFAULT NULL, producto_codigo VARCHAR(100) DEFAULT NULL, producto_multivende_id VARCHAR(150) DEFAULT NULL, size_name VARCHAR(100) DEFAULT NULL, color_name VARCHAR(100) DEFAULT NULL, sincronizacion_wf TINYINT(1) DEFAULT 0, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE webhook_multivende (id INT AUTO_INCREMENT NOT NULL, created_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, empresa_id INT DEFAULT NULL, log_id INT DEFAULT NULL, resource VARCHAR(100) DEFAULT NULL, identifier VARCHAR(255) DEFAULT NULL, attemp INT DEFAULT NULL, status INT DEFAULT NULL, file_name VARCHAR(100) DEFAULT NULL, ruta VARCHAR(150) DEFAULT NULL, observacion VARCHAR(255) DEFAULT NULL, received_at VARCHAR(30) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE bodega');
$this->addSql('DROP TABLE categoria');
$this->addSql('DROP TABLE checkout');
$this->addSql('DROP TABLE empresa');
$this->addSql('DROP TABLE event_report');
$this->addSql('DROP TABLE input_call');
$this->addSql('DROP TABLE lista_precio');
$this->addSql('DROP TABLE multivende_assoc');
$this->addSql('DROP TABLE producto');
$this->addSql('DROP TABLE producto_lista_precio');
$this->addSql('DROP TABLE queue_multivende');
$this->addSql('DROP TABLE queue_type');
$this->addSql('DROP TABLE stock');
$this->addSql('DROP TABLE user');
$this->addSql('DROP TABLE version_producto');
$this->addSql('DROP TABLE webhook_multivende');
}
}