sistemazione migrate
This commit is contained in:
@@ -68,7 +68,7 @@ class ComuniSeeder extends Seeder
|
||||
];
|
||||
|
||||
foreach ($comuni as $c) {
|
||||
Comune::create($c);
|
||||
Comune::firstOrCreate(['codice_istat' => $c['codice_istat']], $c);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,23 +20,27 @@ class DatabaseSeeder extends Seeder
|
||||
DockerBaseDataSeeder::class,
|
||||
]);
|
||||
|
||||
$admin = User::create([
|
||||
'name' => 'Admin',
|
||||
'email' => 'admin@glastree.local',
|
||||
'password' => bcrypt('password'),
|
||||
'is_admin' => true,
|
||||
'status' => 'active',
|
||||
'permissions' => [
|
||||
'individui' => 2,
|
||||
'gruppi' => 2,
|
||||
'eventi' => 2,
|
||||
'documenti' => 2,
|
||||
'mailing' => 2,
|
||||
'viste' => 2,
|
||||
],
|
||||
]);
|
||||
$admin = User::firstOrCreate(
|
||||
['email' => 'admin@glastree.local'],
|
||||
[
|
||||
'name' => 'Admin',
|
||||
'password' => bcrypt('password'),
|
||||
'is_admin' => true,
|
||||
'status' => 'active',
|
||||
'permissions' => [
|
||||
'individui' => 2,
|
||||
'gruppi' => 2,
|
||||
'eventi' => 2,
|
||||
'documenti' => 2,
|
||||
'mailing' => 2,
|
||||
'viste' => 2,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$admin->role_preset_id = 1;
|
||||
$admin->save();
|
||||
if (!$admin->role_preset_id) {
|
||||
$admin->role_preset_id = 1;
|
||||
$admin->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -149,7 +149,7 @@ class DiocesiSeeder extends Seeder
|
||||
];
|
||||
|
||||
foreach ($diocesi as $d) {
|
||||
Diocesi::create($d);
|
||||
Diocesi::firstOrCreate(['nome' => $d['nome']], $d);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user