<?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 Version20210630085323 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 camera (id INT AUTO_INCREMENT NOT NULL, parking_slot_1 INT DEFAULT NULL, parking_slot_2 INT DEFAULT NULL, parking_slot_3 INT DEFAULT NULL, ip_address VARCHAR(64) DEFAULT NULL, name VARCHAR(128) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, UNIQUE INDEX UNIQ_3B1CEE0568E10165 (parking_slot_1), UNIQUE INDEX UNIQ_3B1CEE05F1E850DF (parking_slot_2), UNIQUE INDEX UNIQ_3B1CEE0586EF6049 (parking_slot_3), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE camera ADD CONSTRAINT FK_3B1CEE0568E10165 FOREIGN KEY (parking_slot_1) REFERENCES parkingslot (id)');
$this->addSql('ALTER TABLE camera ADD CONSTRAINT FK_3B1CEE05F1E850DF FOREIGN KEY (parking_slot_2) REFERENCES parkingslot (id)');
$this->addSql('ALTER TABLE camera ADD CONSTRAINT FK_3B1CEE0586EF6049 FOREIGN KEY (parking_slot_3) REFERENCES parkingslot (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE camera');
}
}