[TASK] update migration
- float_precision - timestamp-default - add rollback
This commit is contained in:
parent
699709110e
commit
3d627e5508
@ -39,15 +39,16 @@ class InitializeDatabase extends Migration
|
||||
$table->string('short')->unique();
|
||||
$table->unsignedInteger('group_id');
|
||||
$table->foreign('group_id')->references('id')->on('groups');
|
||||
$table->float('content_size');
|
||||
$table->float('portion_size');
|
||||
$table->float('portion_price');
|
||||
$table->float('content_size', 8, 2);
|
||||
$table->float('portion_size', 8, 2);
|
||||
$table->float('portion_price', 8, 2);
|
||||
$table->unsignedInteger('content_dimension');
|
||||
$table->foreign('content_dimension')->references('id')->on('dimensions');
|
||||
$table->unsignedInteger('portion_dimension');
|
||||
$table->foreign('portion_dimension')->references('id')->on('dimensions');
|
||||
|
||||
$table->timestamps();
|
||||
$table->timestamp('created_at')->useCurrent();
|
||||
$table->timestamp('updated_at')->useCurrent();
|
||||
}
|
||||
);
|
||||
|
||||
@ -57,7 +58,8 @@ class InitializeDatabase extends Migration
|
||||
$table->increments('id');
|
||||
$table->string('name')->unique();
|
||||
|
||||
$table->timestamps();
|
||||
$table->timestamp('created_at')->useCurrent();
|
||||
$table->timestamp('updated_at')->useCurrent();
|
||||
}
|
||||
);
|
||||
|
||||
@ -71,7 +73,8 @@ class InitializeDatabase extends Migration
|
||||
$table->unsignedInteger('article_id');
|
||||
$table->foreign('article_id')->references('id')->on('articles');
|
||||
|
||||
$table->timestamps();
|
||||
$table->timestamp('created_at')->useCurrent();
|
||||
$table->timestamp('updated_at')->useCurrent();
|
||||
}
|
||||
);
|
||||
}
|
||||
@ -83,5 +86,12 @@ class InitializeDatabase extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
$builder = Capsule::schema();
|
||||
|
||||
$builder->drop('set_article');
|
||||
$builder->drop('sets');
|
||||
$builder->drop('articles');
|
||||
$builder->drop('groups');
|
||||
$builder->drop('dimensions');
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user