API - Search Prices - Added RoomPrices

This commit is contained in:
2025-10-21 19:58:00 +02:00
parent f703727ccb
commit c9e1f95c81
5 changed files with 287 additions and 65 deletions
+44
View File
@@ -0,0 +1,44 @@
<?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 Version20251017201308 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(<<<'SQL'
CREATE TABLE room_price (date VARCHAR(10) NOT NULL, guest_number SMALLINT NOT NULL, price INT NOT NULL, room_category_id INT NOT NULL, PRIMARY KEY(room_category_id, date, guest_number))
SQL);
$this->addSql(<<<'SQL'
CREATE INDEX IDX_8074837267333DD ON room_price (room_category_id)
SQL);
$this->addSql(<<<'SQL'
ALTER TABLE room_price ADD CONSTRAINT FK_8074837267333DD FOREIGN KEY (room_category_id) REFERENCES room_category (id) NOT DEFERRABLE INITIALLY IMMEDIATE
SQL);
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql(<<<'SQL'
ALTER TABLE room_price DROP CONSTRAINT FK_8074837267333DD
SQL);
$this->addSql(<<<'SQL'
DROP TABLE room_price
SQL);
}
}