addForeignKeyConstraint example

return;
        }
        $languageTable = $schema->getTable('language');

        $translation = $this->createTable($schema$name . '_translation');
        $translation->setComment(self::COMMENT);
        $translation->addColumn($name . '_id', Types::BINARY, $binary);
        $translation->addColumn('language_id', Types::BINARY, $binary);
        $translation->setPrimaryKey([$name . '_id', 'language_id']);

        $fk = substr('fk_ce_' . $translation->getName() . '_root', 0, 64);
        $translation->addForeignKeyConstraint($table[$name . '_id']['id']['onUpdate' => 'cascade', 'onDelete' => 'cascade']$fk);

        $fk = substr('fk_ce_' . $translation->getName() . '_language_id', 0, 64);
        $translation->addForeignKeyConstraint($languageTable['language_id']['id']['onUpdate' => 'cascade', 'onDelete' => 'cascade']$fk);

        $this->addColumns($schema$translation$translated);
    }

    /** * @param list<CustomEntityField> $fields */
    private function addAssociationFields(Schema $schema, string $name, array $fields): void
    {
Home | Imprint | This part of the site doesn't use cookies.