tdt / core

Transform any dataset into an HTTP API with The DataTank
http://thedatatank.com
83 stars 31 forks source link

Not possible to create demo dataset with php artisan db:seed --class=DemoDataSeeder #429

Open ikzent opened 7 years ago

ikzent commented 7 years ago

Installation of datatank version 6.6. Standaard database postgres (create without any issues) Start php dataset ... The error gives the following issue as if the definitions where not found:

Output of the command ---


Do you really wish to run this command?

[Illuminate\Database\QueryException] SQLSTATE[23502]: Not null violation: 7 ERROR: null value in column "collection_uri" violates not-null constraint DETAIL: Failing row contains (1, null, null, null, null, 2017-02-07 12:37:16, 2017-02-07 12:37:16, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 5, null, null, null, null, null, null). (SQL: insert into "definitions" ("updated_at", " created_at") values (2017-02-07 12:37:16, 2017-02-07 12:37:16) returning "id")

db:seed [--class[="..."]] [--database[="..."]] [--force]

ikzent commented 7 years ago

The issue commes from the following issues. When the database is created all the tables, definitions labels ... was created with non null constraints. When inserting records in the different tables the datatank tries to create first the record without any fields and updates in the second instance the records with the correct fields. Postgres does not accept to insert the records without the proper restrictions and this result in failing inserting the records. The mysql database has probably other restrictions. A short term solution is to loosen the database definitions, the better solution is to insert in one insert not in two inserts