1
0
mirror of https://github.com/freescout-helpdesk/freescout.git synced 2024-11-25 03:43:33 +01:00

Merge pull request #617 from springboardVR/feature/postgres

Postgres Support
This commit is contained in:
FreeScout 2020-05-26 14:10:51 +05:45 committed by GitHub
commit 420245e66a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 5 deletions

View File

@ -39,7 +39,11 @@ class CreateCustomersTable extends Migration
// Indexes
// For ajax search
$table->index([DB::raw('first_name(80)'), DB::raw('last_name(80)')]);
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();
// https://github.com/laravel/framework/issues/9293#issuecomment-373229281
$table->unique([DB::raw('message_id(191)')], 'threads_message_id_index');
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
// https://github.com/laravel/framework/issues/9293#issuecomment-373229281
$table->index([DB::raw('message_id(191)')], 'send_logs_message_id_index');
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']);
});