update logic
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Capsule\Manager as Capsule;
|
||||
|
||||
class ArticleVariants extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$builder = Capsule::schema();
|
||||
|
||||
$builder->create(
|
||||
'variants',
|
||||
function ($table) {
|
||||
$table->increments('id');
|
||||
|
||||
$table->unsignedInteger('article_id');
|
||||
$table->foreign('article_id')->references('id')->on('articles');
|
||||
|
||||
$table->string('name');
|
||||
$table->string('short');
|
||||
$table->float('price', 8, 2);
|
||||
|
||||
$table->timestamps();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$builder = Capsule::schema();
|
||||
|
||||
$builder->drop('variants');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user