-
Notifications
You must be signed in to change notification settings - Fork 461
/
2018_07_09_053559_create_customers_table.php
55 lines (51 loc) · 1.85 KB
/
2018_07_09_053559_create_customers_table.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCustomersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
// https://developer.helpscout.com/mailbox-api/endpoints/customers/get/
Schema::create('customers', function (Blueprint $table) {
$table->increments('id');
$table->string('first_name', 255)->nullable();
$table->string('last_name', 255)->nullable();
$table->string('company', 255)->nullable();
$table->string('job_title', 255)->nullable();
$table->unsignedTinyInteger('photo_type')->nullable();
$table->string('photo_url', 255)->nullable();
// Age and gender do not exist in the web interface, but exist in the API
$table->string('age', 7)->nullable();
$table->unsignedTinyInteger('gender')->nullable();
$table->text('phones')->nullable(); // JSON
$table->text('websites')->nullable(); // JSON
$table->text('social_profiles')->nullable(); // JSON
$table->text('chats')->nullable(); // JSON
$table->text('background')->nullable();
$table->text('address')->nullable();
$table->string('city', 255)->nullable();
$table->string('state', 255)->nullable();
$table->string('zip', 12)->nullable();
$table->string('country', 2)->nullable();
$table->timestamps();
// Indexes
// For ajax search
$table->index(['first_name', 'last_name']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('customers');
}
}