addSql(<<<'SQL' CREATE TABLE school_grading_configurations ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), tenant_id UUID NOT NULL, school_id UUID NOT NULL, academic_year_id UUID NOT NULL, grading_mode VARCHAR(20) NOT NULL DEFAULT 'numeric_20' CHECK (grading_mode IN ('numeric_20', 'numeric_10', 'letters', 'competencies', 'no_grades')), configured_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW() ) SQL); $this->addSql('CREATE INDEX idx_grading_config_tenant_id ON school_grading_configurations(tenant_id)'); $this->addSql(<<<'SQL' CREATE UNIQUE INDEX idx_grading_config_unique ON school_grading_configurations (tenant_id, school_id, academic_year_id) SQL); } public function down(Schema $schema): void { $this->addSql('DROP TABLE IF EXISTS school_grading_configurations'); } }