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

Seeder terminates with an error #92

Closed
akinoriakatsuka opened this issue Sep 14, 2023 · 3 comments
Closed

Seeder terminates with an error #92

akinoriakatsuka opened this issue Sep 14, 2023 · 3 comments
Assignees

Comments

@akinoriakatsuka
Copy link

Hello.
I am very interested in this project.

Now, I am facing a problem in installing this project.

I was following the below steps to install the project, but Seeder terminated with an error.

https://devaslanphp.github.io/project-management/#/installation?id=database

The error is as follows.

  SQLSTATE[HY000]: General error: 1364 Field 'locked' doesn't have a default value (SQL: insert into `settings` (`created_at`, `group`, `name`, `payload`, `updated_at`) values (2023-09-14 23:42:47, general, site_name, "Helper", 2023-09-14 23:42:47), (2023-09-14 23:42:47, general, enable_registration, true, 2023-09-14 23:42:47), (2023-09-14 23:42:47, general, site_logo, null, 2023-09-14 23:42:47), (2023-09-14 23:42:47, general, enable_social_login, "1", 2023-09-14 23:42:47), (2023-09-14 23:42:47, general, site_language, "en", 2023-09-14 23:42:47), (2023-09-14 23:42:47, general, default_role, "1", 2023-09-14 23:42:47), (2023-09-14 23:42:47, general, enable_login_form, "1", 2023-09-14 23:42:47), (2023-09-14 23:42:47, general, enable_oidc_login, "1", 2023-09-14 23:42:47) on duplicate key update `payload` = values(`payload`), `updated_at` = values(`updated_at`))

  at vendor/laravel/framework/src/Illuminate/Database/Connection.php:760
    756▕         // If an exception occurs when attempting to run a query, we'll format the error
    757▕         // message to include the bindings with SQL, which will make this exception a
    758▕         // lot more helpful to the developer instead of just the database's errors.
    759▕         catch (Exception $e) {
  ➜ 760▕             throw new QueryException(
    761▕                 $query, $this->prepareBindings($bindings), $e
    762▕             );
    763▕         }
    764▕     }

      +10 vendor frames 
  11  database/seeders/PermissionsSeeder.php:71
      Spatie\LaravelSettings\Settings::save()

      +8 vendor frames 
  20  database/seeders/DatabaseSeeder.php:17
      Illuminate\Database\Seeder::call()

This error says that the 'locked' column is not specified when inserting into the settings table and there is no default value.

I need help in resolving this issue.

Thanks in advance.

@mihaisolomon
Copy link
Collaborator

Hey,

The problem is that the locked field doesn't have a default value. Fixed in this PR #93 . Now it should be fine. Do a fresh install of the project .

@akinoriakatsuka
Copy link
Author

Thanks a lot.

I'll try to see if it works.

@akinoriakatsuka
Copy link
Author

After refreshing the database, I ran the seeder and it terminated successfully.
Thank you very much.

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

2 participants