fix(migrations): fix PostgresGrammar typeSet and skip MySQL triggers on PostgreSQL
This commit is contained in:
parent
368077449e
commit
ff3ceb9947
|
|
@ -48,11 +48,11 @@ public function up(): void
|
||||||
->comment('Giorni di preavviso necessari per la disdetta');
|
->comment('Giorni di preavviso necessari per la disdetta');
|
||||||
|
|
||||||
// Modalità disdetta
|
// Modalità disdetta
|
||||||
if (DB::connection()->getDriverName() === 'sqlite') {
|
if (DB::connection()->getDriverName() === 'mysql') {
|
||||||
$table->string('modalita_disdetta')->default('raccomandata_rr');
|
|
||||||
} else {
|
|
||||||
$table->set('modalita_disdetta', ['raccomandata', 'raccomandata_rr', 'pec', 'email', 'fax', 'mano'])
|
$table->set('modalita_disdetta', ['raccomandata', 'raccomandata_rr', 'pec', 'email', 'fax', 'mano'])
|
||||||
->default('raccomandata_rr');
|
->default('raccomandata_rr');
|
||||||
|
} else {
|
||||||
|
$table->string('modalita_disdetta')->default('raccomandata_rr');
|
||||||
}
|
}
|
||||||
$table->text('note_disdetta')->nullable()
|
$table->text('note_disdetta')->nullable()
|
||||||
->comment('Note specifiche per la disdetta');
|
->comment('Note specifiche per la disdetta');
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,10 @@
|
||||||
*/
|
*/
|
||||||
public function up(): void
|
public function up(): void
|
||||||
{
|
{
|
||||||
|
if (DB::connection()->getDriverName() !== 'mysql') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Verifica se abbiamo i privilegi per creare trigger
|
// Verifica se abbiamo i privilegi per creare trigger
|
||||||
try {
|
try {
|
||||||
DB::unprepared('SET SESSION log_bin_trust_function_creators = 1');
|
DB::unprepared('SET SESSION log_bin_trust_function_creators = 1');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user