diff --git a/database/migrations/2020_04_20_212813_create_shop_article_attribute_families_table.php b/database/migrations/2020_04_20_212813_create_shop_article_attribute_families_table.php deleted file mode 100644 index 94d462c1..00000000 --- a/database/migrations/2020_04_20_212813_create_shop_article_attribute_families_table.php +++ /dev/null @@ -1,32 +0,0 @@ -integer('id', true); - $table->string('name', 50)->nullable(); - $table->timestamps(); - $table->softDeletes(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('shop_article_attribute_families'); - } -} diff --git a/database/migrations/2020_04_20_212813_create_shop_article_attribute_values_table.php b/database/migrations/2020_04_20_212813_create_shop_article_attribute_values_table.php deleted file mode 100644 index 022af308..00000000 --- a/database/migrations/2020_04_20_212813_create_shop_article_attribute_values_table.php +++ /dev/null @@ -1,32 +0,0 @@ -integer('id')->unsigned()->nullable(); - $table->integer('attribute_family_id')->unsigned()->nullable(); - $table->boolean('type_value')->nullable()->comment('1 = INT, 2 = DECIMAL, 3 = STRING'); - $table->string('value', 50)->nullable(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('shop_article_attribute_values'); - } -} diff --git a/database/migrations/2020_04_20_212813_create_shop_article_attributes_table.php b/database/migrations/2020_04_20_212813_create_shop_article_attributes_table.php deleted file mode 100644 index 255fef55..00000000 --- a/database/migrations/2020_04_20_212813_create_shop_article_attributes_table.php +++ /dev/null @@ -1,31 +0,0 @@ -integer('id')->unsigned()->nullable(); - $table->integer('article_id')->unsigned()->nullable(); - $table->integer('attribute_value_id')->unsigned()->nullable(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('shop_article_attributes'); - } -} diff --git a/database/migrations/2020_04_20_212813_create_shop_article_categories_table.php b/database/migrations/2020_04_20_212813_create_shop_article_categories_table.php deleted file mode 100644 index 1f1bfb58..00000000 --- a/database/migrations/2020_04_20_212813_create_shop_article_categories_table.php +++ /dev/null @@ -1,31 +0,0 @@ -increments('id'); - $table->integer('article_id')->unsigned()->nullable(); - $table->integer('category_id')->unsigned()->nullable(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('shop_article_categories'); - } -} diff --git a/database/migrations/2020_04_20_212813_create_shop_article_prices_table.php b/database/migrations/2020_04_20_212813_create_shop_article_prices_table.php deleted file mode 100644 index 9dd9a0e9..00000000 --- a/database/migrations/2020_04_20_212813_create_shop_article_prices_table.php +++ /dev/null @@ -1,31 +0,0 @@ -increments('id'); - $table->integer('article_attribute_id')->unsigned()->nullable(); - $table->decimal('price', 10)->nullable(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('shop_article_prices'); - } -} diff --git a/database/migrations/2020_04_20_212813_create_shop_categories_table.php b/database/migrations/2020_04_20_212813_create_shop_categories_table.php deleted file mode 100644 index 1113b60d..00000000 --- a/database/migrations/2020_04_20_212813_create_shop_categories_table.php +++ /dev/null @@ -1,32 +0,0 @@ -increments('id'); - $table->integer('category_id')->unsigned()->nullable(); - $table->string('name', 50)->nullable(); - $table->text('description', 65535)->nullable(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('shop_categories'); - } -} diff --git a/database/migrations/2020_04_20_212813_create_shop_customers_table.php b/database/migrations/2020_04_20_212813_create_shop_customers_table.php deleted file mode 100644 index be694aea..00000000 --- a/database/migrations/2020_04_20_212813_create_shop_customers_table.php +++ /dev/null @@ -1,38 +0,0 @@ -increments('id'); - $table->uuid('uuid')->nullable(); - $table->string('first_name')->nullable(); - $table->string('last_name')->nullable(); - $table->string('email')->unique(); - $table->dateTime('email_verified_at')->nullable(); - $table->string('password'); - $table->string('remember_token', 100)->nullable(); - $table->timestamps(); - $table->softDeletes(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('shop_customers'); - } -} diff --git a/database/migrations/2020_04_20_212813_create_shop_invoice_items_table.php b/database/migrations/2020_04_20_212813_create_shop_invoice_items_table.php deleted file mode 100644 index 8a4e57be..00000000 --- a/database/migrations/2020_04_20_212813_create_shop_invoice_items_table.php +++ /dev/null @@ -1,41 +0,0 @@ -increments('id'); - $table->integer('invoice_id')->nullable(); - $table->integer('product_id')->nullable(); - $table->integer('status')->nullable(); - $table->integer('quantity')->nullable(); - $table->decimal('unit_price', 10); - $table->integer('tax_id')->nullable(); - $table->integer('raw_price')->nullable(); - $table->integer('tax')->nullable(); - $table->integer('total_price')->nullable(); - $table->decimal('discount_percent')->nullable(); - $table->decimal('discount')->nullable(); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('shop_invoice_items'); - } -} diff --git a/database/migrations/2020_04_20_212813_create_shop_order_payments_table.php b/database/migrations/2020_04_20_212813_create_shop_order_payments_table.php deleted file mode 100644 index ac946f17..00000000 --- a/database/migrations/2020_04_20_212813_create_shop_order_payments_table.php +++ /dev/null @@ -1,31 +0,0 @@ -increments('id'); - $table->integer('order_id')->nullable(); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('shop_order_payments'); - } -} diff --git a/database/migrations/2023_10_17_153458_modify_shop_article_natures_table.php b/database/migrations/2023_10_17_153458_modify_shop_article_natures_table.php deleted file mode 100644 index b0c00618..00000000 --- a/database/migrations/2023_10_17_153458_modify_shop_article_natures_table.php +++ /dev/null @@ -1,15 +0,0 @@ -string('slug', 50)->after('name')->nullable(); - }); - } -}; diff --git a/database/migrations/2020_04_20_212813_create_botanic_families_table.php b/database/migrations/shop/2020_04_20_212813_create_botanic_families_table.php similarity index 100% rename from database/migrations/2020_04_20_212813_create_botanic_families_table.php rename to database/migrations/shop/2020_04_20_212813_create_botanic_families_table.php diff --git a/database/migrations/2020_04_20_212813_create_botanic_genres_table.php b/database/migrations/shop/2020_04_20_212813_create_botanic_genres_table.php similarity index 100% rename from database/migrations/2020_04_20_212813_create_botanic_genres_table.php rename to database/migrations/shop/2020_04_20_212813_create_botanic_genres_table.php diff --git a/database/migrations/2020_04_20_212813_create_botanic_species_table.php b/database/migrations/shop/2020_04_20_212813_create_botanic_species_table.php similarity index 100% rename from database/migrations/2020_04_20_212813_create_botanic_species_table.php rename to database/migrations/shop/2020_04_20_212813_create_botanic_species_table.php diff --git a/database/migrations/2020_04_20_212813_create_botanic_varieties_table.php b/database/migrations/shop/2020_04_20_212813_create_botanic_varieties_table.php similarity index 100% rename from database/migrations/2020_04_20_212813_create_botanic_varieties_table.php rename to database/migrations/shop/2020_04_20_212813_create_botanic_varieties_table.php diff --git a/database/migrations/shop/2024_01_22_224325_create_shop_article_natures_table.php b/database/migrations/shop/2024_01_22_224325_create_shop_article_natures_table.php new file mode 100644 index 00000000..97430e42 --- /dev/null +++ b/database/migrations/shop/2024_01_22_224325_create_shop_article_natures_table.php @@ -0,0 +1,39 @@ +integer('id', true); + $table->unsignedTinyInteger('product_type')->nullable()->index('product_type')->comment('1 Botanic, 2 Merchandise'); + $table->string('name', 50)->nullable(); + $table->string('slug', 50)->nullable(); + $table->text('description')->nullable(); + $table->unsignedSmallInteger('created_by')->nullable(); + $table->unsignedSmallInteger('updated_by')->nullable(); + $table->unsignedSmallInteger('deleted_by')->nullable(); + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('shop_article_natures'); + } +}; diff --git a/database/migrations/shop/2024_01_22_224325_create_shop_articles_table.php b/database/migrations/shop/2024_01_22_224325_create_shop_articles_table.php new file mode 100644 index 00000000..afb58b53 --- /dev/null +++ b/database/migrations/shop/2024_01_22_224325_create_shop_articles_table.php @@ -0,0 +1,46 @@ +increments('id'); + $table->unsignedInteger('article_nature_id')->nullable()->index('family_id'); + $table->string('product_type', 100)->nullable(); + $table->unsignedInteger('product_id')->nullable(); + $table->string('ref', 50)->nullable()->unique('ref'); + $table->string('name')->nullable(); + $table->unsignedInteger('hash')->nullable(); + $table->text('description')->nullable(); + $table->tinyInteger('visible')->nullable(); + $table->unsignedTinyInteger('homepage')->nullable(); + $table->unsignedSmallInteger('created_by')->nullable(); + $table->unsignedSmallInteger('updated_by')->nullable(); + $table->unsignedSmallInteger('deleted_by')->nullable(); + $table->timestamps(); + $table->softDeletes(); + + $table->index(['product_type', 'product_id'], 'product_type'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('shop_articles'); + } +}; diff --git a/database/migrations/shop/2024_01_22_224325_create_shop_categories_table.php b/database/migrations/shop/2024_01_22_224325_create_shop_categories_table.php new file mode 100644 index 00000000..12bc4f1a --- /dev/null +++ b/database/migrations/shop/2024_01_22_224325_create_shop_categories_table.php @@ -0,0 +1,40 @@ +increments('id'); + $table->unsignedInteger('category_id')->nullable()->index('category_id'); + $table->string('name', 50)->nullable(); + $table->text('description')->nullable(); + $table->tinyInteger('visible')->nullable(); + $table->unsignedTinyInteger('homepage')->nullable(); + $table->unsignedSmallInteger('created_by')->nullable(); + $table->unsignedSmallInteger('updated_by')->nullable(); + $table->unsignedSmallInteger('deleted_by')->nullable(); + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('shop_categories'); + } +}; diff --git a/database/migrations/2022_03_29_212813_create_shop_homepages_table.php b/database/migrations/shop/2024_01_22_224325_create_shop_contents_table.php similarity index 77% rename from database/migrations/2022_03_29_212813_create_shop_homepages_table.php rename to database/migrations/shop/2024_01_22_224325_create_shop_contents_table.php index ae2f2d21..003ef98c 100644 --- a/database/migrations/2022_03_29_212813_create_shop_homepages_table.php +++ b/database/migrations/shop/2024_01_22_224325_create_shop_contents_table.php @@ -2,8 +2,9 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; -class CreateShopHomepagesTable extends Migration +return new class extends Migration { /** * Run the migrations. @@ -12,7 +13,7 @@ class CreateShopHomepagesTable extends Migration */ public function up() { - Schema::create('shop_homepages', function (Blueprint $table) { + Schema::create('shop_contents', function (Blueprint $table) { $table->increments('id'); $table->text('text'); $table->unsignedSmallInteger('created_by')->nullable(); @@ -30,6 +31,6 @@ class CreateShopHomepagesTable extends Migration */ public function down() { - Schema::drop('shop_homepages'); + Schema::dropIfExists('shop_contents'); } -} +}; diff --git a/database/migrations/shop/2024_01_22_224325_create_shop_customer_addresses_table.php b/database/migrations/shop/2024_01_22_224325_create_shop_customer_addresses_table.php new file mode 100644 index 00000000..ec8a3624 --- /dev/null +++ b/database/migrations/shop/2024_01_22_224325_create_shop_customer_addresses_table.php @@ -0,0 +1,41 @@ +increments('id'); + $table->unsignedInteger('customer_id')->nullable()->index('customer_id'); + $table->unsignedTinyInteger('priority')->nullable(); + $table->unsignedTinyInteger('type')->nullable(); + $table->string('name', 50)->nullable(); + $table->string('address')->nullable(); + $table->string('address2')->nullable(); + $table->string('zipcode', 30)->nullable(); + $table->string('city', 50)->nullable(); + $table->string('country', 50)->nullable(); + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('shop_customer_addresses'); + } +}; diff --git a/database/migrations/2020_04_20_212813_create_shop_article_components_table.php b/database/migrations/shop/2024_01_22_224325_create_shop_customer_deliveries_table.php similarity index 55% rename from database/migrations/2020_04_20_212813_create_shop_article_components_table.php rename to database/migrations/shop/2024_01_22_224325_create_shop_customer_deliveries_table.php index 300b6a7b..89367eee 100644 --- a/database/migrations/2020_04_20_212813_create_shop_article_components_table.php +++ b/database/migrations/shop/2024_01_22_224325_create_shop_customer_deliveries_table.php @@ -2,8 +2,9 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; -class CreateShopArticleComponentsTable extends Migration +return new class extends Migration { /** * Run the migrations. @@ -12,10 +13,10 @@ class CreateShopArticleComponentsTable extends Migration */ public function up() { - Schema::create('shop_article_components', function (Blueprint $table) { + Schema::create('shop_customer_deliveries', function (Blueprint $table) { $table->increments('id'); - $table->integer('article_id')->unsigned()->nullable(); - $table->string('model')->nullable(); + $table->unsignedInteger('customer_id')->default(0)->index('customer_id'); + $table->integer('delivery_id')->default(0); $table->timestamps(); $table->softDeletes(); }); @@ -28,6 +29,6 @@ class CreateShopArticleComponentsTable extends Migration */ public function down() { - Schema::drop('shop_article_components'); + Schema::dropIfExists('shop_customer_deliveries'); } -} +}; diff --git a/database/migrations/shop/2024_01_22_224325_create_shop_customer_sale_channels_table.php b/database/migrations/shop/2024_01_22_224325_create_shop_customer_sale_channels_table.php new file mode 100644 index 00000000..a73eae68 --- /dev/null +++ b/database/migrations/shop/2024_01_22_224325_create_shop_customer_sale_channels_table.php @@ -0,0 +1,37 @@ +increments('id'); + $table->unsignedInteger('customer_id')->nullable()->index('customer_id'); + $table->unsignedInteger('sale_channel_id')->nullable()->index('sale_channel_id'); + $table->unsignedInteger('created_by')->nullable(); + $table->unsignedInteger('updated_by')->nullable(); + $table->unsignedInteger('deleted_by')->nullable(); + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('shop_customer_sale_channels'); + } +}; diff --git a/database/migrations/shop/2024_01_22_224325_create_shop_customers_table.php b/database/migrations/shop/2024_01_22_224325_create_shop_customers_table.php new file mode 100644 index 00000000..1d725844 --- /dev/null +++ b/database/migrations/shop/2024_01_22_224325_create_shop_customers_table.php @@ -0,0 +1,52 @@ +mediumIncrements('id'); + $table->char('uuid', 36)->nullable()->index('uuid'); + $table->boolean('active')->default(false); + $table->string('first_name')->nullable(); + $table->string('last_name')->nullable(); + $table->string('company')->nullable(); + $table->string('tva')->nullable(); + $table->string('phone')->nullable(); + $table->string('address')->nullable(); + $table->string('address2')->nullable(); + $table->string('zipcode', 30)->nullable(); + $table->string('city', 50)->nullable(); + $table->string('country', 50)->nullable(); + $table->string('email')->unique('users_email_unique'); + $table->timestamp('email_verified_at')->nullable(); + $table->string('password'); + $table->rememberToken(); + $table->json('settings')->nullable(); + $table->dateTime('last_login')->nullable(); + $table->boolean('verified')->default(false); + $table->string('verification_token')->nullable(); + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('shop_customers'); + } +}; diff --git a/database/migrations/shop/2024_01_22_224325_create_shop_deliveries_table.php b/database/migrations/shop/2024_01_22_224325_create_shop_deliveries_table.php new file mode 100644 index 00000000..bd47c6ac --- /dev/null +++ b/database/migrations/shop/2024_01_22_224325_create_shop_deliveries_table.php @@ -0,0 +1,48 @@ +increments('id'); + $table->unsignedInteger('sale_channel_id')->nullable()->index('sale_channel_id'); + $table->unsignedTinyInteger('active')->nullable()->index('active'); + $table->unsignedTinyInteger('is_public')->nullable(); + $table->unsignedTinyInteger('at_house')->nullable(); + $table->string('name', 50)->nullable(); + $table->text('description')->nullable(); + $table->string('address')->nullable(); + $table->string('address2')->nullable(); + $table->string('zipcode', 50)->nullable(); + $table->string('city')->nullable(); + $table->string('country', 50)->nullable(); + $table->dateTime('event_date_begin')->nullable(); + $table->dateTime('event_date_end')->nullable(); + $table->dateTime('created_by')->nullable(); + $table->dateTime('updated_by')->nullable(); + $table->dateTime('deleted_by')->nullable(); + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('shop_deliveries'); + } +}; diff --git a/database/migrations/shop/2024_01_22_224325_create_shop_delivery_packages_table.php b/database/migrations/shop/2024_01_22_224325_create_shop_delivery_packages_table.php new file mode 100644 index 00000000..6e5f7a25 --- /dev/null +++ b/database/migrations/shop/2024_01_22_224325_create_shop_delivery_packages_table.php @@ -0,0 +1,39 @@ +increments('id'); + $table->unsignedMediumInteger('weight')->nullable()->default(0); + $table->unsignedTinyInteger('weight_flyer')->nullable()->default(0); + $table->unsignedSmallInteger('weight_packaging')->nullable()->default(0); + $table->unsignedSmallInteger('weight_useful')->nullable()->default(0); + $table->unsignedSmallInteger('created_by')->nullable(); + $table->unsignedSmallInteger('updated_by')->nullable(); + $table->unsignedSmallInteger('deleted_by')->nullable(); + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('shop_delivery_packages'); + } +}; diff --git a/database/migrations/shop/2024_01_22_224325_create_shop_delivery_type_calculations_table.php b/database/migrations/shop/2024_01_22_224325_create_shop_delivery_type_calculations_table.php new file mode 100644 index 00000000..31344bc9 --- /dev/null +++ b/database/migrations/shop/2024_01_22_224325_create_shop_delivery_type_calculations_table.php @@ -0,0 +1,38 @@ +increments('id'); + $table->unsignedInteger('type_id')->nullable()->index('type_id'); + $table->unsignedMediumInteger('weight')->nullable()->default(0); + $table->unsignedDecimal('price', 7)->nullable()->default(0); + $table->unsignedSmallInteger('created_by')->nullable(); + $table->unsignedSmallInteger('updated_by')->nullable(); + $table->unsignedSmallInteger('deleted_by')->nullable(); + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('shop_delivery_type_calculations'); + } +}; diff --git a/database/migrations/2020_04_20_212813_create_shop_articles_table.php b/database/migrations/shop/2024_01_22_224325_create_shop_delivery_types_table.php similarity index 52% rename from database/migrations/2020_04_20_212813_create_shop_articles_table.php rename to database/migrations/shop/2024_01_22_224325_create_shop_delivery_types_table.php index cb7e58ca..a2e45811 100644 --- a/database/migrations/2020_04_20_212813_create_shop_articles_table.php +++ b/database/migrations/shop/2024_01_22_224325_create_shop_delivery_types_table.php @@ -2,8 +2,9 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; -class CreateShopArticlesTable extends Migration +return new class extends Migration { /** * Run the migrations. @@ -12,10 +13,13 @@ class CreateShopArticlesTable extends Migration */ public function up() { - Schema::create('shop_articles', function (Blueprint $table) { + Schema::create('shop_delivery_types', function (Blueprint $table) { $table->increments('id'); - $table->string('name')->nullable(); + $table->string('name', 50)->nullable(); $table->text('description')->nullable(); + $table->smallInteger('created_by')->nullable(); + $table->smallInteger('updated_by')->nullable(); + $table->smallInteger('deleted_by')->nullable(); $table->timestamps(); $table->softDeletes(); }); @@ -28,6 +32,6 @@ class CreateShopArticlesTable extends Migration */ public function down() { - Schema::drop('shop_articles'); + Schema::dropIfExists('shop_delivery_types'); } -} +}; diff --git a/database/migrations/shop/2024_01_22_224325_create_shop_invoice_payments_table.php b/database/migrations/shop/2024_01_22_224325_create_shop_invoice_payments_table.php new file mode 100644 index 00000000..1467d689 --- /dev/null +++ b/database/migrations/shop/2024_01_22_224325_create_shop_invoice_payments_table.php @@ -0,0 +1,42 @@ +increments('id'); + $table->integer('invoice_id')->nullable()->index('order_id'); + $table->unsignedTinyInteger('payment_type')->nullable(); + $table->float('amount', 7)->nullable(); + $table->tinyText('reference')->nullable(); + $table->date('date')->nullable(); + $table->json('data')->nullable(); + $table->unsignedTinyInteger('validated')->nullable(); + $table->unsignedSmallInteger('created_by')->nullable(); + $table->unsignedSmallInteger('updated_by')->nullable(); + $table->unsignedSmallInteger('deleted_by')->nullable(); + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('shop_invoice_payments'); + } +}; diff --git a/database/migrations/shop/2024_01_22_224325_create_shop_invoices_table.php b/database/migrations/shop/2024_01_22_224325_create_shop_invoices_table.php new file mode 100644 index 00000000..aadce22a --- /dev/null +++ b/database/migrations/shop/2024_01_22_224325_create_shop_invoices_table.php @@ -0,0 +1,50 @@ +mediumIncrements('id'); + $table->char('uuid', 36)->nullable()->index('uuid'); + $table->string('ref', 50)->nullable(); + $table->unsignedInteger('customer_id')->nullable()->index('customer_id'); + $table->unsignedInteger('invoice_address_id')->nullable(); + $table->unsignedMediumInteger('order_id')->nullable()->index('order_id'); + $table->unsignedTinyInteger('payment_type')->nullable(); + $table->unsignedTinyInteger('status')->nullable()->default(0)->index('status'); + $table->decimal('total', 10); + $table->decimal('taxes', 10); + $table->decimal('total_taxed', 10); + $table->decimal('shipping', 10); + $table->decimal('total_shipped', 10); + $table->date('date_invoice')->nullable(); + $table->date('date_due')->nullable(); + $table->text('comment')->nullable(); + $table->unsignedSmallInteger('created_by')->nullable(); + $table->unsignedSmallInteger('updated_by')->nullable(); + $table->unsignedSmallInteger('deleted_by')->nullable(); + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('shop_invoices'); + } +}; diff --git a/database/migrations/shop/2024_01_22_224325_create_shop_merchandises_table.php b/database/migrations/shop/2024_01_22_224325_create_shop_merchandises_table.php new file mode 100644 index 00000000..41269894 --- /dev/null +++ b/database/migrations/shop/2024_01_22_224325_create_shop_merchandises_table.php @@ -0,0 +1,39 @@ +mediumIncrements('id'); + $table->unsignedMediumInteger('producer_id')->nullable()->index('producer_id'); + $table->string('name', 100)->nullable(); + $table->text('description')->nullable(); + $table->text('plus')->nullable(); + $table->unsignedSmallInteger('created_by')->nullable(); + $table->unsignedSmallInteger('updated_by')->nullable(); + $table->unsignedSmallInteger('deleted_by')->nullable(); + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('shop_merchandises'); + } +}; diff --git a/database/migrations/shop/2024_01_22_224325_create_shop_offers_table.php b/database/migrations/shop/2024_01_22_224325_create_shop_offers_table.php new file mode 100644 index 00000000..05ebcfbf --- /dev/null +++ b/database/migrations/shop/2024_01_22_224325_create_shop_offers_table.php @@ -0,0 +1,46 @@ +mediumIncrements('id'); + $table->unsignedMediumInteger('article_id')->nullable()->index('article_id'); + $table->unsignedTinyInteger('status_id')->nullable()->index('status_id'); + $table->unsignedMediumInteger('variation_id')->nullable()->index('variation_id'); + $table->unsignedMediumInteger('tariff_id')->nullable()->index('tariff_id'); + $table->unsignedMediumInteger('weight')->nullable(); + $table->text('description')->nullable(); + $table->unsignedDecimal('stock_current', 10)->nullable(); + $table->unsignedDecimal('stock_delayed', 10)->nullable(); + $table->tinyText('delay_type')->nullable(); + $table->unsignedTinyInteger('stock_ondemand')->nullable(); + $table->unsignedDecimal('minimum_ondemand', 10)->nullable(); + $table->unsignedSmallInteger('created_by')->nullable(); + $table->unsignedSmallInteger('updated_by')->nullable(); + $table->unsignedSmallInteger('deleted_by')->nullable(); + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('shop_offers'); + } +}; diff --git a/database/migrations/shop/2024_01_22_224325_create_shop_order_details_table.php b/database/migrations/shop/2024_01_22_224325_create_shop_order_details_table.php new file mode 100644 index 00000000..3c3ec9dd --- /dev/null +++ b/database/migrations/shop/2024_01_22_224325_create_shop_order_details_table.php @@ -0,0 +1,44 @@ +increments('id'); + $table->unsignedInteger('order_id')->nullable()->index('order_id'); + $table->unsignedInteger('offer_id')->nullable()->index('offer_id'); + $table->tinyText('name')->nullable(); + $table->unsignedInteger('quantity')->default(0); + $table->unsignedDecimal('vat', 5)->default(0); + $table->unsignedDecimal('price', 7)->default(0); + $table->unsignedDecimal('tax', 7)->default(0); + $table->unsignedDecimal('price_taxed', 7)->default(0); + $table->unsignedDecimal('total', 7)->default(0); + $table->unsignedDecimal('total_tax', 7)->default(0); + $table->unsignedDecimal('total_taxed', 7)->default(0); + $table->unsignedMediumInteger('weight')->default(0); + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('shop_order_details'); + } +}; diff --git a/database/migrations/shop/2024_01_22_224325_create_shop_orders_table.php b/database/migrations/shop/2024_01_22_224325_create_shop_orders_table.php new file mode 100644 index 00000000..f0f69974 --- /dev/null +++ b/database/migrations/shop/2024_01_22_224325_create_shop_orders_table.php @@ -0,0 +1,50 @@ +increments('id'); + $table->char('uuid', 36)->nullable()->index('uuid'); + $table->string('ref', 50)->nullable(); + $table->unsignedInteger('customer_id')->nullable()->index('customer_id'); + $table->unsignedInteger('delivery_address_id')->nullable(); + $table->unsignedSmallInteger('sale_channel_id')->nullable()->index('sale_channel_id'); + $table->unsignedSmallInteger('delivery_id')->nullable()->index('delivery_id'); + $table->string('delivery_ref', 50)->nullable(); + $table->tinyInteger('delivery_type_id')->nullable(); + $table->tinyText('delivery_link')->nullable(); + $table->unsignedTinyInteger('payment_type')->nullable(); + $table->unsignedTinyInteger('status')->nullable()->default(0); + $table->unsignedTinyInteger('tax')->nullable()->default(0); + $table->unsignedDecimal('total', 10)->nullable(); + $table->unsignedDecimal('taxes', 10)->nullable(); + $table->unsignedDecimal('total_taxed', 10)->nullable(); + $table->unsignedDecimal('shipping', 10)->nullable(); + $table->unsignedDecimal('total_shipped', 10)->nullable(); + $table->text('comment')->nullable(); + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('shop_orders'); + } +}; diff --git a/database/migrations/2020_04_20_212813_create_shop_invoices_table.php b/database/migrations/shop/2024_01_22_224325_create_shop_packages_table.php similarity index 51% rename from database/migrations/2020_04_20_212813_create_shop_invoices_table.php rename to database/migrations/shop/2024_01_22_224325_create_shop_packages_table.php index 23fc2a60..2045bd80 100644 --- a/database/migrations/2020_04_20_212813_create_shop_invoices_table.php +++ b/database/migrations/shop/2024_01_22_224325_create_shop_packages_table.php @@ -2,8 +2,9 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; -class CreateShopInvoicesTable extends Migration +return new class extends Migration { /** * Run the migrations. @@ -12,13 +13,12 @@ class CreateShopInvoicesTable extends Migration */ public function up() { - Schema::create('shop_invoices', function (Blueprint $table) { + Schema::create('shop_packages', function (Blueprint $table) { $table->increments('id'); - $table->integer('user_id'); - $table->boolean('status_id'); - $table->decimal('subtotal', 10); - $table->decimal('total', 10); - $table->decimal('shipping', 10); + $table->string('value', 50)->nullable(); + $table->smallInteger('created_by')->nullable(); + $table->smallInteger('updated_by')->nullable(); + $table->smallInteger('deleted_by')->nullable(); $table->timestamps(); $table->softDeletes(); }); @@ -31,6 +31,6 @@ class CreateShopInvoicesTable extends Migration */ public function down() { - Schema::drop('shop_invoices'); + Schema::dropIfExists('shop_packages'); } -} +}; diff --git a/database/migrations/shop/2024_01_22_224325_create_shop_price_list_values_table.php b/database/migrations/shop/2024_01_22_224325_create_shop_price_list_values_table.php new file mode 100644 index 00000000..81d7cf69 --- /dev/null +++ b/database/migrations/shop/2024_01_22_224325_create_shop_price_list_values_table.php @@ -0,0 +1,41 @@ +increments('id'); + $table->unsignedMediumInteger('price_list_id')->nullable()->index('price_list_id'); + $table->string('code', 50)->nullable(); + $table->unsignedDecimal('quantity', 7)->nullable(); + $table->decimal('price', 7)->nullable()->default(0); + $table->decimal('price_taxed', 7)->nullable()->default(0); + $table->tinyInteger('tax_id')->nullable(); + $table->unsignedSmallInteger('created_by')->nullable(); + $table->unsignedSmallInteger('updated_by')->nullable(); + $table->unsignedSmallInteger('deleted_by')->nullable(); + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('shop_price_list_values'); + } +}; diff --git a/database/migrations/shop/2024_01_22_224325_create_shop_price_lists_table.php b/database/migrations/shop/2024_01_22_224325_create_shop_price_lists_table.php new file mode 100644 index 00000000..fb3904d8 --- /dev/null +++ b/database/migrations/shop/2024_01_22_224325_create_shop_price_lists_table.php @@ -0,0 +1,39 @@ +increments('id'); + $table->unsignedInteger('tariff_id')->nullable()->index('tariff_id'); + $table->unsignedInteger('sale_channel_id')->nullable()->index('sale_channel_id'); + $table->unsignedTinyInteger('status_id')->nullable(); + $table->string('name', 100)->nullable(); + $table->unsignedSmallInteger('created_by')->nullable(); + $table->unsignedSmallInteger('updated_by')->nullable(); + $table->unsignedSmallInteger('deleted_by')->nullable(); + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('shop_price_lists'); + } +}; diff --git a/database/migrations/shop/2024_01_22_224325_create_shop_producers_table.php b/database/migrations/shop/2024_01_22_224325_create_shop_producers_table.php new file mode 100644 index 00000000..dad9689e --- /dev/null +++ b/database/migrations/shop/2024_01_22_224325_create_shop_producers_table.php @@ -0,0 +1,38 @@ +increments('id'); + $table->string('name', 100)->nullable(); + $table->string('alias', 100)->nullable(); + $table->text('description')->nullable(); + $table->unsignedMediumInteger('created_by')->nullable(); + $table->unsignedMediumInteger('updated_by')->nullable(); + $table->unsignedMediumInteger('deleted_by')->nullable(); + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('shop_producers'); + } +}; diff --git a/database/migrations/shop/2024_01_22_224325_create_shop_sale_channels_table.php b/database/migrations/shop/2024_01_22_224325_create_shop_sale_channels_table.php new file mode 100644 index 00000000..8d8b4901 --- /dev/null +++ b/database/migrations/shop/2024_01_22_224325_create_shop_sale_channels_table.php @@ -0,0 +1,38 @@ +integer('id', true); + $table->string('code', 20); + $table->string('name', 50)->nullable(); + $table->text('description')->nullable(); + $table->unsignedSmallInteger('created_by')->nullable(); + $table->unsignedSmallInteger('updated_by')->nullable(); + $table->unsignedSmallInteger('deleted_by')->nullable(); + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('shop_sale_channels'); + } +}; diff --git a/database/migrations/shop/2024_01_22_224325_create_shop_tariff_unities_table.php b/database/migrations/shop/2024_01_22_224325_create_shop_tariff_unities_table.php new file mode 100644 index 00000000..f83b3f24 --- /dev/null +++ b/database/migrations/shop/2024_01_22_224325_create_shop_tariff_unities_table.php @@ -0,0 +1,36 @@ +mediumInteger('id', true); + $table->string('value', 50)->nullable(); + $table->unsignedSmallInteger('created_by')->nullable(); + $table->unsignedSmallInteger('updated_by')->nullable(); + $table->unsignedSmallInteger('deleted_by')->nullable(); + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('shop_tariff_unities'); + } +}; diff --git a/database/migrations/shop/2024_01_22_224325_create_shop_tariffs_table.php b/database/migrations/shop/2024_01_22_224325_create_shop_tariffs_table.php new file mode 100644 index 00000000..81aaefb4 --- /dev/null +++ b/database/migrations/shop/2024_01_22_224325_create_shop_tariffs_table.php @@ -0,0 +1,42 @@ +integer('id', true); + $table->unsignedSmallInteger('sale_channel_id')->default(0)->index('sale_channel_id'); + $table->unsignedTinyInteger('status_id')->default(0); + $table->unsignedSmallInteger('tariff_unity_id')->default(0); + $table->string('name')->nullable(); + $table->string('code', 50)->nullable(); + $table->string('ref', 50)->nullable(); + $table->text('description')->nullable(); + $table->unsignedSmallInteger('created_by')->nullable(); + $table->unsignedSmallInteger('updated_by')->nullable(); + $table->unsignedSmallInteger('deleted_by')->nullable(); + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('shop_tariffs'); + } +}; diff --git a/database/migrations/2020_04_20_212813_create_shop_orders_table.php b/database/migrations/shop/2024_01_22_224325_create_shop_taxes_table.php similarity index 59% rename from database/migrations/2020_04_20_212813_create_shop_orders_table.php rename to database/migrations/shop/2024_01_22_224325_create_shop_taxes_table.php index bf23f4be..0b8cdf0f 100644 --- a/database/migrations/2020_04_20_212813_create_shop_orders_table.php +++ b/database/migrations/shop/2024_01_22_224325_create_shop_taxes_table.php @@ -2,8 +2,9 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; -class CreateShopOrdersTable extends Migration +return new class extends Migration { /** * Run the migrations. @@ -12,10 +13,9 @@ class CreateShopOrdersTable extends Migration */ public function up() { - Schema::create('shop_orders', function (Blueprint $table) { + Schema::create('shop_taxes', function (Blueprint $table) { $table->increments('id'); - $table->timestamps(); - $table->softDeletes(); + $table->unsignedDecimal('value', 5)->nullable(); }); } @@ -26,6 +26,6 @@ class CreateShopOrdersTable extends Migration */ public function down() { - Schema::drop('shop_orders'); + Schema::dropIfExists('shop_taxes'); } -} +}; diff --git a/database/migrations/shop/2024_01_22_224325_create_shop_unities_table.php b/database/migrations/shop/2024_01_22_224325_create_shop_unities_table.php new file mode 100644 index 00000000..abefe8bb --- /dev/null +++ b/database/migrations/shop/2024_01_22_224325_create_shop_unities_table.php @@ -0,0 +1,36 @@ +increments('id'); + $table->string('value', 50)->nullable(); + $table->unsignedMediumInteger('created_by')->nullable(); + $table->unsignedMediumInteger('updated_by')->nullable(); + $table->unsignedMediumInteger('deleted_by')->nullable(); + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('shop_unities'); + } +}; diff --git a/database/migrations/shop/2024_01_22_224325_create_shop_variations_table.php b/database/migrations/shop/2024_01_22_224325_create_shop_variations_table.php new file mode 100644 index 00000000..6eb9c6fc --- /dev/null +++ b/database/migrations/shop/2024_01_22_224325_create_shop_variations_table.php @@ -0,0 +1,40 @@ +increments('id'); + $table->unsignedMediumInteger('package_id')->nullable()->index('attribute_family_id'); + $table->unsignedMediumInteger('unity_id')->nullable(); + $table->unsignedDecimal('quantity', 7)->nullable(); + $table->string('name')->nullable(); + $table->text('description')->nullable(); + $table->unsignedSmallInteger('created_by')->nullable(); + $table->unsignedSmallInteger('updated_by')->nullable(); + $table->unsignedSmallInteger('deleted_by')->nullable(); + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('shop_variations'); + } +};