devaslanphp / project-management

An open source Project management tool based on Laravel and Filament
https://devaslanphp.github.io/project-management
MIT License
681 stars 188 forks source link

Seeder terminates with an error #92

Closed akinoriakatsuka closed 11 months ago

akinoriakatsuka commented 11 months ago

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 commented 11 months ago

Hey,

The problem is that the locked field doesn't have a default value. Fixed in this PR https://github.com/devaslanphp/project-management/pull/93 . Now it should be fine. Do a fresh install of the project .

akinoriakatsuka commented 11 months ago

Thanks a lot.

I'll try to see if it works.

akinoriakatsuka commented 11 months ago

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