Add price and product models
This commit is contained in:
@@ -17,11 +17,12 @@ $capsule->addConnection([
|
||||
]);
|
||||
$capsule->setAsGlobal();
|
||||
|
||||
if (!Capsule::schema()->hasTable('product')) {
|
||||
Capsule::schema()->create('product', function (Blueprint $table) {
|
||||
if (!Capsule::schema()->hasTable('products')) {
|
||||
Capsule::schema()->create('products', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('name');
|
||||
$table->string('skuID');
|
||||
$table->integer('skuID')->unique();
|
||||
$table->integer('agilityID');
|
||||
$table->integer('availableQuantity');
|
||||
$table->integer('stock');
|
||||
$table->json('categories');
|
||||
@@ -35,8 +36,8 @@ if (!Capsule::schema()->hasTable('product')) {
|
||||
}
|
||||
|
||||
|
||||
if (!Capsule::schema()->hasTable('price')) {
|
||||
Capsule::schema()->create('price', function (Blueprint $table) {
|
||||
if (!Capsule::schema()->hasTable('prices')) {
|
||||
Capsule::schema()->create('prices', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->foreignId('product_id');
|
||||
$table->float('price');
|
||||
|
||||
Reference in New Issue
Block a user