Guest User

Untitled

a guest
Mar 7th, 2017
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. Schema::create('products', function (Blueprint $table) {
  2. $table->increments('id');
  3. $table->string('name');
  4. $table->float('trade_price', 8, 2);
  5. $table->float('sell_price', 8, 2);
  6. $table->integer('quantity');
  7. $table->integer('shop_id')->unsigned();
  8. $table->foreign('shop_id')->references('id')->on('shops');
  9. $table->integer('category_id')->unsigned();
  10. $table->foreign('category_id')->references('id')->on('categories');
  11. $table->timestamps();
  12. });
  13.  
  14. Schema::create('shops', function (Blueprint $table) {
  15. $table->increments('id');
  16. $table->string('name');
  17. $table->string('address');
  18. $table->timestamps();
  19. });
Advertisement
Add Comment
Please, Sign In to add comment