1

I am evaluating a Laravel/PHP component meant to manage tree data in a SQL database using the "closure Table" design pattern. Code repository: https://github.com/franzose/ClosureTable

Oh my, this component gives me endless headaches. After some installation hickups (Lifetime cost: 2 days ...) I got one little step forward, and ran into what seems to be a really serious compatibility problem with the Microsoft SQL server. When the database ist created through the migration provided by the component, I get the following fatal SQL error:

[Illuminate\Database\QueryException]

SQLSTATE[42000]: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Introducing FOREIGN KEY constraint 'pages_parent_id_foreign' on table 'pages' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints. (SQL: alter table "pages" add constraint "pages_parent_id_foreign" foreign key ("parent_id") references "pages" ("id") on delete set null)

A similar problem has been described here: Foreign key constraint may cause cycles or multiple cascade paths?

Anyone having an idea how I can fix this, without breaking the component?

Thnx, Armin.

P.S. I also filed an issue hoping to get teh developer's attraction: Link to Git issue

Nimral
  • 657
  • 8
  • 25

0 Answers0