addSql(<<<'SQL' CREATE TABLE IF NOT EXISTS student_guardians ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), student_id UUID NOT NULL, guardian_id UUID NOT NULL, relationship_type VARCHAR(50) NOT NULL, created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), created_by UUID, tenant_id UUID NOT NULL, UNIQUE(student_id, guardian_id) ) SQL); $this->addSql('CREATE INDEX IF NOT EXISTS idx_student_guardians_tenant ON student_guardians(tenant_id)'); $this->addSql('CREATE INDEX IF NOT EXISTS idx_student_guardians_guardian ON student_guardians(guardian_id)'); $this->addSql('CREATE INDEX IF NOT EXISTS idx_student_guardians_student ON student_guardians(student_id)'); } public function down(Schema $schema): void { $this->addSql('DROP TABLE IF EXISTS student_guardians'); } }