| Total Complexity | 2 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class CreateClicksTable extends Migration |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Run the migrations. |
||
| 11 | * |
||
| 12 | * @return void |
||
| 13 | */ |
||
| 14 | public function up() |
||
| 15 | { |
||
| 16 | Schema::create('clicks', function (Blueprint $table) { |
||
| 17 | $table->id(); |
||
| 18 | $table->bigInteger('url_id')->unsigned(); |
||
| 19 | $table->foreign('url_id')->references('id')->on('urls')->onDelete('cascade'); |
||
| 20 | $table->string('country')->nullable(); |
||
| 21 | $table->string('region')->nullable(); |
||
| 22 | $table->string('city')->nullable(); |
||
| 23 | $table->string('device_type')->nullable(); |
||
| 24 | $table->string('device_brand')->nullable(); |
||
| 25 | $table->string('device_model')->nullable(); |
||
| 26 | $table->string('os')->nullable(); |
||
| 27 | $table->string('browser')->nullable(); |
||
| 28 | $table->text('referer')->nullable(); |
||
| 29 | $table->string('referer_host')->nullable(); |
||
| 30 | $table->text('user_agent')->nullable(); |
||
| 31 | $table->dateTime('created_at'); |
||
| 32 | }); |
||
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Reverse the migrations. |
||
| 37 | * |
||
| 38 | * @return void |
||
| 39 | */ |
||
| 40 | public function down() |
||
| 41 | { |
||
| 42 | Schema::dropIfExists('clicks'); |
||
| 43 | } |
||
| 45 |