addSql('CREATE TABLE homework_rule_exceptions ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), tenant_id UUID NOT NULL, homework_id UUID NOT NULL REFERENCES homework(id) ON DELETE CASCADE, rule_type VARCHAR(100) NOT NULL, justification TEXT NOT NULL, created_by UUID NOT NULL REFERENCES users(id), created_at TIMESTAMPTZ NOT NULL DEFAULT NOW() )'); $this->addSql('CREATE INDEX idx_hw_exceptions_tenant ON homework_rule_exceptions(tenant_id)'); $this->addSql('CREATE INDEX idx_hw_exceptions_homework ON homework_rule_exceptions(homework_id)'); $this->addSql('CREATE INDEX idx_hw_exceptions_created_at ON homework_rule_exceptions(created_at)'); $this->addSql('CREATE INDEX idx_hw_exceptions_created_by ON homework_rule_exceptions(created_by)'); } public function down(Schema $schema): void { $this->addSql('DROP TABLE IF EXISTS homework_rule_exceptions'); } }