[PROMOÇÃO] Assine com + 30% de desconto ANUAL MENSAL (últimas horas)
Thiago Planet da Silva
Criador Thiago Planet da Silva 31/05/2021

Estou com erro ao tentar gerar

 php artisan migrate:refresh --seed

Criador Thiago Planet da Silva 31/05/2021

 Illuminate\Database\QueryException  : SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'Businers' for key 'plans_name_unique' (SQL: insert into `plans` (`name`, `url`, `price`, `description`, `updated_at`, `created_at`) values (Businers, businers, 499.99, Plano Empresarial, 2021-05-31 12:03:13, 2021-05-31 12:03:13))

  at C:\larafood\vendor\laravel\framework\src\Illuminate\Database\Connection.php:669

    665|         // If an exception occurs when attempting to run a query, we'll format the error

    666|         // message to include the bindings with SQL, which will make this exception a   

    667|         // lot more helpful to the developer instead of just the database's errors.     

    668|         catch (Exception $e) {

  > 669|             throw new QueryException(

Thiago Planet da Silva
Manager Carlos Ferreira 31/05/2021

Olá, Thiago!
Tudo bem?

Tem o projeto no GitHub?
Quero ver como está os seus arquivos de migration.

Roda esse comando:
php artisa migrate:fresh --seed

Carlos Ferreira
Criador Thiago Planet da Silva 31/05/2021

Não deu erro, porem também não criou os seeds.

PS C:\larafood> php artisan migrate:fresh --seed

Dropped all tables successfully.

Migration table created successfully.

Migrating: 2014_05_11_131051_create_plans_table

Migrated:  2014_05_11_131051_create_plans_table (0.15 seconds)

Migrating: 2014_05_27_134414_create_tenants_table

Migrated:  2014_05_27_134414_create_tenants_table (0.25 seconds)

Migrating: 2014_10_12_000000_create_users_table

Migrated:  2014_10_12_000000_create_users_table (0.11 seconds)

Migrating: 2014_10_12_100000_create_password_resets_table

Migrated:  2014_10_12_100000_create_password_resets_table (0.08 seconds)

Migrating: 2019_08_19_000000_create_failed_jobs_table

Migrated:  2019_08_19_000000_create_failed_jobs_table (0.03 seconds)

Migrating: 2021_05_17_142027_create_detail_plans_table

Migrated:  2021_05_17_142027_create_detail_plans_table (0.09 seconds)

Migrating: 2021_05_18_202256_create_profiles_table

Migrated:  2021_05_18_202256_create_profiles_table (0.05 seconds)

Migrating: 2021_05_22_104955_create_permissions_table

Migrated:  2021_05_22_104955_create_permissions_table (0.05 seconds)

Migrating: 2021_05_22_121751_create_permission_profile_table

Migrated:  2021_05_22_121751_create_permission_profile_table (0.15 seconds)

Migrating: 2021_05_26_133730_create_plan_profile_table

Migrated:  2021_05_26_133730_create_plan_profile_table (0.16 seconds)

Database seeding completed successfully.

PS C:\larafood>

Thiago Planet da Silva
Manager Carlos Ferreira 31/05/2021

Tem o projeto no GitHub? Posso dá uma olhada para você amigo.

Não roda nem com esse comando?
php artisan db:seed

Carlos Ferreira
Criador Thiago Planet da Silva 31/05/2021

Não funciona também.

Segue o link do github.

https://github.com/thiagoplanet/larafood 

Thiago Planet da Silva
Manager Carlos Ferreira 31/05/2021

Lá no seu DatabaseSeeder no método call, passe um array e tente novamente:
$this->call([
    PlansTableSeeder::class,
    TenantsTableSeeder::class,
    UsersTableSeeder::class
]);

Carlos Ferreira
Sabe a Solução? Ajude a resolver!

Precisa estar logado para conseguir responder a este ticket!

Clique Aqui Para Entrar!