LinkStack/database/migrations/2021_03_18_082008_create_li...

43 lines
1.2 KiB
PHP
Raw Normal View History

2021-04-16 01:00:00 +02:00
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateLinksTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('links', function (Blueprint $table) {
$table->id();
$table->text('link');
2021-07-06 10:43:56 +02:00
$table->string('title');
$table->integer('order')->default(0);
2021-04-16 01:00:00 +02:00
$table->integer('click_number')->default(0);
$table->enum('up_link', ['yes', 'no'])->default('no');
$table->unsignedbigInteger('user_id');
$table->unsignedbigInteger('button_id');
$table->foreign('user_id')->references('id')->on('users');
$table->foreign('button_id')->references('id')->on('buttons');
$table->timestamps();
$table->string('custom_css')->default('');
$table->string('custom_icon')->default('fa-external-link');
2021-04-16 01:00:00 +02:00
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('links');
}
}