Files
lelong/database/migrations/2022_08_30_125405_create_filemarhun_table.php
T
2022-09-05 09:09:21 +08:00

40 lines
1.0 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\DB;
class CreateFilemarhunTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('filemarhun', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedBigInteger('lelongbid_id')->unsigned();
$table->unsignedBigInteger('lelongbidmarhun_id')->unsigned()->nullable();
$table->unsignedBigInteger('photo_type')->unsigned();
$table->string('file_type');
$table->timestamps();
});
// once the table is created use a raw query to ALTER it and add the MEDIUMBLOB
DB::statement("ALTER TABLE filemarhun ADD filename LONGBLOB");
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('filemarhun');
}
}