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

Exception occur PDOException: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: 'THE DATE' for column 'created_at' #27

Open
MDaskalovAtBE opened this issue Apr 18, 2020 · 2 comments

Comments

@MDaskalovAtBE
Copy link

Firstly - Great Tool! It helps a lot.

Secondly - There is some issues with the generated timestamps in the seeders. When
$ CompaniesBreadTypeAdded.php

\DB::table('data_types')->insert([
  ...
  'created_at' => '2020-04-18T18:58:51.000000Z'
]);

is executed generates Exception occur PDOException: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '2020-04-18T18:44:23.000000Z' for column 'created_at'

temp fix is to just set it to null but be really happy if that gets fixed.

A small suggestion for a good improvement could be using the Voyager's build in DataRow and DataType models rather than the \DB.

@DrudgeRajen
Copy link
Owner

DrudgeRajen commented Apr 28, 2020

@MDaskalovAtBE Thanks :)

PR would be great?

@igibek
Copy link

igibek commented May 23, 2020

I have the same problem. Running php artisan db:seed --class=VoyagerDeploymentOrchestratorSeeder throws PDOException: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '2020-05-22T19:34:39.000000Z' for column 'created_at' at row 1

This is happening in Laravel >= 7 because of json date serialization updated. More here: https://laravel.com/docs/7.x/upgrade#date-serialization

MrCrayon added a commit to MrCrayon/voyager-deployment-orchestrator that referenced this issue Aug 13, 2020
MrCrayon added a commit to MrCrayon/voyager-deployment-orchestrator that referenced this issue Aug 13, 2020
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

3 participants