Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
drbyte
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, i've been getting this Error while running CreatePermissionTables migration
Log:
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '45-2' for key 'PRIMARY' (Connection: mysql, SQL: insert into 'role_has_permissions' ('permission_id', 'role_id') values (37, 2), (45, 2), (49, 2), (53, 2), (54, 2), (55, 2), (56, 2), (57, 2), (61, 2), (62, 2), (63, 2), (64, 2), (69, 2), (70, 2), (71, 2), (72, 2), (73, 2), (81, 2), (82, 2), (83, 2), (84, 2), (85, 2), (101, 2), (102, 2), (103, 2), (104, 2), (105, 2), (106, 2), (107, 2), (108, 2), (45, 2), (78, 2), (115, 2), (120, 2))
Here's the migration Permission Code:
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
return new class extends Migration
{
public function up(): void
{
$teams = config('permission.teams');
$tableNames = config('permission.table_names');
$columnNames = config('permission.column_names');
$pivotRole = $columnNames['role_pivot_key'] ?? 'role_id';
$pivotPermission = $columnNames['permission_pivot_key'] ?? 'permission_id';
};`
Beta Was this translation helpful? Give feedback.
All reactions