Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ikzent opened this issue Feb 7, 2017 · 1 comment

Comments

@ikzent
Copy link

ikzent commented Feb 7, 2017

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 ---


  • Application In Production!     *
    

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
Copy link
Author

ikzent commented Feb 7, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant