mirror of
https://github.com/brunofontes/shareit.git
synced 2025-11-15 16:00:54 -03:00
Imrpoving Item, Product and Users
This commit is contained in:
@@ -16,7 +16,7 @@ class CreateProductsTable extends Migration
|
||||
Schema::create('products', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('name');
|
||||
$table->integer('adminID');
|
||||
$table->integer('admin_id');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -16,9 +16,9 @@ class CreateItemsTable extends Migration
|
||||
Schema::create('items', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('name');
|
||||
$table->integer('productID');
|
||||
$table->integer('usedBy');
|
||||
$table->dateTime('usedSince');
|
||||
$table->integer('product_id');
|
||||
$table->integer('usedBy')->nullable();
|
||||
$table->dateTime('usedSince')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class UsersPerItem extends Migration
|
||||
class ItemUser extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
@@ -13,10 +13,10 @@ class UsersPerItem extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('users_per_item', function (Blueprint $table) {
|
||||
Schema::create('item_user', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('productID');
|
||||
$table->integer('userID');
|
||||
$table->integer('item_id');
|
||||
$table->integer('user_id');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
@@ -28,6 +28,6 @@ class UsersPerItem extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('users_per_item');
|
||||
Schema::dropIfExists('item_user');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user