Skip to content

Instantly share code, notes, and snippets.

@TiagoSilvaPereira
Last active July 14, 2021 17:24
Show Gist options
  • Save TiagoSilvaPereira/667eba63e9f1898ea2cdf58b8b1b7007 to your computer and use it in GitHub Desktop.
Save TiagoSilvaPereira/667eba63e9f1898ea2cdf58b8b1b7007 to your computer and use it in GitHub Desktop.
Receipe items migration
<?php
// ...
public function up()
{
Schema::create('recipe_items', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('name');
$table->integer('quantity');
$table->string('unity', 8);
$table->unsignedBigInteger('recipe_id');
$table
->foreign('recipe_id')
->references('id')
->on('recipes')
->onDelete('CASCADE');
$table->timestamps();
});
}
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment