for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateClicksTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
Schema::create('clicks', function (Blueprint $table) {
$table->id();
$table->bigInteger('url_id')->unsigned();
$table->foreign('url_id')->references('id')->on('urls')->onDelete('cascade');
$table->string('country')->nullable();
$table->string('region')->nullable();
$table->string('city')->nullable();
$table->string('device_type')->nullable();
$table->string('device_brand')->nullable();
$table->string('device_model')->nullable();
$table->string('os')->nullable();
$table->string('browser')->nullable();
$table->text('referer')->nullable();
$table->string('referer_host')->nullable();
$table->text('user_agent')->nullable();
$table->dateTime('created_at');
});
}
* Reverse the migrations.
public function down()
Schema::dropIfExists('clicks');