<?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 Version20251015154138 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 vehicle (id UUID NOT NULL, application_id UUID DEFAULT NULL, created_by UUID DEFAULT NULL, updated_by UUID DEFAULT NULL, vehicle_category VARCHAR(255) DEFAULT NULL, vehicle_type VARCHAR(255) DEFAULT NULL, registration_number_or_chassis_number VARCHAR(255) DEFAULT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, deleted_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_1B80E4863E030ACD ON vehicle (application_id)');
$this->addSql('CREATE INDEX IDX_1B80E486DE12AB56 ON vehicle (created_by)');
$this->addSql('CREATE INDEX IDX_1B80E48616FE72E1 ON vehicle (updated_by)');
$this->addSql('COMMENT ON COLUMN vehicle.id IS \'(DC2Type:uuid)\'');
$this->addSql('COMMENT ON COLUMN vehicle.application_id IS \'(DC2Type:uuid)\'');
$this->addSql('COMMENT ON COLUMN vehicle.created_by IS \'(DC2Type:uuid)\'');
$this->addSql('COMMENT ON COLUMN vehicle.updated_by IS \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE vehicle ADD CONSTRAINT FK_1B80E4863E030ACD FOREIGN KEY (application_id) REFERENCES application (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE vehicle ADD CONSTRAINT FK_1B80E486DE12AB56 FOREIGN KEY (created_by) REFERENCES "user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE vehicle ADD CONSTRAINT FK_1B80E48616FE72E1 FOREIGN KEY (updated_by) REFERENCES "user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE vehicle DROP CONSTRAINT FK_1B80E4863E030ACD');
$this->addSql('ALTER TABLE vehicle DROP CONSTRAINT FK_1B80E486DE12AB56');
$this->addSql('ALTER TABLE vehicle DROP CONSTRAINT FK_1B80E48616FE72E1');
$this->addSql('DROP TABLE vehicle');
}
}