Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/cydrobolt/polr.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChaoyi Zha <summermontreal@gmail.com>2016-12-28 08:18:17 +0300
committerChaoyi Zha <summermontreal@gmail.com>2016-12-28 08:18:17 +0300
commitb8a1c7de44f52e08c45b598997ddfdd404a1a9b0 (patch)
tree2b382eb3dd6a17d3cc7d7f9d8200a7a315b02d8b /database
parenta2d4b8457c1ed0e77d46136ea7fac745445474ad (diff)
Add Click model for advanced analytics, add Setup settings, use Chart.js for charting, create stat pages and routes
Diffstat (limited to 'database')
-rw-r--r--database/migrations/2016_12_27_232934_create_clicks_table.php44
1 files changed, 44 insertions, 0 deletions
diff --git a/database/migrations/2016_12_27_232934_create_clicks_table.php b/database/migrations/2016_12_27_232934_create_clicks_table.php
new file mode 100644
index 0000000..fe45110
--- /dev/null
+++ b/database/migrations/2016_12_27_232934_create_clicks_table.php
@@ -0,0 +1,44 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class CreateClicksTable extends Migration
+{
+ /**
+ * Run the migrations.
+ *
+ * @return void
+ */
+ public function up()
+ {
+ Schema::create('clicks', function(Blueprint $table)
+ {
+ $table->engine = 'InnoDB';
+
+ $table->increments('id');
+ $table->string('ip');
+ $table->string('country')->nullable();
+ $table->string('referer')->nullable();
+ $table->string('referer_host')->nullable();
+ $table->text('user_agent')->nullable();
+
+ $table->index('ip');
+ $table->index('referer');
+ $table->integer('link_id')->unsigned();
+ $table->foreign('link_id')->references('id')->on('links')->onDelete('cascade');
+
+ $table->timestamps();
+ });
+ }
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::drop('clicks');
+ }
+}