2021_07_06_130935_create_v_cards_table.php
1.71 KB
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
56
57
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateVCardsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('v_cards', function (Blueprint $table) {
$table->id();
$table->bigInteger('external_id');
$table->bigInteger('campaign_external_id');
$table->bigInteger('campaign_id')->unsigned();
$table->string('country')->nullable();
$table->string('city')->nullable();
$table->string('work_time')->nullable();
$table->json('phone')->nullable();
$table->string('street')->nullable();
$table->string('house')->nullable();
$table->string('building')->nullable();
$table->string('apartment')->nullable();
$table->json('instant_messenger')->nullable();
$table->string('company_name')->nullable();
$table->string('extra_message')->nullable();
$table->string('contact_email')->nullable();
$table->string('ogrn')->nullable();
$table->string('metro_station_id')->nullable();
$table->json('point_on_map')->nullable();
$table->string('contact_person')->nullable();
$table->foreign('campaign_id')->references('id')->on('campaigns')
->cascadeOnDelete();
$table->softDeletes();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('v_cards');
}
}