Skip to content

Commit

Permalink
[ADD] Migration.
Browse files Browse the repository at this point in the history
  • Loading branch information
Seiger committed Dec 28, 2023
1 parent 982373c commit a45dc31
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Query\Expression;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('s_products', function (Blueprint $table) {
$table->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');
}
};
7 changes: 7 additions & 0 deletions docs/pages/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions docs/pages/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}).

0 comments on commit a45dc31

Please sign in to comment.