addSql('ALTER TABLE chill_calendar.calendar_range DROP CONSTRAINT FK_38D57D0565FF1AEC'); $this->addSql('ALTER TABLE chill_calendar.calendar_range DROP CONSTRAINT FK_38D57D053174800F'); $this->addSql('DROP INDEX chill_calendar.IDX_38D57D0565FF1AEC'); $this->addSql('DROP INDEX chill_calendar.IDX_38D57D053174800F'); $this->addSql('DROP INDEX chill_calendar.idx_calendar_range_remote'); $this->addSql('ALTER TABLE chill_calendar.calendar_range DROP remoteId'); $this->addSql('ALTER TABLE chill_calendar.calendar_range DROP remoteAttributes'); $this->addSql('ALTER TABLE chill_calendar.calendar_range DROP updatedAt'); $this->addSql('ALTER TABLE chill_calendar.calendar_range DROP createdAt'); $this->addSql('ALTER TABLE chill_calendar.calendar_range DROP updatedBy_id'); $this->addSql('ALTER TABLE chill_calendar.calendar_range DROP createdBy_id'); } public function getDescription(): string { return 'Add columns on calendar range to handle remote'; } public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_calendar.calendar_range ADD remoteId TEXT DEFAULT \'\' NOT NULL'); $this->addSql('ALTER TABLE chill_calendar.calendar_range ADD remoteAttributes JSON DEFAULT \'[]\' NOT NULL'); $this->addSql('ALTER TABLE chill_calendar.calendar_range ADD updatedAt TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL'); $this->addSql('ALTER TABLE chill_calendar.calendar_range ADD createdAt TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL'); $this->addSql('ALTER TABLE chill_calendar.calendar_range ADD updatedBy_id INT DEFAULT NULL'); $this->addSql('ALTER TABLE chill_calendar.calendar_range ADD createdBy_id INT DEFAULT NULL'); $this->addSql('COMMENT ON COLUMN chill_calendar.calendar_range.updatedAt IS \'(DC2Type:datetime_immutable)\''); $this->addSql('COMMENT ON COLUMN chill_calendar.calendar_range.createdAt IS \'(DC2Type:datetime_immutable)\''); $this->addSql('ALTER TABLE chill_calendar.calendar_range ADD CONSTRAINT FK_38D57D0565FF1AEC FOREIGN KEY (updatedBy_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER TABLE chill_calendar.calendar_range ADD CONSTRAINT FK_38D57D053174800F FOREIGN KEY (createdBy_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('CREATE INDEX IDX_38D57D0565FF1AEC ON chill_calendar.calendar_range (updatedBy_id)'); $this->addSql('CREATE INDEX IDX_38D57D053174800F ON chill_calendar.calendar_range (createdBy_id)'); $this->addSql('CREATE INDEX idx_calendar_range_remote ON chill_calendar.calendar_range (remoteId)'); } }