From a45dc314a4ef41da33ee1a29e3d912c77f808040 Mon Sep 17 00:00:00 2001 From: Serhii Korneliuk Date: Thu, 28 Dec 2023 11:37:47 +0200 Subject: [PATCH] [ADD] Migration. --- README.md | 7 +++ ...2_27_190234_ecommerce_structure_tables.php | 61 +++++++++++++++++++ docs/pages/getting-started.md | 7 +++ docs/pages/index.md | 7 +++ 4 files changed, 82 insertions(+) create mode 100644 database/migrations/2023_12_27_190234_ecommerce_structure_tables.php diff --git a/README.md b/README.md index abeccb1..a97477d 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,13 @@ for online commerce with all the necessary tools. - [ ] Integration with warehouses. - [ ] Integration with trading platforms. +## Minimum requirements + +- PHP >= 8.1.0 +- MySQL >= 8.0.3 +- MariaDB >= 10.5.2 +- SQLite >= 3.25.0 + ## Install by artisan package installer Go to You /core/ folder: diff --git a/database/migrations/2023_12_27_190234_ecommerce_structure_tables.php b/database/migrations/2023_12_27_190234_ecommerce_structure_tables.php new file mode 100644 index 0000000..2370da9 --- /dev/null +++ b/database/migrations/2023_12_27_190234_ecommerce_structure_tables.php @@ -0,0 +1,61 @@ +id('id'); + $table->unsignedTinyInteger('published')->default(0)->index()->comment('0-Unpublished|1-Published'); + $table->unsignedTinyInteger('availability')->default(0)->index()->comment('0-Not available|1-In stock|2-On order'); + $table->unsignedInteger('category')->default(0)->index()->comment('ID Resource as Category'); + $table->string('code')->index()->comment('It is the Product code'); + $table->string('alias', 512)->index()->comment('It using for generate url'); + $table->unsignedTinyInteger('type')->default(0)->comment('0-Simple|1-Variable|2-Optional'); + $table->unsignedInteger('position')->default(0)->comment('Position the product in list'); + $table->unsignedInteger('views')->default(0)->comment('Count view the product'); + $table->unsignedDecimal('price', 9, 2)->default(0); + $table->unsignedDecimal('price_old', 9, 2)->default(0); + $table->unsignedDecimal('weight', 11, 4)->default(0.00); + $table->string('cover', 512)->default('')->comment('Cover image file link'); + $table->jsonb('relevants')->default(new Expression('(JSON_ARRAY())')); + $table->jsonb('similar')->default(new Expression('(JSON_ARRAY())')); + $table->jsonb('tmplvars')->default(new Expression('(JSON_ARRAY())')); + $table->jsonb('votes')->default(new Expression('(JSON_ARRAY())')); + $table->timestamps(); + }); + + Schema::create('s_product_translates', function (Blueprint $table) { + $table->id('tid'); + $table->foreignId('product')->constrained('s_products')->cascadeOnDelete()->index()->comment('Product ID'); + $table->string('lang', 4)->index()->default('base'); + $table->string('pagetitle', 255)->index()->default(''); + $table->string('longtitle', 512)->default(''); + $table->mediumText('introtext')->default(''); + $table->longText('content')->default(''); + $table->string('seotitle', 100)->default(''); + $table->string('seodescription', 255)->default(''); + $table->enum('seorobots', ['index,follow', 'noindex,nofollow'])->default('index,follow'); + $table->jsonb('builder')->default(new Expression('(JSON_ARRAY())')); + $table->jsonb('constructor')->default(new Expression('(JSON_ARRAY())')); + $table->unique(['product', 'lang']); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('s_products'); + } +}; diff --git a/docs/pages/getting-started.md b/docs/pages/getting-started.md index 1839573..3ad9130 100644 --- a/docs/pages/getting-started.md +++ b/docs/pages/getting-started.md @@ -5,6 +5,13 @@ description: Getting started with sCommerce permalink: /getting-started/ --- +## Minimum requirements + +- PHP >= 8.1.0 +- MySQL >= 8.0.3 +- MariaDB >= 10.5.2 +- SQLite >= 3.25.0 + ## Install by artisan package Go to You /core/ folder diff --git a/docs/pages/index.md b/docs/pages/index.md index 5fe16f9..9f31d99 100644 --- a/docs/pages/index.md +++ b/docs/pages/index.md @@ -32,6 +32,13 @@ for online commerce with all the necessary tools. - [ ] Integration with warehouses. - [ ] Integration with trading platforms. +## Minimum requirements + +- PHP >= 8.1.0 +- MySQL >= 8.0.3 +- MariaDB >= 10.5.2 +- SQLite >= 3.25.0 + ## Support If you need help, please don't hesitate to [open an issue]({{ site.support }}).