37 lines
1.1 KiB
PHP
37 lines
1.1 KiB
PHP
<?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 Version20250604043747 extends AbstractMigration
|
|
{
|
|
public function getDescription(): string
|
|
{
|
|
return 'Add car_properties_embeddings table';
|
|
}
|
|
|
|
public function up(Schema $schema): void
|
|
{
|
|
$this->addSql('CREATE TABLE car_properties_embeddings (
|
|
car_property_id VARCHAR(255) NOT NULL,
|
|
embedding_id VARCHAR(255) NOT NULL,
|
|
PRIMARY KEY(car_property_id, embedding_id)
|
|
)');
|
|
|
|
$this->addSql('ALTER TABLE car_properties_embeddings ADD CONSTRAINT FK_car_properties_embeddings_car_property_id FOREIGN KEY (car_property_id) REFERENCES car_properties (id)');
|
|
$this->addSql('ALTER TABLE car_properties_embeddings ADD CONSTRAINT FK_car_properties_embeddings_embedding_id FOREIGN KEY (embedding_id) REFERENCES embeddings (id)');
|
|
}
|
|
|
|
public function down(Schema $schema): void
|
|
{
|
|
$this->addSql('DROP TABLE car_properties_embeddings');
|
|
}
|
|
}
|