diff options
author | Chaoyi Zha <summermontreal@gmail.com> | 2017-02-08 03:50:40 +0300 |
---|---|---|
committer | Chaoyi Zha <summermontreal@gmail.com> | 2017-02-08 03:50:40 +0300 |
commit | 38beec6e21aaf581cfd29cf9de0b738dee40fcea (patch) | |
tree | d36d9e551452a7893b304718d9aaebc19a99c835 | |
parent | 51102d5e8e819fb17248f70e099fc11825a1e2f3 (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.php | 35 |
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(); + }); + } +} |