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>2017-02-08 03:50:40 +0300
committerChaoyi Zha <summermontreal@gmail.com>2017-02-08 03:50:40 +0300
commit38beec6e21aaf581cfd29cf9de0b738dee40fcea (patch)
treed36d9e551452a7893b304718d9aaebc19a99c835
parent51102d5e8e819fb17248f70e099fc11825a1e2f3 (diff)
Use an integer field rather than a string field to count clicks, fix #294
-rw-r--r--database/migrations/2017_02_08_003907_alter_link_clicks_to_integer.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/database/migrations/2017_02_08_003907_alter_link_clicks_to_integer.php b/database/migrations/2017_02_08_003907_alter_link_clicks_to_integer.php
new file mode 100644
index 0000000..9879d67
--- /dev/null
+++ b/database/migrations/2017_02_08_003907_alter_link_clicks_to_integer.php
@@ -0,0 +1,35 @@
+<?php
+
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class AlterLinkClicksToInteger extends Migration
+{
+ /**
+ * Run the migrations.
+ * Changes the "clicks" field in the link table to
+ * an integer field rather than a string field.
+ *
+ * @return void
+ */
+ public function up()
+ {
+ Schema::table('links', function (Blueprint $table)
+ {
+ $table->integer('clicks')->change();
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::table('links', function (Blueprint $table)
+ {
+ $table->string('clicks')->change();
+ });
+ }
+}