addSql("UPDATE accommodation_booking SET status = 'requested' WHERE status = 'open' AND access_link_issued_at IS NULL"); // The type described the lifecycle a second time and contradicted the status once an // offer had been accepted. It now records only where the booking came from, which is // true at every point of its life: an old `inquiry` went through an offer however far // it got, an old `booking` was placed directly. $this->addSql('ALTER TABLE accommodation_booking CHANGE type origin VARCHAR(20) NOT NULL'); $this->addSql("UPDATE accommodation_booking SET origin = 'offer' WHERE origin = 'inquiry'"); $this->addSql("UPDATE accommodation_booking SET origin = 'direct' WHERE origin = 'booking'"); } public function down(Schema $schema): void { $this->addSql("UPDATE accommodation_booking SET origin = 'inquiry' WHERE origin = 'offer'"); $this->addSql("UPDATE accommodation_booking SET origin = 'booking' WHERE origin = 'direct'"); $this->addSql('ALTER TABLE accommodation_booking CHANGE origin type VARCHAR(20) NOT NULL'); $this->addSql("UPDATE accommodation_booking SET status = 'open' WHERE status = 'requested'"); } }