<?php
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20150619114451 extends AbstractMigration
{
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('CREATE TABLE image (id INT AUTO_INCREMENT NOT NULL, path VARCHAR(255) NOT NULL, file_name VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL, updated DATETIME NOT NULL, deletedAt DATETIME DEFAULT NULL, Truck_id INT DEFAULT NULL, INDEX IDX_C53D045F3FE31E98 (Truck_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE image ADD CONSTRAINT FK_C53D045F3FE31E98 FOREIGN KEY (Truck_id) REFERENCES truck (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE truck ADD uuid LONGTEXT DEFAULT NULL, ADD stock_value NUMERIC(8, 2) DEFAULT NULL, ADD retail_value NUMERIC(8, 2) DEFAULT NULL, ADD trade_value NUMERIC(8, 2) DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('DROP TABLE image');
$this->addSql('ALTER TABLE truck DROP uuid, DROP stock_value, DROP retail_value, DROP trade_value');
}
}