1
0
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:
Matthew Hall 2020-05-20 09:00:21 -04:00
parent f8122d5fb3
commit dd9db08431
3 changed files with 19 additions and 5 deletions

View File

@ -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']);
}
});
}

View File

@ -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']);

View File

@ -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']);
});