2015-11-04 02:59:39 +01:00
|
|
|
<?php
|
|
|
|
|
2015-11-05 23:34:43 +01:00
|
|
|
use Illuminate\Support\Facades\Schema;
|
2015-11-04 02:59:39 +01:00
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
|
|
|
|
class CreateLinkTable extends Migration
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Run the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function up()
|
|
|
|
{
|
|
|
|
Schema::create('links', function(Blueprint $table)
|
|
|
|
{
|
2015-11-05 23:34:43 +01:00
|
|
|
$table->engine = 'InnoDB';
|
|
|
|
|
2015-11-04 02:59:39 +01:00
|
|
|
$table->increments('id');
|
|
|
|
|
2015-11-05 23:34:43 +01:00
|
|
|
$table->string('short_url');
|
|
|
|
$table->longText('long_url');
|
2015-11-04 02:59:39 +01:00
|
|
|
$table->string('ip');
|
|
|
|
$table->string('creator');
|
2015-12-28 22:33:17 +01:00
|
|
|
$table->string('clicks')->default(0);
|
2015-11-04 02:59:39 +01:00
|
|
|
$table->string('secret_key');
|
|
|
|
|
2015-12-28 22:33:17 +01:00
|
|
|
$table->boolean('is_disabled')->default(0);
|
|
|
|
$table->boolean('is_custom')->default(0);
|
2016-01-29 20:58:49 +01:00
|
|
|
$table->boolean('is_api')->default(0);
|
2015-11-04 02:59:39 +01:00
|
|
|
|
|
|
|
$table->timestamps();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function down()
|
|
|
|
{
|
2015-11-05 23:34:43 +01:00
|
|
|
Schema::drop('links');
|
2015-11-04 02:59:39 +01:00
|
|
|
}
|
|
|
|
}
|