mirror of
https://github.com/freescout-helpdesk/freescout.git
synced 2024-11-24 03:12:46 +01:00
Postgres support
This commit is contained in:
parent
f8122d5fb3
commit
dd9db08431
@ -39,7 +39,11 @@ class CreateCustomersTable extends Migration
|
||||
|
||||
// Indexes
|
||||
// For ajax search
|
||||
if (DB::connection()->getPDO()->getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql') {
|
||||
$table->index([DB::raw('first_name(80)'), DB::raw('last_name(80)')]);
|
||||
} else {
|
||||
$table->index(['first_name', 'last_name']);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -71,8 +71,13 @@ class CreateThreadsTable extends Migration
|
||||
$table->timestamp('opened_at')->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
if (DB::connection()->getPDO()->getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql') {
|
||||
// https://github.com/laravel/framework/issues/9293#issuecomment-373229281
|
||||
$table->unique([DB::raw('message_id(191)')], 'threads_message_id_index');
|
||||
} else {
|
||||
$table->unique('message_id', 'threads_message_id_index');
|
||||
}
|
||||
|
||||
// On conversation page
|
||||
$table->index(['conversation_id', 'type', 'from', 'customer_id']);
|
||||
$table->index(['conversation_id', 'created_at']);
|
||||
|
@ -31,8 +31,13 @@ class CreateSendLogsTable extends Migration
|
||||
$table->timestamps();
|
||||
|
||||
// Indexes
|
||||
if (DB::connection()->getPDO()->getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql') {
|
||||
// https://github.com/laravel/framework/issues/9293#issuecomment-373229281
|
||||
$table->index([DB::raw('message_id(191)')], 'send_logs_message_id_index');
|
||||
} else {
|
||||
$table->index(['message_id'], 'send_logs_message_id_index');
|
||||
}
|
||||
|
||||
// Used when sending auto reply
|
||||
$table->index(['customer_id', 'mail_type', 'created_at']);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user