Add price and product models
This commit is contained in:
1 parent
5dc1c9d9f0
commit
b4536e4c6b
6 files changed
+100
-36
No files matched your search
+6
-5
@@ -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