Skip to content

armgit / Vvveb

Public Imported from GitHub
0

Powerful and easy to use cms to build websites, blogs or ecommerce stores.

Reorganize install schema: taxonomy split from post_category, subscriptions, warehouses, queue and notification tables, move message.sql to plugin dir

Givand311281fbfb2
diff --git a/install/controller/base.php b/install/controller/base.php
index 30e5e74..a40b3d4 100755
--- a/install/controller/base.php
+++ b/install/controller/base.php
@@ -22,27 +22,59 @@
namespace Vvveb\Controller;
-use \Vvveb\System\Core\Request as Request;
+use Vvveb\System\Core\FrontController;
+use Vvveb\System\Core\Request;
+use Vvveb\System\Core\Response;
use Vvveb\System\Core\View;
+use Vvveb\System\Session;
#[\AllowDynamicProperties]
class Base {
- function __construct() {
+ /** @var Request Request instance injected by FrontController DI. */
+ public Request $request;
+
+ /** @var Response Response instance injected by FrontController DI. */
+ public Response $response;
+
+ /** @var View View instance injected by FrontController DI. */
+ public View $view;
+
+ /** @var Session Session instance injected by FrontController DI. */
+ public Session $session;
+
+ public function __construct() {
$this->request = Request::getInstance();
$this->view = View::getInstance();
+ $this->session = Session::getInstance();
}
- function redirect($url = '/') {
+ /**
+ * Redirect to the given URL and terminate.
+ *
+ * @param string $url The URL to redirect to.
+ *
+ * @return void
+ */
+ public function redirect(string $url = '/'): void {
if (defined('CLI')) {
return;
}
session_write_close();
header("Location: $url");
- die();
+ exit();
}
- function notFound($service = false, $message = null, $statusCode = 404) {
+ /**
+ * Show a 404 not-found response.
+ *
+ * @param bool $service Whether this is a service request.
+ * @param string|null $message Optional error message.
+ * @param int $statusCode HTTP status code.
+ *
+ * @return mixed
+ */
+ public function notFound(bool $service = false, ?string $message = null, int $statusCode = 404): mixed {
return FrontController::notFound($service, $message, $statusCode);
}
}
diff --git a/install/controller/error404.php b/install/controller/error404.php
index 69a4eda..62d9411 100755
--- a/install/controller/error404.php
+++ b/install/controller/error404.php
@@ -23,6 +23,5 @@
namespace Vvveb\Controller;
class Error404 extends Base {
- function index() {
- }
+ public function index(): void {}
}
diff --git a/install/controller/error500.php b/install/controller/error500.php
index b91e787..c29d70a 100755
--- a/install/controller/error500.php
+++ b/install/controller/error500.php
@@ -23,6 +23,5 @@
namespace Vvveb\Controller;
class Error500 extends Base {
- function index() {
- }
+ public function index(): void {}
}
diff --git a/install/controller/index.php b/install/controller/index.php
index 38792ab..8329b56 100755
--- a/install/controller/index.php
+++ b/install/controller/index.php
@@ -27,7 +27,7 @@ use function Vvveb\getTemplateList;
use function Vvveb\sanitizeFileName;
use function Vvveb\session as sess;
use Vvveb\Sql\LanguageSQL;
-use Vvveb\Sql\menu_itemSQL;
+use Vvveb\Sql\Menu_itemSQL;
use Vvveb\Sql\RoleSQL;
use Vvveb\Sql\SiteSQL;
use Vvveb\System\Core\View;
@@ -40,17 +40,19 @@ use Vvveb\System\User\Admin;
define('REQUIRED_EXTENSIONS', ['mysqli', 'mysqlnd', 'xml', 'libxml', 'pcre', 'zip', 'dom', 'curl', 'gettext']);
define('WRITABLE_FOLDERS', ['storage', 'storage/cache', 'storage/model', 'storage/compiled-templates', 'config', 'config/sites.php', 'public/media/', 'public/themes', 'public/image-cache', 'plugins']);
-define('MIN_PHP_VERSION', '7.4.0');
+define('MIN_PHP_VERSION', '8.3.0');
define('DEFAULT_LANG', 'en_US');
#[\AllowDynamicProperties]
class Index extends Base {
- private $config = ['engine' => 'mysqli', 'host' => '127.0.0.1', 'database' => 'vvveb', 'user' => 'root', 'password' => '', 'port' => null, 'prefix' => ''];
+ /** @var array{engine: string, host: string, database: string, user: string, password: string, port: string|null, prefix: string} */
+ private array $config = ['engine' => 'mysqli', 'host' => '127.0.0.1', 'database' => 'vvveb', 'user' => 'root', 'password' => '', 'port' => null, 'prefix' => ''];
- private $subdir = '';
+ /** @var string */
+ private string $subdir = '';
- function __construct() {
- if (! ($lang = sess('install_language'))) {
+ public function __construct() {
+ if (!($lang = sess('install_language'))) {
$lang = Locale::userPreferedLanguage();
if ($lang) {
@@ -62,7 +64,7 @@ class Index extends Base {
Locale::setLanguage($lang);
}
- $this->subdir = (V_SUBDIR_INSTALL ? V_SUBDIR_INSTALL : \Vvveb\detectSubDir());
+ $this->subdir = (V_SUBDIR_INSTALL ?: \Vvveb\detectSubDir());
if (\Vvveb\is_installed()) {
$admin = false;
@@ -82,9 +84,9 @@ class Index extends Base {
if ($admin && isset($admin['status']) && $admin['status'] == '1') {
$this->redirect($this->subdir . '/');
- die(__('Already installed! To reinstall remove config/db.php') . "\n");
+ exit(__('Already installed! To reinstall remove config/db.php') . "\n");
} else {
- if (! $admin || ! isset($admin['role_id']) || $admin['role_id'] != '1') {
+ if (!$admin || !isset($admin['role_id']) || $admin['role_id'] != '1') {
$message .= __('Invalid installation. No user with "super admin" role found!');
$this->view = View :: getInstance();
$this->view->info[] = $message;
@@ -93,7 +95,12 @@ class Index extends Base {
}
}
- private function checkRequirements() {
+ /**
+ * Check PHP requirements: version, extensions, and writable folders.
+ *
+ * @return array<int, string> List of unmet requirements.
+ */
+ private function checkRequirements(): array {
$notMet = [];
if (version_compare(PHP_VERSION, MIN_PHP_VERSION) < 0) {
@@ -101,7 +108,7 @@ class Index extends Base {
}
foreach (REQUIRED_EXTENSIONS as $extension) {
- if (! extension_loaded($extension)) {
+ if (!extension_loaded($extension)) {
$notMet[] = sprintf(__('PHP extension %s is not installed'), $extension);
}
}
@@ -109,7 +116,7 @@ class Index extends Base {
foreach (WRITABLE_FOLDERS as $folder) {
$path = DIR_ROOT . $folder;
- if (! is_writable($path) && ! @chmod($path, 0750)) {
+ if (!is_writable($path) && !@chmod($path, 0750)) {
$notMet[] = sprintf(__('"%s" is not writable'), $folder);
}
}
@@ -117,7 +124,16 @@ class Index extends Base {
return $notMet;
}
- private function replaceInFile($file, $search, $replace) {
+ /**
+ * Replace a string in a file.
+ *
+ * @param string $file The file path.
+ * @param string|string[] $search The string(s) to search for.
+ * @param string|string[] $replace The replacement string(s).
+ *
+ * @return int|false Number of bytes written, or false on failure.
+ */
+ private function replaceInFile(string $file, string|array $search, string|array $replace): int|false {
$content = file_get_contents($file);
if ($content) {
@@ -125,51 +141,64 @@ class Index extends Base {
return file_put_contents($file, $content);
}
+
+ return false;
}
- private function writeConfig($data) {
+ /**
+ * Write database configuration.
+ *
+ * @param array<string, mixed> $data The configuration data.
+ *
+ * @return mixed
+ */
+ private function writeConfig(array $data): mixed {
return \Vvveb\setConfig('db', $data);
- $configFile = DIR_ROOT . 'config/db.php';
- file_put_contents($configFile, "<?php\n return " . var_export($data, true) . ';');
- clearstatcache(true, $configFile);
}
- private function import($noimport = false) {
+ /**
+ * Import database schema and data from POST parameters.
+ *
+ * @param bool $noimport Whether to skip data import.
+ *
+ * @return void
+ */
+ private function import(bool $noimport = false): void {
$config = $this->config;
- array_walk($this->request->post, function ($value, $key) use (&$config) {
+ array_walk($this->request->post, function($value, $key) use (&$config): void {
if (isset($config[$key])) {
$config[$key] = $value;
}
});
- $config['engine'] = $config['engine'] ? $config['engine'] : 'mysqli';
+ $config['engine'] = $config['engine'] ?: 'mysqli';
- if ($config['engine'] == 'sqlite') {
+ if ($config['engine'] === 'sqlite') {
$config['host'] = DIR_STORAGE . 'sqlite/vvveb.db';
}
extract($config);
- $prefix = $prefix ?? '';
+ $prefix ??= '';
$data['default'] = $config['engine'];
$data['connections'][$engine] = $config;
try {
- if (! defined('DB_ENGINE')) {
+ if (!defined('DB_ENGINE')) {
define('DB_ENGINE', $engine);
- define('DB_HOST', $host);
- define('DB_USER', $user);
- define('DB_PASS', $password);
- define('DB_NAME', $database);
+ define('DB_HOST', $host);
+ define('DB_USER', $user);
+ define('DB_PASS', $password);
+ define('DB_NAME', $database);
define('DB_PREFIX', $prefix);
- define('DB_PORT', $port);
- define('DIR_SQL', DIR_APP . 'sql/' . DB_ENGINE . '/');
+ define('DB_PORT', $port);
+ define('DIR_SQL', DIR_APP . 'sql/' . DB_ENGINE . '/');
}
- $import = new \Vvveb\System\Import\Sql($engine, $host, $database, $user, $password, $port, $prefix);
+ $import = new \Vvveb\System\Import\Sql($engine, $database, $prefix);
//$import->createDb($database);
- if ($engine == 'mysqli') {
+ if ($engine === 'mysqli') {
$import->createDb($database);
}
$import->setPath(DIR_ROOT . "install/sql/$engine/schema/");
@@ -192,19 +221,26 @@ class Index extends Base {
}
}
- private function themeTemplates($theme) {
+ /**
+ * Get available templates for a given theme.
+ *
+ * @param string $theme The theme slug.
+ *
+ * @return array<string, string> Associative array of filename => title.
+ */
+ private function themeTemplates(string $theme): array {
$templates = getTemplateList($theme);
$files = ['index.html' => 'Home page'];
foreach ($templates as $template) {
foreach (['error', 'index.'] as $type) {
- if (strpos($template['filename'], $type) !== false) {
+ if (str_contains($template['filename'], $type)) {
continue 2;
}
}
$files[$template['filename']] = $template['title'];
- if ($template['folder'] != null) {
+ if ($template['folder'] !== null) {
break;
}
}
@@ -212,19 +248,32 @@ class Index extends Base {
return $files;
}
- function getThemeTemplates() {
+ /**
+ * Return theme templates as JSON for AJAX requests.
+ *
+ * @return array<string, string>|null
+ */
+ public function getThemeTemplates(): ?array {
$theme = $this->request->get['theme'];
if ($theme) {
$files = $this->themeTemplates($theme);
$this->response->setType('json');
+
return $files;
}
+
+ return null;
}
- function index() {
- $requirements = $this->checkRequirements();
- $noimport = $this->request->post['noimport'] ?? false;
+ /**
+ * Main installer page — step 1: database configuration and language selection.
+ *
+ * @return void
+ */
+ public function index(): void {
+ $requirements = $this->checkRequirements();
+ $noimport = $this->request->post['noimport'] ?? false;
if ($requirements) {
$this->view->requirements = $requirements;
@@ -264,14 +313,19 @@ class Index extends Base {
$languages = array_intersect_key($languagesList, $installedLanguages);
$this->view->config = $this->config;
- if (! defined('CLI')) {
+ if (!defined('CLI')) {
$this->view->languagesList = $languages;
$this->view->currentLanguage = sess('install_language') ?? DEFAULT_LANG;
}
}
- function install() {
- if (! defined('CLI')) {
+ /**
+ * Main installer page — step 2: admin user, site settings, theme, and final setup.
+ *
+ * @return void
+ */
+ public function install(): void {
+ if (!defined('CLI')) {
$themes = ThemesList :: getList();
$activeTheme = key($themes);
@@ -281,13 +335,13 @@ class Index extends Base {
$this->view->count = count($themes);
}
- $isRootPublic = (constant('PUBLIC_PATH') == DIRECTORY_SEPARATOR) ? 'true' : 'false';
+ $isRootPublic = (constant('PUBLIC_PATH') === DIRECTORY_SEPARATOR) ? 'true' : 'false';
$this->view->publicPath = PUBLIC_PATH;
$this->view->isRootPublic = $isRootPublic;
$languagesList = include DIR_SYSTEM . 'data/languages-list.php';
- if (! defined('CLI')) {
+ if (!defined('CLI')) {
$this->view->languagesList = $languagesList;
$this->view->currentLanguage = sess('install_language') ?? DEFAULT_LANG;
}
@@ -368,11 +422,11 @@ class Index extends Base {
unset($site['settings']);
@\Vvveb\setConfig('sites.* * *', $site);
- $lang = $language ?? sess('install_language') ?? 'en_US';
+ $lang = $language;
$languageModel = new LanguageSQL();
//set default language
- if ($lang && $lang != 'en_US') {
+ if ($lang && $lang !== 'en_US' && isset($languagesList[$lang])) {
$language = $languagesList[$lang];
$language['name'] = preg_replace('/^(\w+).*/', '$1', $language['name']);
$language['slug'] = preg_replace('/^(\w+).*/', '$1', $language['code']);
@@ -393,7 +447,10 @@ class Index extends Base {
}
$inserted[] = $code;
- $ln = $languagesList[$code];
+ $ln = $languagesList[$code] ?? null;
+ if (!$ln) {
+ continue;
+ }
$ln['name'] = preg_replace('/^(\w+).*/', '$1', $ln['name']);
$ln['slug'] = preg_replace('/^(\w+).*/', '$1', $ln['code']);
$ln['locale'] = $ln['code'];
@@ -408,7 +465,7 @@ class Index extends Base {
//change admin login path
if ($isRootPublic && $adminPath &&
- ($adminPath != 'admin' && $adminPath != 'vadmin')) {
+ ($adminPath !== 'admin' && $adminPath !== 'vadmin')) {
$from = DIR_PUBLIC . 'vadmin';
$to = DIR_PUBLIC . $adminPath;
@@ -435,7 +492,7 @@ class Index extends Base {
@\Vvveb\setConfig($app . '.key', Str::random(32));
}
- $subdir = $this->request->post['subdir'] ?? $this->subdir ?? false;
+ $subdir = $this->request->post['subdir'] ?? $this->subdir;
if ($subdir) {
$subdir = sanitizeFileName($subdir);
@@ -443,12 +500,11 @@ class Index extends Base {
$subdir = '/' . trim($subdir, '/ ');
//try to set subdir in env.php and .htaccess
- $this->replaceInFile(DIR_ROOT . 'env.php', "define('V_SUBDIR_INSTALL', false" , "define('V_SUBDIR_INSTALL', '{$subdir}'");
- $this->replaceInFile(DIR_ROOT . '.htaccess', 'RewriteRule ^ index.php [L]' , "RewriteRule ^ {$subdir}/index.php [L]");
+ $this->replaceInFile(DIR_ROOT . 'env.php', "define('V_SUBDIR_INSTALL', false", "define('V_SUBDIR_INSTALL', '$subdir'");
+ $this->replaceInFile(DIR_ROOT . '.htaccess', 'RewriteRule ^ index.php [L]', "RewriteRule ^ $subdir/index.php [L]");
}
-
- $menus = new menu_itemSQL();
+ $menus = new Menu_itemSQL();
if ($subdir || $isRootPublic == 'false') {
//add subdir path to menu links
@@ -460,7 +516,7 @@ class Index extends Base {
foreach ($menuItems as $menuItem) {
$data = ['url' => $sub . $menuItem['url'], 'menu_item_content' => []];
if ($menuItem['content']) {
- $content = str_replace('"/media/', '"' . PUBLIC_PATH . 'media/', $menuItem['content']);
+ $content = str_replace('"/media/', '"' . PUBLIC_PATH . 'media/', $menuItem['content']);
$data['menu_item_content'] = [['content' => $content, 'language_id' => 1]];
}
@@ -480,7 +536,7 @@ class Index extends Base {
}
//admin auto login
- if (! defined('CLI')) {
+ if (!defined('CLI')) {
$adminInfo = Admin::get(['admin_id' => 1]);
if ($adminInfo) {
diff --git a/install/sql/insert/admin/role.sql b/install/sql/insert/admin/role.sql
index 246e88a..d873498 100644
--- a/install/sql/insert/admin/role.sql
+++ b/install/sql/insert/admin/role.sql
@@ -2,10 +2,11 @@ INSERT INTO `role` (`role_id`, `name`, `display_name`, `permissions`) VALUES
(1, 'super_admin', 'Super Administrator', '{"allow":["*"], "deny":[], "capabilities":["view_other_posts","edit_other_posts","view_other_products","edit_other_products","view_other_sites","edit_other_sites","view_other_admin","edit_other_admin"]}'),
(2, 'admin', 'Administrator', '{"allow":["*","admin/user","admin/user/save"], "deny":["admin/*"], "capabilities":["view_other_posts","edit_other_posts","view_other_products","edit_other_products","view_other_sites","edit_other_sites","view_other_admin"]}'),
(3, 'site_admin', 'Site Administrator', '{"allow":["index","content/*","user/*","product/*","order/*","editor/*","media/*","settings/*","tools/*","admin/user","admin/user/save"], "deny":["settings/email/*", "tools/update/*", "tools/cron/*","settings/site/add"], "capabilities":["view_other_posts","edit_other_posts","view_other_products","edit_other_products","view_other_sites","edit_other_sites","view_other_admin"]}'),
-(4, 'editor', 'Editor', '{"allow":["index","content/*", "media/media/scan"], "deny":[], "capabilities":["view_other_posts","edit_other_posts","view_other_products","edit_other_products","view_other_sites","edit_other_sites"]}'),
-(5, 'author', 'Author', '{"allow":["index","content/*", "media/media/scan","admin/user","admin/user/save"], "deny":[]}'),
+(4, 'editor', 'Editor', '{"allow":["index","content/*", "media/media/scan","admin/user","admin/user/save"], "deny":[], "capabilities":["view_other_posts","edit_other_posts","view_other_products","edit_other_products","view_other_sites","edit_other_sites"]}'),
+(5, 'author', 'Author', '{"allow":["index","content/*", "media/media/scan","admin/user","admin/user/save", "admin/user","admin/user/save"], "deny":[]}'),
(6, 'contributor', 'Contributor', '{"allow":["index","content/*","media/media/scan","admin/user","admin/user/save"], "deny":[]}'),
-(7, 'shop', 'Shop', '{"allow":["index","product/*","order/*","media/media/scan"], "deny":[], "capabilities":["view_other_products","edit_other_products"]}'),
-(8, 'vendor', 'Vendor', '{"allow":["index","product/*","order/*","media/media/scan"], "deny":["product/vendors/*","product/vendor/*","product/manufacturers/*", "product/manufacturer/*"]}'),
+(7, 'shop', 'Shop', '{"allow":["index","product/*","order/*","media/media/scan", "admin/user","admin/user/save"], "deny":[], "capabilities":["view_other_products","edit_other_products"]}'),
+(8, 'vendor', 'Vendor', '{"allow":["index","product/*","order/*","media/media/scan", "admin/user","admin/user/save"], "deny":["product/vendors/*","product/vendor/*","product/manufacturers/*", "product/manufacturer/*"]}'),
(9, 'rest', 'Rest', '{"allow":["content/*"],"deny":["*/save","*/delete"], "capabilities":["view_other_posts","edit_other_posts","view_other_products","edit_other_products"]}}'),
-(10, 'demo', 'Demo', '{"allow":["*", "tools/cache/index"],"deny":["*/save","*/delete","*/rename","*/duplicate","*/upload", "*/activate","*/deactivate","*/install","*/update","*/deletemenu","plugins/file-manager/*","tools/cache/*"], "capabilities":["view_other_posts","view_other_products","view_other_sites"]}');
+(10, 'mcp', 'Mcp', '{"allow":["*"], "deny":[], "capabilities":["view_other_posts","edit_other_posts","view_other_products","edit_other_products","view_other_sites","edit_other_sites","view_other_admin","edit_other_admin"]}'),
+(11, 'demo', 'Demo', '{"allow":["*", "tools/cache/index"],"deny":["*/save","*/delete","*/rename","*/duplicate","*/upload", "*/activate","*/deactivate","*/install","*/update","*/deletemenu","plugins/file-manager/*","tools/cache/*"], "capabilities":["view_other_posts","view_other_products","view_other_sites"]}');
diff --git a/install/sql/insert/attribute/product_attribute.sql b/install/sql/insert/attribute/product_attribute.sql
index 6f4002f..06ac21f 100644
--- a/install/sql/insert/attribute/product_attribute.sql
+++ b/install/sql/insert/attribute/product_attribute.sql
@@ -1,15 +1,12 @@
INSERT INTO `product_attribute` (`product_id`, `attribute_id`, `language_id`, `value`) VALUES
-(19, 3, 1, '100mhz'),
-(17, 2, 1, '4'),
-(17, 4, 1, '16GB'),
-(18, 2, 1, '16'),
-(18, 3, 1, '3,6 Ghz'),
-(18, 4, 1, '65 W'),
-(18, 5, 1, '7 nm'),
-(18, 6, 1, '3 MB'),
-(18, 7, 1, '32 MB'),
-(18, 8, 1, 'DDR4'),
-(18, 9, 1, '32 GB'),
-(18, 10, 1, '1600 Mhz'),
-(18, 11, 1, '9 CL'),
-(18, 12, 1, '1,5 V');
\ No newline at end of file
+(1, 2, 1, '16'),
+(1, 3, 1, '3,6 Ghz'),
+(1, 4, 1, '65 W'),
+(1, 5, 1, '7 nm'),
+(1, 6, 1, '3 MB'),
+(1, 7, 1, '32 MB'),
+(1, 8, 1, 'DDR4'),
+(1, 9, 1, '32 GB'),
+(1, 10, 1, '1600 Mhz'),
+(1, 11, 1, '9 CL'),
+(1, 12, 1, '1,5 V');
diff --git a/install/sql/insert/menu/menu.sql b/install/sql/insert/menu/menu.sql
index 57c3b58..d4e2c7b 100755
--- a/install/sql/insert/menu/menu.sql
+++ b/install/sql/insert/menu/menu.sql
@@ -1,6 +1,3 @@
INSERT INTO `menu` VALUES
(1,'Main Menu', 'main-menu'),
-(2,'Tags', 'tags'),
-(3,'Categories','categories'),
-(4,'Categories Products','categories-products'),
-(5,'Main Footer', 'main-footer');
+(2,'Main Footer', 'main-footer');
diff --git a/install/sql/insert/menu/menu_item.sql b/install/sql/insert/menu/menu_item.sql
index 873b462..6144f68 100755
--- a/install/sql/insert/menu/menu_item.sql
+++ b/install/sql/insert/menu/menu_item.sql
@@ -1,92 +1,32 @@
-INSERT INTO `menu_item` (`menu_item_id`, `menu_id`, `type`, `url`, `parent_id`, `item_id`, `sort_order`, `status`) VALUES
-(1,3,'link','',0,null,1,1),
-(2,3,'link','',1,null,2,1),
-(3,3,'link','',0,null,3,1),
-(4,3,'link','',0,null,5,1),
-(5,3,'link','',0,null,2,1),
-(6,3,'link','',0,null,4,1),
-(7,3,'link','',3,null,3,1),
-(8,3,'link','',1,null,3,1),
-(9,3,'link','',3,null,3,1),
-(10,3,'link','',3,null,3,1),
-(11,3,'link','',3,null,3,1),
-(12,3,'link','',3,null,3,1),
-(13,3,'link','',0,null,6,1),
-(14,3,'link','',0,null,7,1),
-(15,3,'link','',7,null,0,1),
-(16,3,'link','',7,null,0,1),
-(17,3,'link','',14,null,0,1),
-(18,3,'link','',14,null,0,1),
-(19,3,'link','',14,null,0,1),
-(20,3,'link','',14,null,0,1),
-(21,3,'link','',14,null,0,1),
-(22,3,'link','',14,null,0,1),
-(23,3,'link','',14,null,0,1),
-(24,3,'link','',14,null,0,1),
-(25,3,'link','',5,null,0,1),
-(26,3,'link','',5,null,0,1),
-(27,3,'link','',14,null,0,1),
-(28,3,'link','',14,null,0,1),
-(29,3,'link','',14,null,0,1),
-(30,3,'link','',14,null,0,1),
-(31,3,'link','',14,null,0,1),
-(32,3,'link','',14,null,0,1),
-(33,3,'link','',14,null,0,1),
-(34,3,'link','',14,null,0,1),
-(35,3,'link','',14,null,0,1),
-(36,3,'link','',14,null,0,1),
-(37,3,'link','',0,null,1,1),
-(38,3,'link','',32,null,0,1),
--- tags
-(39,2,'link','',0,null,0,1),
-(40,2,'link','',0,null,0,1),
-(41,2,'link','',0,null,0,1),
--- menu
-(42,1,'home','/',0,null,0,1),
-(43,1,'shop','/shop',0,null,3,1),
--- (44,1,'link','//docs.*.*',0,null,2,1),
--- (45,1,'link','//docs.*.*',44,null,0,1),
-(46,1,'blog','/blog',0,null,5,1),
--- (47,1,'link','//github.com/givanz/Vvveb/discussions',44,null,0,1),
--- (48,1,'link','//dev.*.*',44,null,3,1),
-
-(49,1,'page','/page/contact',0,7,6,1),
--- (59,1,'page','/page/about',0,11,1,1),
--- (60,1,'link','/page/contact',59,null,0,1),
--- (61,1,'link','/page/contact',59,null,3,1),
--- (62,1,'link','/page/contact',59,null,2,1),
-
-(63,1,'page','/page/services',0,12,4,1),
-(64,1,'page','/page/pricing',63,13,0,1),
-(65,1,'page','/page/services',63,12,0,1),
-(80,5,'page','/page/marketplace',63,15,0,1),
-(66,1,'page','/page/portfolio',63,14,0,1),
-(67,1,'text','/page/about',0,11,3,0),
-(68,1,'text','/page/about',67,11,0,0),
-
--- footer
-(50,5,'link','',0,null,0,1),
-(51,5,'link','/',50,null,0,1),
-(52,5,'shop','/shop',50,null,0,1),
-(53,5,'link','/',0,null,0,1),
-(54,5,'page','/page/shipping-delivery',8,8,0,1),
-(55,5,'page','/page/terms-conditions',9,9,0,1),
-(56,5,'page','/page/contact',0,7,0,1),
-(57,5,'page','/page/contact',56,7,0,1),
-(58,5,'page','/page/portfolio',56,14,0,1),
-(73,5,'link','/user/return-form',56,null,0,1),
-
-
-
-(69,5,'link','/user',0,null,0,1),
-(70,5,'link','/user/order-tracking',69,null,0,1),
-(71,5,'link','/user/wishlist',69,null,0,1),
-(72,5,'link','/user/orders',69,null,0,1),
-(79,5,'link','/cart/compare',69,null,0,1),
-
-
-(74,5,'blog','/blog',50,null,0,1),
-(75,5,'page','/page/services',50,12,0,1),
-(76,5,'page','/page/about',56,11,0,1),
-(77,5,'link','/brand',53,null,0,1),
-(78,5,'link','/vendor',53,null,0,1);
+INSERT INTO `menu_item` (`menu_item_id`, `menu_id`, `type`, `url`, `parent_id`, `item_id`, `options`, `sort_order`, `status`) VALUES
+(1, 1, 'home', '/', 0, NULL, '', 0, 1),
+(2, 1, 'shop', '/shop', 0, NULL, '', 1, 1),
+(3, 1, 'blog', '/blog', 0, NULL, '', 3, 1),
+(4, 1, 'page', '/page/contact', 0, 3, '', 5, 1),
+(5, 2, 'link', '', 0, NULL, '', 0, 1),
+(6, 2, 'link', '/', 5, NULL, '', 0, 1),
+(7, 2, 'shop', '/shop', 5, NULL, '', 1, 1),
+(8, 2, 'link', '/', 0, NULL, '', 1, 1),
+(9, 2, 'page', '/page/shipping-delivery', 8, 8, '', 2, 1),
+(10, 2, 'page', '/page/terms-conditions', 8, 9, '', 3, 1),
+(11, 2, 'page', '/page/contact', 0, 3, '', 2, 1),
+(12, 2, 'page', '/page/contact', 8, 3, '', 0, 1),
+(13, 2, 'page', '/page/portfolio', 8, 14, '', 2, 1),
+(14, 1, 'page', '/page/services', 0, 12, '{"columns":"2","width":"50","padding-x":"20","padding-y":"20","sub-padding-x":"20","sub-padding-y":"20"}', 0, 1),
+(15, 1, 'text', '/page/pricing', 14, 13, '{"img":"/extension.svg","img_width":"32","img_height":"32"}', 1, 1),
+(16, 1, 'text', '/page/services', 14, 12, '{"img":"/extension.svg","img_width":"32","img_height":"32"}', 4, 1),
+(17, 1, 'text', '/page/portfolio', 14, 14, '{"img":"/extension.svg","img_width":"32","img_height":"32"}', 2, 1),
+(18, 1, 'text', '/page/about', 0, 8, '{"columns":"1","width":"50","img_width":"100","img_height":"100","padding-x":"0","padding-y":"0","sub-padding-x":"0","sub-padding-y":"0"}', 2, 0),
+(19, 1, 'text', '/page/about', 18, 8, '{"width":"50","img":"/demo/posts/1.jpg","img_height":"200","padding-x":"10","padding-y":"10"}', 0, 0),
+(20, 2, 'link', '/user', 0, NULL, '', 4, 1),
+(21, 2, 'link', '/user/order-tracking', 20, NULL, '', 0, 1),
+(22, 2, 'link', '/user/wishlist', 20, NULL, '', 1, 1),
+(23, 2, 'link', '/user/orders', 20, NULL, '', 2, 1),
+(24, 2, 'link', '/user/return-form', 8, NULL, '', 1, 1),
+(25, 2, 'blog', '/blog', 5, NULL, '', 2, 1),
+(26, 2, 'page', '/page/services', 5, 12, '', 3, 1),
+(27, 2, 'page', '/page/about', 8, 8, '', 3, 1),
+(28, 2, 'link', '/brand', 8, NULL, '', 0, 1),
+(29, 2, 'link', '/vendor', 8, NULL, '', 1, 1),
+(30, 2, 'link', '/cart/compare', 20, NULL, '', 3, 1),
+(31, 2, 'page', '/page/marketplace', 20, 12, '', 4, 1);
diff --git a/install/sql/insert/menu/menu_item_content.sql b/install/sql/insert/menu/menu_item_content.sql
index 6c329f0..535fad0 100755
--- a/install/sql/insert/menu/menu_item_content.sql
+++ b/install/sql/insert/menu/menu_item_content.sql
@@ -1,154 +1,42 @@
-INSERT INTO `menu_item_content` VALUES
-(1,1,'Electronics','Electronics','Electronics'),
-(2,1,'Fashion','Fashion','Fashion'),
-(3,1,'Toys','Toys','Toys'),
-(4,1,'Books','Books','Books'),
-(5,1,'Computers','Computers','Computers'),
-(6,1,'Home and Kitchen','Home and Kitchen','Home and Kitchen'),
-(7,1,'Games','Games','Games'),
-(8,1,'Smartphones','Smartphones','Smartphones'),
-(9,1,'Software','Software','Software'),
-(10,1,'Components','Components','Components'),
-(11,1,'Tablets','Tablets','Tablets'),
-
-(12,1,'Desktops','desktops','Example of menu description text'),
-
-(13,1,'category 1','category 1','category 1'),
-(14,1,'category 2','category 2','category 2'),
-(15,1,'category 5','category 5','category 5'),
-(16,1,'category 4','category 4','category 4'),
-(17,1,'category 6','category 6','category 6'),
-(18,1,'category 7','category 7','category 7'),
-(19,1,'category 8','category 8','category 8'),
-(20,1,'category 9','category 9','category 9'),
-(21,1,'category 11','category 11','category 11'),
-
-(22,1,'MP3 Players','mp3-players','Example of menu description text'),
-
-
-(23,1,'Laptops & Notebooks','laptop-notebooks','Example of menu description text'),
-(24,1,'category 12','category 12','category 12'),
-(25,1,'Windows','Windows','Windows'),
-(26,1,'Gamess','Gamess','Gamess'),
-(27,1,'category 15','category 15','category 15'),
-(28,1,'category 16','category 16','category 16'),
-(29,1,'category 17','category 17','category 17'),
-(30,1,'category 18','category 18','category 18'),
-(31,1,'category 19','category 19','category 19'),
-(32,1,'category 20','category 20','category 20'),
-(33,1,'category 21','category 21','category 21'),
-(34,1,'category 22','category 22','category 22'),
-(35,1,'category 23','category 23','category 23'),
-(36,1,'category 24','category 24','category 24'),
-(37,1,'Tablets','Tablets','Tablets'),
-(38,1,'category 25','category 25','category 25'),
-
-
-(1,2, 'Electronice', 'Electronice', 'Electronice'),
-(2,2, 'Moda', 'Moda', 'Moda'),
-(3,2, 'Jucarii', 'Jucarii', 'Jucarii'),
-(4,2, 'Scannere', 'Scanere', 'Scanere'),
-(5,2, 'Carti', 'Carti', 'Carti'),
-(6,2, 'Casa si Bucatarie', 'Casa si Bucatarie', 'Casa si Bucatarie'),
-(7,2, 'Jocuri', 'Jocuri', 'Jocuri'),
-(8,2, 'Smartphones', 'Smartphones', 'Smartphones'),
-(9,2, 'Software', 'Software', 'Software'),
-(10,2, 'Componente', 'Componente', 'Componente'),
-(11,2, 'Tablete', 'Tablete', 'Tablete'),
-
-(12,2, 'Desktop-uri', 'desktop-uri', 'Exemplu de descriere a categoriei text' ),
-
-(13,2, 'category 1', 'category 1', 'category 1'),
-(14,2, 'category 2', 'category 2', 'category 2'),
-(15,2, 'category 5', 'category 5', 'category 5'),
-(16,2, 'category 4', 'category 4', 'category 4'),
-(17,2, 'category 6', 'category 6', 'category 6'),
-(18,2, 'category 7', 'category 7', 'category 7'),
-(19,2, 'category 8', 'category 8', 'category 8'),
-(20,2, 'category 9', 'category 9', 'category 9'),
-(21,2, 'category 11', 'category 11', 'category 11'),
-
-(22,2, 'Playere MP3', 'playere mp3', 'Example of menu description text') ,
-
-
-(23,2, 'Laptopuri si notebook-uri', 'laptop-notebook-uri', 'Example of menu description text '),
-(24,2, 'category 12', 'category 12', 'category 12'),
-(25,2, 'Windows', 'Windows', 'Windows'),
-(26,2, 'Games-uri', 'Games-uri', 'Games-uri'),
-(27,2, 'category 15', 'category 15', 'category 15'),
-(28,2, 'category 16', 'category 16', 'category 16'),
-(29,2, 'category 17', 'category 17', 'category 17'),
-(30,2, 'category 18', 'category 18', 'category 18'),
-(31,2, 'category 19', 'category 19', 'category 19'),
-(32,2, 'category 20', 'category 20', 'category 20'),
-(33,2, 'category 21', 'category 21', 'category 21'),
-(34,2, 'category 22', 'category 22', 'category 22'),
-(35,2, 'category 23', 'category 23', 'category 23'),
-(36,2, 'category 24', 'category 24', 'category 24'),
-(37,2, 'Tablete', 'Tablete', 'Tablete'),
-(38,2, 'category 25', 'category 25', 'category 25'),
--- tags
-(39,1, 'Tag 1', 'Tag 1', 'tag 1'),
-(40,1, 'Tag 2', 'Tag 2', 'tag 2'),
-(41,1, 'Tag 3', 'Tag 3', 'tag 3'),
--- menu
-(42,1, 'Home', 'Home', ''),
-(43,1, 'Shop', 'Shop', ''),
-
--- (44,1, 'Support', 'Tag 3', 'tag 3'),
--- (45,1, 'User documentation', 'Tag 3', 'tag 3'),
-(46,1, 'Blog', 'Blog', ''),
--- (47,1, 'Forums', 'Forums', 'Forums'),
--- (48,1, 'Developer guide', 'Developer', 'Developer'),
-
-(49,1, 'Contact', 'Contact', ''),
--- (59,1, 'About', 'About', ''),
--- (60,1, 'Support Vvveb', 'Support Vvveb', 'Support Vvveb'),
--- (61,1, 'Contribute', 'Contribute', 'Contribute'),
--- (62,1, 'Translations', 'Translations', 'Translations'),
-
-(63,1, 'Services', 'Services', ''),
-(64,1, 'Pricing', 'Pricing', ''),
-(65,1, 'Services', 'Services', ''),
-(66,1, 'Portfolio', 'Portfolio', ''),
-(67,1, 'Mega menu', '', '<img src="../../media/vvveb.svg" height="24" alt="" class="me-2">Mega menu'),
-(68,1, 'Features', '', '<div class="row">
- <div class="col-4 align-self-center"><img src="../../media/vvveb.svg" alt="Post" width="250" loading="lazy" class="rounded img-fluid"></div>
- <div class="col-8">
- <h4>Features</h4>
- <p class="text-muted">Just a few mentions, but there is more</p>
+INSERT INTO `menu_item_content` (`menu_item_id`, `language_id`, `name`, `slug`, `content`) VALUES
+(1, 1, 'Home', 'Home', ''),
+(2, 1, 'Shop', 'Shop', ''),
+(3, 1, 'Blog', 'Blog', ''),
+(4, 1, 'Contact', 'Contact', ''),
+(5, 1, 'Vvveb', 'Vvveb', ''),
+(6, 1, 'Home', 'Home', ''),
+(7, 1, 'Shop', 'Shop', ''),
+(8, 1, 'Information', 'Information', ''),
+(9, 1, 'Delivery Information', 'Delivery Information', 'Delivery Information'),
+(10, 1, 'Terms and conditions', 'Terms and conditions', ''),
+(11, 1, 'Contact', 'Contact', ''),
+(12, 1, 'Contact us', 'Contact us', ''),
+(13, 1, 'Portfolio', 'Portfolio', ''),
+(14, 1, 'Services', 'Services', ''),
+(15, 1, 'Pricing', 'Pricing', '<p><span style="font-size: 12pt; color: rgb(165, 165, 165);">Fair prices</span></p>'),
+(16, 1, 'Services', 'Services', '<p><span style="font-size: 12pt; color: rgb(165, 165, 165);">Best services</span></p>'),
+(17, 1, 'Portfolio', 'Portfolio', '<p><span style="font-size: 12pt; color: rgb(165, 165, 165);">Our work</span></p>'),
+(18, 1, 'Mega menu', '', '<img src="/media/vvveb.svg" height="24" alt="" class="me-2">'),
+(19, 1, '', '', '
+ <div class="p-4">
+ <p class="lead">Some of the features</p>
<ul class="list-unstyled">
- <li class="text-primary">Page builder</li>
- <li class="text-primary">Mega menu</li>
- <li class="text-primary">Multi language</li>
- <li class="text-primary">Advanced SEO</li>
- <li class="text-primary">Ecommerce</li>
+ <li class="text-secondary">Page builder</li>
+ <li class="text-secondary">Mega menu</li>
+ <li class="text-secondary">Multi language</li>
+ <li class="text-secondary">Advanced SEO</li>
+ <li class="text-secondary">Ecommerce</li>
</ul>
- </div>
-</div>'),
-
--- footer
-(50,1, 'Vvveb', 'Vvveb', ''),
-(51,1, 'Home', 'Home', ''),
-(52,1, 'Shop', 'Shop', ''),
-(74,1, 'Blog', 'Blog', ''),
-(75,1, 'Services', 'Services', ''),
-(76,1, 'About us', 'About us', ''),
-(80,1, 'Marketplace', 'Marketplace', ''),
-
-(53,1, 'Information', 'Information', ''),
-(54,1, 'Delivery Information', 'Delivery Information', 'Delivery Information'),
-(77,1, 'Brands', 'Brands', ''),
-(78,1, 'Vendors', 'Vendors', ''),
-
-(56,1, 'Contact', 'Contact', ''),
-(55,1, 'Terms and conditions', 'Terms and conditions', ''),
-(57,1, 'Contact us', 'Contact us', ''),
-(58,1, 'Portfolio', 'Portfolio', ''),
-(79,1, 'Compare', 'Compare', ''),
-
-(69,1, 'My account', 'My account', ''),
-(70,1, 'Order tracking', 'Order tracking', ''),
-(71,1, 'Wishlist', 'Wishlist', ''),
-(72,1, 'Order history', 'Order history', ''),
-(73,1, 'Returns', 'Returns', '');
+ </div>'),
+(20, 1, 'My account', 'My account', ''),
+(21, 1, 'Order tracking', 'Order tracking', ''),
+(22, 1, 'Wishlist', 'Wishlist', ''),
+(23, 1, 'Order history', 'Order history', ''),
+(24, 1, 'Returns', 'Returns', ''),
+(25, 1, 'Blog', 'Blog', ''),
+(26, 1, 'Services', 'Services', ''),
+(27, 1, 'About us', 'About us', ''),
+(28, 1, 'Brands', 'Brands', ''),
+(29, 1, 'Vendors', 'Vendors', ''),
+(30, 1, 'Compare', 'Compare', ''),
+(31, 1, 'Marketplace', 'Marketplace', '');
\ No newline at end of file
diff --git a/install/sql/insert/menu/menu_to_site.sql b/install/sql/insert/menu/menu_to_site.sql
index 1cc1349..fd36bbb 100755
--- a/install/sql/insert/menu/menu_to_site.sql
+++ b/install/sql/insert/menu/menu_to_site.sql
@@ -1,6 +1,7 @@
INSERT INTO `menu_to_site` VALUES
(1,1),
+(1,2),
+(1,3),
(2,1),
-(3,1),
-(4,1),
-(5,1);
+(2,2),
+(2,3);
diff --git a/install/sql/insert/option/product_option.sql b/install/sql/insert/option/product_option.sql
index 47f397b..073c64b 100755
--- a/install/sql/insert/option/product_option.sql
+++ b/install/sql/insert/option/product_option.sql
@@ -1,4 +1,4 @@
INSERT INTO `product_option` (`product_option_id`, `product_id`, `option_id`, `value`, `required`) VALUES
-('1', '19', '13', '', '1'),
-('2', '19', '12', '', '1'),
-('3', '19', '14', '', '1');
\ No newline at end of file
+('1', '1', '13', '', '1'),
+('2', '1', '12', '', '1'),
+('3', '1', '14', '', '1');
\ No newline at end of file
diff --git a/install/sql/insert/option/product_option_value.sql b/install/sql/insert/option/product_option_value.sql
old mode 100644
new mode 100755
index f57a1e2..b2f93ef
--- a/install/sql/insert/option/product_option_value.sql
+++ b/install/sql/insert/option/product_option_value.sql
@@ -1,10 +1,10 @@
INSERT INTO `product_option_value` (`product_option_value_id`, `product_option_id`, `product_id`, `option_id`, `option_value_id`, `quantity`, `subtract`, `price_operator`, `price`, `points_operator`,`points`, `weight_operator`, `weight`) VALUES
-('1', '1', '19', '13', '13', '10', '0', '+', '0', '+', '0', '+', '0'),
-('2', '1', '19', '13', '14', '0', '0', '+', '0', '+', '0', '+', '0'),
-('3', '1', '19', '13', '15', '0', '0', '+', '3', '+', '0', '+', '0'),
-('4', '2', '19', '12', '10', '10', '0', '+', '0', '+', '0', '+', '0'),
-('5', '2', '19', '12', '11', '10', '0', '+', '0', '+', '0', '+', '0'),
-('6', '2', '19', '12', '12', '10', '0', '+', '0', '+', '0', '+', '0'),
-('7', '3', '19', '14', '16', '10', '0', '+', '0', '+', '0', '+', '0'),
-('8', '3', '19', '14', '17', '10', '0', '+', '0', '+', '0', '+', '0'),
-('9', '3', '19', '14', '18', '10', '0', '+', '0', '+', '0', '+', '0');
\ No newline at end of file
+('1', '1', '1', '13', '13', '10', '0', '+', '0', '+', '0', '+', '0'),
+('2', '1', '1', '13', '14', '0', '0', '+', '0', '+', '0', '+', '0'),
+('3', '1', '1', '13', '15', '0', '0', '+', '3', '+', '0', '+', '0'),
+('4', '2', '1', '12', '10', '10', '0', '+', '0', '+', '0', '+', '0'),
+('5', '2', '1', '12', '11', '10', '0', '+', '0', '+', '0', '+', '0'),
+('6', '2', '1', '12', '12', '10', '0', '+', '0', '+', '0', '+', '0'),
+('7', '3', '1', '14', '16', '10', '0', '+', '0', '+', '0', '+', '0'),
+('8', '3', '1', '14', '17', '10', '0', '+', '0', '+', '0', '+', '0'),
+('9', '3', '1', '14', '18', '10', '0', '+', '0', '+', '0', '+', '0');
\ No newline at end of file
diff --git a/install/sql/insert/post/comment.sql b/install/sql/insert/post/comment.sql
index b3cd080..fc31e19 100755
--- a/install/sql/insert/post/comment.sql
+++ b/install/sql/insert/post/comment.sql
@@ -1,6 +1,6 @@
INSERT INTO `comment` (`comment_id`, `post_id`, `user_id`, `author`, `email`, `url`, `ip`, `content`, `status`, `type`, `votes`, `parent_id`, `created_at`,`updated_at`) VALUES
-(1, 1, 1, 'John Doe', '[email protected]', 'https://vvveb.com', '', 'This is an approved comment.\nThis comment is visible on the hello world post page.', 1, '' , 0, 0, '2022-05-01 00:00:00', '2022-05-01 00:00:00'),
-(2, 1, 1, 'John Doe', '[email protected]', 'https://vvveb.com', '', 'This is a pending comment.\nThis comment is not visible until approved.', 0, '' , 0, 0, '2022-05-01 00:00:00', '2022-05-01 00:00:00'),
-(3, 1, 1, 'John Doe', '[email protected]', 'https://vvveb.com', '', 'This is a spam comment.\nThis comment is flagged as spam because it raised some flags and needs attention before approving.', 2, '' , 0, 0, '2022-05-01 00:00:00', '2022-05-01 00:00:00'),
+(1, 1, 1, 'John Doe', '[email protected]', 'https://vvveb.com', '', 'This is an approved comment. This comment is visible on the hello world post page.', 1, '' , 0, 0, '2022-05-01 00:00:00', '2022-05-01 00:00:00'),
+(2, 1, 1, 'John Doe', '[email protected]', 'https://vvveb.com', '', 'This is a pending comment. This comment is not visible until approved.', 0, '' , 0, 0, '2022-05-01 00:00:00', '2022-05-01 00:00:00'),
+(3, 1, 1, 'John Doe', '[email protected]', 'https://vvveb.com', '', 'This is a spam comment. This comment is flagged as spam because it raised some flags and needs attention before approving.', 2, '' , 0, 0, '2022-05-01 00:00:00', '2022-05-01 00:00:00'),
(4, 1, 1, 'John Doe', '[email protected]', 'https://vvveb.com', '', 'This is a trash comment.',3, '', 0, 0, '2022-05-01 00:00:00', '2022-05-01 00:00:00');
diff --git a/install/sql/insert/post/post.sql b/install/sql/insert/post/post.sql
index 9a6f113..06a7017 100755
--- a/install/sql/insert/post/post.sql
+++ b/install/sql/insert/post/post.sql
@@ -2,21 +2,16 @@
INSERT INTO `post` (`admin_id`, `status`, `image`, `comment_status`, `password`, `parent`, `sort_order`, `type`, `template`, `comment_count`, `created_at`, `updated_at`) VALUES
-(1,'publish','demo/posts/1.jpg','open','',0,0,'post','',0,'2022-05-01 00:00:00','2022-05-01 00:00:00'),
-(1,'publish','demo/posts/2.jpg','open','',0,0,'post','content/post-image-header.html',0,'2022-05-02 00:00:00','2022-05-02 00:00:00'),
-(1,'publish','demo/posts/3.jpg','open','',0,0,'post','',0,'2022-05-03 00:00:00','2022-05-03 00:00:00'),
-(1,'publish','demo/posts/4.jpg','open','',0,0,'post','',0,'2022-06-01 00:00:00','2022-06-01 00:00:00'),
-(1,'publish','demo/posts/5.jpg','open','',0,0,'post','',0,'2022-06-02 00:00:00','2022-06-02 00:00:00'),
-(1,'publish','demo/posts/6.jpg','open','',0,0,'post','',0,'2022-06-03 00:00:00','2022-06-03 00:00:00'),
-(1,'publish','demo/posts/7.jpg','open','',0,0,'page','contact.html',0,'2022-05-01 00:00:00','2022-05-01 00:00:00'),
-(1,'publish','','open','',0,0,'page','',0,'2022-05-01 00:00:00','2022-05-01 00:00:00'),
-(1,'publish','','open','',0,0,'page','',0,'2022-05-01 00:00:00','2022-05-01 00:00:00'),
-(1,'publish','','open','',0,0,'page','',0,'2022-05-01 00:00:00','2022-05-01 00:00:00'),
-(1,'publish','','open','',0,0,'page','about.html',0,'2022-05-01 00:00:00','2022-05-01 00:00:00'),
-(1,'publish','','open','',0,0,'page','services.html',0,'2022-05-01 00:00:00','2022-05-01 00:00:00'),
-(1,'publish','','open','',0,0,'page','pricing.html',0,'2022-05-01 00:00:00','2022-05-01 00:00:00'),
-(1,'publish','','open','',0,0,'page','portfolio.html',0,'2022-05-01 00:00:00','2022-05-01 00:00:00'),
-(1,'publish','','open','',0,0,'page','',0,'2022-05-01 00:00:00','2022-05-01 00:00:00'),
-(1,'publish','','open','',0,0,'page','',0,'2022-05-01 00:00:00','2022-05-01 00:00:00');
+(1,'publish','demo/posts/1.jpg','open','',0,0,'post','',0,'2026-05-01 00:00:00','2026-05-01 00:00:00'),
+(1,'publish','demo/posts/2.jpg','open','',0,0,'post','content/post-image-header.html',0,'2026-05-02 00:00:00','2026-05-02 00:00:00'),
+(1,'publish','demo/posts/1.jpg','open','',0,0,'page','contact.html',0,'2026-05-01 00:00:00','2026-05-01 00:00:00'),
+(1,'publish','','open','',0,0,'page','',0,'2026-05-01 00:00:00','2026-05-01 00:00:00'),
+(1,'publish','','open','',0,0,'page','',0,'2026-05-01 00:00:00','2026-05-01 00:00:00'),
+(1,'publish','','open','',0,0,'page','',0,'2026-05-01 00:00:00','2026-05-01 00:00:00'),
+(1,'publish','','open','',0,0,'page','about.html',0,'2026-05-01 00:00:00','2026-05-01 00:00:00'),
+(1,'publish','','open','',0,0,'page','services.html',0,'2026-05-01 00:00:00','2026-05-01 00:00:00'),
+(1,'publish','','open','',0,0,'page','pricing.html',0,'2026-05-01 00:00:00','2026-05-01 00:00:00'),
+(1,'publish','','open','',0,0,'page','portfolio.html',0,'2026-05-01 00:00:00','2026-05-01 00:00:00'),
+(1,'publish','','open','',0,0,'page','',0,'2026-05-01 00:00:00','2026-05-01 00:00:00');
-- UNLOCK TABLES
diff --git a/install/sql/insert/post/post_content.sql b/install/sql/insert/post/post_content.sql
old mode 100644
new mode 100755
index 64dfcea..6dff6dc
--- a/install/sql/insert/post/post_content.sql
+++ b/install/sql/insert/post/post_content.sql
@@ -1,7 +1,5 @@
INSERT INTO `post_content` VALUES
-
-
(1,1,'Begin each day by telling yourself','hello-world-1',
'<p>
Begin each day by telling yourself:
@@ -60,7 +58,6 @@ INSERT INTO `post_content` VALUES
, 'Today I shall be meeting with interference, ingratitude, insolence, disloyalty, ill-will, and selfishness all of them due to the offenders` ignorance of what is good or evil.', 'Welcome to Vvveb',''),
-
(2,1,'Confession','hello-world-2',
'<p>Not finding an explanation in science I began to seek for it in life, hoping to find it among the people around me. And I began to observe how the people around me people like myself - lived, and what their attitude was to this question which had brought me to despair.</p>
<p>And this is what I found among people who were in the same position as myself as regards education and manner of life.</p>
@@ -80,71 +77,8 @@ INSERT INTO `post_content` VALUES
<p>It was like this: I, my reason, have acknowledged that life is senseless. If there is nothing higher than reason (and there is not: nothing can prove that there is, then reason is the creator of life for me. If reason did not exist there would be for me no life. How can reason deny life when it is the creator of life? Or to put it the other way: were there no life, my reason would not exist; therefore reason is life`s son. Life is all. Reason is its fruit yet reason rejects life itself! I felt that there was something wrong here.</p>
','','',''),
-
-
-
-(3,1,'The work is accomplished, and there is no resting in it','hello-world-3',
-'
-<p>All in the world know the beauty of the beautiful, and in doing this they have (the idea of) what ugliness is; they all know the skill of the skilful, and in doing this they have (the idea of) what the want of skill is.</p>
-
-<p>So it is that existence and nonexistence give birth the one to (the idea of) the other; that difficulty and ease produce the one (the idea of) the other; that length and shortness fashion out the one the figure of the other; that (the ideas of) height and lowness arise from the contrast of the one with the other; that the musical notes and tones become harmonious through the relation of one with another; and that being before and behind give the idea of one following another.</p>
-
-<p>Therefore the sage manages affairs without doing anything, and conveys his instructions without the use of speech.</p>
-
-<p>All things spring up, and there is not one which declines to show itself; they grow, and there is no claim made for their ownership; they go through their processes, and there is no expectation (of a reward for the results). The work is accomplished, and there is no resting in it (as an achievement).</p>
-
-<blockquote>
- <p>
- <span>The work is done, but how no one can see;</span>
- <br />
- <span>`This this that makes the power not cease to be.</span>
- </p>
-</blockquote>
-', '','',''),
-
-
-(4,1,'Aenean ligula justo, viverra in lacus porttitor','hello-world-4','
- <h2>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</h2>
- <p>Mauris viverra cursus ante laoreet eleifend. Donec vel fringilla ante. Aenean finibus velit id urna vehicula, nec maximus est sollicitudin. Praesent at tempus lectus, eleifend blandit felis. Fusce augue arcu, consequat a nisl aliquet, consectetur elementum turpis. Donec iaculis lobortis nisl, et viverra risus imperdiet eu. Etiam mollis posuere elit non sagittis. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc quis arcu a magna sodales venenatis. Integer non diam sit amet magna luctus mollis ac eu nisi. In accumsan tellus ut dapibus blandit.</p>
-
- <blockquote>
- <p>
- Quisque sagittis non ex eget vestibulum. Sed nec ultrices dui. Cras et sagittis erat. Maecenas pulvinar, turpis in dictum tincidunt, dolor nibh lacinia lacus.
- </p>
- </blockquote>
-
- <p>Praesent ac magna sed massa euismod congue vitae vitae risus. Nulla lorem augue, mollis non est et, eleifend elementum ante. Nunc id pharetra magna. Praesent vel orci ornare, blandit mi sed, aliquet nisi. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.</p>', '','',''),
-
-
-(5,1,'Sed viverra pellentesque dictum','hello-world-5','
- <h2>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</h2>
- <p>Mauris viverra cursus ante laoreet eleifend. Donec vel fringilla ante. Aenean finibus velit id urna vehicula, nec maximus est sollicitudin. Praesent at tempus lectus, eleifend blandit felis. Fusce augue arcu, consequat a nisl aliquet, consectetur elementum turpis. Donec iaculis lobortis nisl, et viverra risus imperdiet eu. Etiam mollis posuere elit non sagittis. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc quis arcu a magna sodales venenatis. Integer non diam sit amet magna luctus mollis ac eu nisi. In accumsan tellus ut dapibus blandit.</p>
-
- <blockquote>
- <p>
- Quisque sagittis non ex eget vestibulum. Sed nec ultrices dui. Cras et sagittis erat. Maecenas pulvinar, turpis in dictum tincidunt, dolor nibh lacinia lacus.
- </p>
- </blockquote>
-
- <p>Praesent ac magna sed massa euismod congue vitae vitae risus. Nulla lorem augue, mollis non est et, eleifend elementum ante. Nunc id pharetra magna. Praesent vel orci ornare, blandit mi sed, aliquet nisi. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.</p>', 'Et ut aliquid blanditiis id sit et. Est ea ut tenetur veritatis recusandae est voluptatem.','',''),
-
-
-(6,1,'Mauris viverra cursus ante laoreet eleifend','hello-world-6','
- <h2>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</h2>
- <p>Mauris viverra cursus ante laoreet eleifend. Donec vel fringilla ante. Aenean finibus velit id urna vehicula, nec maximus est sollicitudin. Praesent at tempus lectus, eleifend blandit felis. Fusce augue arcu, consequat a nisl aliquet, consectetur elementum turpis. Donec iaculis lobortis nisl, et viverra risus imperdiet eu. Etiam mollis posuere elit non sagittis. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc quis arcu a magna sodales venenatis. Integer non diam sit amet magna luctus mollis ac eu nisi. In accumsan tellus ut dapibus blandit.</p>
-
- <blockquote>
- <p>
- Quisque sagittis non ex eget vestibulum. Sed nec ultrices dui. Cras et sagittis erat. Maecenas pulvinar, turpis in dictum tincidunt, dolor nibh lacinia lacus.
- </p>
- </blockquote>
- <p>Praesent ac magna sed massa euismod congue vitae vitae risus. Nulla lorem augue, mollis non est et, eleifend elementum ante. Nunc id pharetra magna. Praesent vel orci ornare, blandit mi sed, aliquet nisi. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.</p>',
- 'Et et saepe suscipit debitis a accusamus nulla in amet molestiae voluptates dolor autem vitae optio ipsa mollitia voluptatem vitae.','',''),
-
-
-
-(7,1,'Contact us','contact','<p>
+(3,1,'Contact us','contact','<p>
Powerful and easy to use drag and drop website builder for blogs, presentation or ecommerce stores.
</p>
@@ -168,7 +102,7 @@ INSERT INTO `post_content` VALUES
</a>
</p>', '','',''),
-(8,1,'Shipping & Delivery','shipping-delivery','
+(4,1,'Shipping & Delivery','shipping-delivery','
<h2>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</h2>
<p>Mauris viverra cursus ante laoreet eleifend. Donec vel fringilla ante. Aenean finibus velit id urna vehicula, nec maximus est sollicitudin. Praesent at tempus lectus, eleifend blandit felis. Fusce augue arcu, consequat a nisl aliquet, consectetur elementum turpis. Donec iaculis lobortis nisl, et viverra risus imperdiet eu. Etiam mollis posuere elit non sagittis. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc quis arcu a magna sodales venenatis. Integer non diam sit amet magna luctus mollis ac eu nisi. In accumsan tellus ut dapibus blandit.</p>
@@ -180,133 +114,10 @@ INSERT INTO `post_content` VALUES
<p>Praesent ac magna sed massa euismod congue vitae vitae risus. Nulla lorem augue, mollis non est et, eleifend elementum ante. Nunc id pharetra magna. Praesent vel orci ornare, blandit mi sed, aliquet nisi. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.</p>', '','',''),
-(9,1,'Terms and conditions','terms-conditions','Terms & Conditions', '','',''),
-
-(10,1,'Privacy policy','privacy-policy','Privacy Policy', '','',''),
-
-(11,1,'About','about','
-<div class="my-5"><img src="../../media/biglogo.png"></div>
-<hr class="my-5 border">
-<p>Powerful and easy to use drag and drop website builder for blogs, presentation or ecommerce stores.</p>
-<p>The html for sections blocks and components and this template are built using Bootstrap 5.</p>
-<hr class="my-5 border">
-<h6>Better Security</h6>
-<p>Vvveb is 100% safe against sql injections, a vulerability that affects most CMS.</p>
-<h6>Unlimited customization</h6>
-<p>Vvveb uses only html for templating for maximum flexibility.</p>
-<h6>Advanced Ecommerce</h6>
-<p>Vvveb is a full featured ecommerce platform with advanced functionality.</p>
-<h6>Full Localization</h6>
-<p>Publish content in multiple languages or sell in different currencies.</p>
-', '','',''),
-(12,1,'Services','services','Services', '','',''),
-(13,1,'Pricing','pricing','Pricing', '','',''),
-(14,1,'Portfolio','portfolio','Portfolio', '','',''),
-(15,1,'Marketplace','marketplace', '
-<div class="text-center m-4">
-<div class="my-5"><img src="../../media/biglogo.png"></div>
-<h1 class="mb-3">Marketplace vendor</h1>
-<p class="lead">Become a vendor and sell your products on our marketplace</p>
-<p class="lead">Access a market of million of customers</p>
-<div class="mt-4"><a href="/vendor/signup" class="btn btn-primary btn-lg btn-login"><span>Signup now</span> <i class="la la-arrow-right float-end ms-2"></i></a> <a href="/vendor" class="btn btn-secondary btn-lg"><span>Login</span> <i class="la la-user float-end ms-2"></i></a></div>
-<div class="mt-4">Frequently asked questions:</div>
-<div class="my-4 text-start row">
-<div class="col-md-6 mx-auto">
-<details>
-<summary>What kind of products can I sell?</summary>
-<p>You can sell any products that match our categories.</p>
-</details>
-<details>
-<summary>How much does it cost?</summary>
-<p>It`s free, we only take a ##% comission on each sale.</p>
-</details>
-<details>
-<summary>Q3</summary>
-<p>A</p>
-</details>
-<details>
-<summary>Q4</summary>
-<p>A</p>
-</details>
-<br>
-<p class="">Check our <a href="/blog">knowledge base</a> for more information </p>
-</div>
-</div>
-<p class="text-muted small">Our marketplace is subject to certain <a href="/page/terms-conditions-9">terms and conditions</a></p>
-</div>','Marketplace','',''),
-(16,1,'Subscription policy','subscription-policy','Subscription policy', '','',''),
-
-(1,2,'Incepe fiecare zi prin a-ti spune','buna-lume-1','
-<blockquote cite="https://en.wikipedia.org/wiki/Marcus_Aurelius">
- <p>Spuneţi în fiecare dimineaţă: astăzi o să mă întâlnesc cu un om nechibzuit, nerecunoscător, neruşinat, viclean, invidios, nesociabil. Toate defectele acestea sunt urmările neştiinţei oamenilor cu privire la bine şi la rău. Eu însă am recunoscut clar că binele din firea sa este frumos, şi răul este urât, că omul care păcătuieşte contra mea, în realitate îmi este înrudit, nu doar că am fi din acelaşi sânge şi origine, ci fiindcă suntem deopotrivă părtaşi la raţiune, la menirea divină.</p>
- <cite class="small">
- <a href="https://en.wikipedia.org/wiki/Marcus_Aurelius" class="text-decoration-none" target="blank">Marcus Aurelius</a>
- </cite>
-</blockquote>','','',''),
-
-
-(2,2,'Buna lume 2','buna-lume-2','Confesiuni', 'Quisque sagittis non ex eget vestibulum. Sed nec ultrices dui. Cras et sagittis erat. Maecenas pulvinar, turpis in dictum tincidunt, dolor nibh lacinia lacus.','',''),
-(3,2,'Buna lume 3','buna-lume-3', 'Quisque sagittis non ex eget vestibulum. Sed nec ultrices dui. Cras et sagittis erat. Maecenas pulvinar, turpis in dictum tincidunt, dolor nibh lacinia lacus.','','',''),
-(4,2,'Buna lume 4','buna-lume-4','Quisque sagittis non ex eget vestibulum. Sed nec ultrices dui. Cras et sagittis erat. Maecenas pulvinar, turpis in dictum tincidunt, dolor nibh lacinia lacus.','','',''),
-(5,2,'Buna lume 5','buna-lume-5', 'Quisque sagittis non ex eget vestibulum. Sed nec ultrices dui. Cras et sagittis erat. Maecenas pulvinar, turpis in dictum tincidunt, dolor nibh lacinia lacus.','','',''),
-(6,2,'Buna lume 6','buna-lume-6', 'Quisque sagittis non ex eget vestibulum. Sed nec ultrices dui. Cras et sagittis erat. Maecenas pulvinar, turpis in dictum tincidunt, dolor nibh lacinia lacus.','','',''),
-(7,2,'Contacteaza-ne','contact','<p class="lead">
- Unealta puternica si usor de folosit pentru a realiza blog-uri, site-uri de prezentare sau magazine online.
- </p>
-
- <p class="lead">
- The html for sections blocks and components and this template are built using Bootstrap 5.
- </p>
-
-
- <p class="mt-5">
- <span><i class="la la-lg la-envelope"></i> Email:</span>
- <span>
- <a href="mailto:[email protected]">
- <span>[email protected]</span>
- </a>
- </span>
- </p>
- <p class="">
- <span><i class="la la-lg la-phone"></i> Phone:</span>
- <a href="tel:5511112377">
- <span>+55 (111) 123 777</span>
- </a>
- </p>', '','',''),
-
-(8,2,'Expediere si livrare','livrare','
- <h2>Expediere si livrare</h2>
- <p>Mauris viverra cursus ante laoreet eleifend. Donec vel fringilla ante. Aenean finibus velit id urna vehicula, nec maximus est sollicitudin. Praesent at tempus lectus, eleifend blandit felis. Fusce augue arcu, consequat a nisl aliquet, consectetur elementum turpis. Donec iaculis lobortis nisl, et viverra risus imperdiet eu. Etiam mollis posuere elit non sagittis. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc quis arcu a magna sodales venenatis. Integer non diam sit amet magna luctus mollis ac eu nisi. In accumsan tellus ut dapibus blandit.</p>
-
- <blockquote>
- <p>
- Quisque sagittis non ex eget vestibulum. Sed nec ultrices dui. Cras et sagittis erat. Maecenas pulvinar, turpis in dictum tincidunt, dolor nibh lacinia lacus.
- </p>
- </blockquote>
-
- <p>Praesent ac magna sed massa euismod congue vitae vitae risus. Nulla lorem augue, mollis non est et, eleifend elementum ante. Nunc id pharetra magna. Praesent vel orci ornare, blandit mi sed, aliquet nisi. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.</p>', '','',''),
-
-(9,2,'Termeni si conditii','termeni-conditii','Termeni si conditii', '','',''),
-
-(10,2,'Politica confidentialitate','politica-confidentialitate','Politica confidentialitate', '','',''),
-
-(11,2,'Despre','despre','
-<div class="my-5 text-center"><img src="../../media/biglogo.png"></div>
-<hr class="my-5 border">
-<p>Unealta puternica si usor de folosit pentru a realiza blog-uri, site-uri de prezentare sau magazine online.</p>
-<p>The html for sections blocks and components and this template are built using Bootstrap 5.</p>
-<hr class="my-5 border">
-<h6>Better Security</h6>
-<p>Vvveb is 100% safe against sql injections, a vulerability that affects most CMS.</p>
-<h6>Unlimited customization</h6>
-<p>Vvveb uses only html for templating for maximum flexibility.</p>
-<h6>Advanced Ecommerce</h6>
-<p>Vvveb is a full featured ecommerce platform with advanced functionality.</p>
-<h6>Full Localization</h6>
-<p>Publish content in multiple languages or sell in different currencies.</p>
-', '','',''),
-(12,2,'Servicii','servicii','Servicii', '','',''),
-(13,2,'Preturi','preturi','Preturi', '','',''),
-(14,2,'Portfoliu','portfoliu','Portfoliu', '','',''),
-(15,2,'Piata','piata','piata', '','',''),
-(16,2,'Politica subscriptii','politica-subscriptii','Politica subscriptii', '','','');
+(5,1,'Terms and conditions','terms-conditions','<div>Terms & Conditions</div>', '','',''),
+(6,1,'Privacy policy','privacy-policy','<div>Privacy Policy</div>', '','',''),
+(7,1,'About','about','<div>About</div>', '','',''),
+(8,1,'Services','services','<div>Services</div>', '','',''),
+(9,1,'Pricing','pricing','<div>Pricing</div>', '','',''),
+(10,1,'Portfolio','portfolio','<div>Portfolio</div>', '','',''),
+(11,1,'Subscription policy','subscription-policy','<div>Subscription policy</div>', '','','');
\ No newline at end of file
diff --git a/install/sql/insert/post/post_to_site.sql b/install/sql/insert/post/post_to_site.sql
index 858cad3..826b1c4 100755
--- a/install/sql/insert/post/post_to_site.sql
+++ b/install/sql/insert/post/post_to_site.sql
@@ -7,11 +7,4 @@ INSERT INTO `post_to_site` VALUES
(6,1),
(7,1),
(8,1),
-(9,1),
-(10,1),
-(11,1),
-(12,1),
-(13,1),
-(14,1),
-(15,1),
-(16,1);
\ No newline at end of file
+(9,1);
\ No newline at end of file
diff --git a/install/sql/insert/product/manufacturer.sql b/install/sql/insert/product/manufacturer.sql
index 25ce622..73df099 100755
--- a/install/sql/insert/product/manufacturer.sql
+++ b/install/sql/insert/product/manufacturer.sql
@@ -1,7 +1,2 @@
INSERT INTO `manufacturer` VALUES
-(1,'Assos','assos','demo/posts/1.jpg',0),
-(2,'Apple','apple','demo/posts/2.jpg',0),
-(3,'Samsung','samsung','demo/posts/3.jpg',0),
-(4,'Xiaomi','xiaomi','demo/posts/4.jpg',0),
-(5,'Huawei','huawei','demo/posts/5.jpg',0),
-(6,'Mango','mango','demo/posts/6.jpg',0);
+(1,'Assos','assos','demo/posts/1.jpg',0);
diff --git a/install/sql/insert/product/manufacturer_to_site.sql b/install/sql/insert/product/manufacturer_to_site.sql
index 86c62fe..900eda3 100755
--- a/install/sql/insert/product/manufacturer_to_site.sql
+++ b/install/sql/insert/product/manufacturer_to_site.sql
@@ -1,7 +1,2 @@
INSERT INTO `manufacturer_to_site` VALUES
-(1,1),
-(2,1),
-(3,1),
-(4,1),
-(5,1),
-(6,1);
\ No newline at end of file
+(1,1);
\ No newline at end of file
diff --git a/install/sql/insert/product/product.sql b/install/sql/insert/product/product.sql
old mode 100644
new mode 100755
index 175c3f0..4983d74
--- a/install/sql/insert/product/product.sql
+++ b/install/sql/insert/product/product.sql
@@ -1,21 +1,3 @@
INSERT INTO `product` (`admin_id`,`model`, `sku`, `upc`, `ean`, `jan`, `isbn`, `mpn`, `location`, `stock_quantity`, `stock_status_id`, `image`, `manufacturer_id`, `vendor_id`, `requires_shipping`, `price`, `old_price`, `points`, `tax_type_id`, `date_available`, `weight`, `weight_type_id`, `length`, `width`, `height`, `length_type_id`, `subtract_stock`, `minimum_quantity`, `sort_order`, `status`, `type`, `template`, `views`, `created_at`, `updated_at`) VALUES
(1, 'Product 1','','','','','','','',939,7,'demo/products/1-1.jpg',1,1,1,99.00,0, 200,1,'2023-05-01',146.40000000,2,0.0000,0.0000,0.0000,1,1,1,0,1, 'product', '', 0,'2022-05-01 00:00:00','2022-05-01 00:00:00'),
-(1, 'Product 2','','','','','','','',999,6,'demo/products/2-1.jpg',2,1,1,279.9900,0, 0,1,'2023-05-01',133.0000,2,0.0000,0.0000,0.0000,3,1,1,0,1, 'product', '', 0,'2022-05-01 00:00:00','2022-05-01 00:00:00'),
-(1, 'Product 3','','','','','','','',7,6,'demo/products/3-1.jpg',3,1,1,100.00,0, 0,1,'2023-05-01',0.0000,1,0.0000,0.0000,0.0000,1,1,1,0,1, 'product', '', 0,'2022-05-01 00:00:00','2022-05-01 00:00:00'),
-(1, 'Product 4','','','','','','','',1000,6,'demo/products/4-1.jpg',0,1,1,80.00,0, 0,1,'2023-05-01',0.0000,1,0.0000,0.0000,0.0000,3,1,1,0,1, 'product', '', 0,'2022-05-01 00:00:00','2022-05-01 00:00:00'),
-(1, 'Product 5','','','','','','','',999,6,'demo/products/5-1.jpg',4,1,1,100.00,0, 0,1,'2023-05-01',5.0000,1,0.0000,0.0000,0.0000,1,1,1,0,1, 'product', '', 0,'2022-05-01 00:00:00','2022-05-01 00:00:00'),
-(1, 'Product 6','','','','','','','',1000,6,'demo/products/6-1.jpg',0,1,1,200.00,0, 0,1,'2023-05-01',5.0000,1,0.0000,0.0000,0.0000,2,1,1,0,1, 'product', '', 0,'2022-05-01 00:00:00','2022-05-01 00:00:00'),
-(1, 'Product 7','','','','','','','',1000,6,'demo/products/7-1.jpg',1,1,1,100.00,0, 0,1,'2023-05-01',5.0000,1,0.0000,0.0000,0.0000,2,1,1,0,1, 'product', '', 0,'2022-05-01 00:00:00','2022-05-01 00:00:00'),
-(1, 'Product 8','','','','','','','',1000,5,'demo/products/8-1.jpg',0,0,1,100.00,0, 0,1,'2023-05-01',5.0000,1,0.0000,0.0000,0.0000,1,1,1,0,1, 'product', '', 0,'2022-05-01 00:00:00','2022-05-01 00:00:00'),
-(1, 'Product 9','','','','','','','',994,6,'demo/products/9-1.jpg',2,0,1,100.00,0, 1,1,'2023-05-01',5.0000,1,0.0000,0.0000,0.0000,2,1,1,0,1, 'product', '', 0,'2022-05-01 00:00:00','2022-05-01 00:00:00'),
-
-(1, 'Product 10','','','','','','','',970,5,'demo/products/10-1.jpg',3,1,1,101.00,0, 0,1,'2023-05-01',10.0000,1,0.0000,0.0000,0.0000,1,1,1,0,1, 'product', '', 0,'2022-05-01 00:00:00','2022-05-01 00:00:00'),
-(1, 'Product 11','','','','','','','',977,5,'demo/products/1-1.jpg',4,1,1,100.00,0, 0,1,'2023-05-01',5.0000,1,0.0000,0.0000,0.0000,1,1,1,0,1, 'product', '', 0,'2022-05-01 00:00:00','2022-05-01 00:00:00'),
-(1, 'Product 12','','','','','','','',990,5,'demo/products/2-1.jpg',1,1,1,100.00,0, 400,1,'2009-02-04',12.50000000,1,1.0000,2.0000,3.0000,1,1,2,0,1, 'product', '', 0,'2022-05-01 00:00:00','2022-05-01 00:00:00'),
-(1, 'Product 13','','','','','','','',929,5,'demo/products/3-1.jpg',2,0,1,500.00,0, 0,1,'2023-05-01',0.0000,1,0.0000,0.0000,0.0000,2,1,1,0,1, 'product', '', 0,'2022-05-01 00:00:00','2022-05-01 00:00:00'),
-(1, 'Product 14','','','','','','','',1000,5,'demo/products/4-1.jpg',3,1,1,1000.00,0, 0,1,'2023-05-01',0.0000,1,0.0000,0.0000,0.0000,2,1,1,0,1, 'product', '', 0,'2022-05-01 00:00:00','2022-05-01 00:00:00'),
-(1, 'Product 15','','','','','','','',998,5,'demo/products/5-1.jpg',3,1,1,2000.00,0, 0,1,'2023-05-01',0.0000,1,0.0000,0.0000,0.0000,2,1,1,0,1, 'product', '', 0,'2022-05-01 00:00:00','2022-05-01 00:00:00'),
-(1, 'Product 16','','','','','','','',1000,5,'demo/products/6-1.jpg',4,1,1,1000.00,0, 0,1,'2023-05-01',0.0000,1,0.0000,0.0000,0.0000,2,1,1,0,1, 'product', '', 0,'2022-05-01 00:00:00','2022-05-01 00:00:00'),
-(1, 'Product 17','','','','','','','',0,5,'demo/products/7-1.jpg',5,1,1,100.00,0, 400,1,'2023-05-01',1.0000,1,0.0000,0.0000,0.0000,1,0,1,0,1, 'product', '', 0,'2022-05-01 00:00:00','2022-05-01 00:00:00'),
-(1, 'Product 18','test 1','','','','','','test 2',995,5,'demo/products/8-1.jpg',1,1,1,100.00,120.00, 0,1,'2009-02-08',1.0000,1,0.0000,0.0000,0.0000,2,1,1,0,1, 'product', '', 0,'2022-05-01 00:00:00','2022-05-01 00:00:00'),
-(1, 'Product 19','','','','','','','',1000,1,'demo/products/9-1.jpg',0,1,1,199.9900,0, 0,1,'2011-04-25',0.0000,1,0.0000,0.0000,0.0000,1,1,1,1,1, 'product', '', 0,'2022-05-01 00:00:00','2022-05-01 00:00:00');
+(1, 'Product 2','','','','','','','',999,6,'demo/products/2-1.jpg',2,1,1,279.9900,0, 0,1,'2023-05-01',133.0000,2,0.0000,0.0000,0.0000,3,1,1,0,1, 'product', '', 0,'2022-05-01 00:00:00','2022-05-01 00:00:00');
diff --git a/install/sql/insert/product/product_content.sql b/install/sql/insert/product/product_content.sql
index 0496843..4b2bdae 100755
--- a/install/sql/insert/product/product_content.sql
+++ b/install/sql/insert/product/product_content.sql
@@ -2,69 +2,4 @@ INSERT INTO `product_content` (`product_id`, `language_id`, `name`,`slug`,`conte
(1,1,'Product 1', 'product-one','Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua','Lorem ipsum dolor sit amet','Product 1','',''),
-(2,1,'Product 2', 'product-two','Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua','Lorem ipsum dolor sit amet','Product 2','',''),
-
-
-(3,1,'Product 3', 'product-three','Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua','Lorem ipsum dolor sit amet','Product 3','',''),
-
-
-(4,1,'Product 4', 'product-four','Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua','Lorem ipsum dolor sit amet','Product 4','',''),
-
-
-(5,1,'Product 5', 'product-five','Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua','Lorem ipsum dolor sit amet','Product 5','',''),
-
-
-(6,1,'Product 6', 'product-six','Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua','Lorem ipsum dolor sit amet','Product 6','',''),
-
-
-(7,1,'Product 7', 'product-seven','Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua','Lorem ipsum dolor sit amet','Product 7','',''),
-
-
-(8,1,'Product 8', 'product-eight','Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua','Lorem ipsum dolor sit amet','Product 8','',''),
-
-
-(9,1,'Product 9', 'product-nine','Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua','Lorem ipsum dolor sit amet','Product 9','',''),
-
-
-(10,1,'Product 10', 'product-ten','Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua','Lorem ipsum dolor sit amet','Product 10','',''),
-
-
-(11,1,'Product 11', 'product-eleven','Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua','Lorem ipsum dolor sit amet','Product 11','',''),
-
-
-(12,1,'Product 12', 'product-twelve','Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua','Lorem ipsum dolor sit amet','Product 12','',''),
-
-
-(13,1,'Product 13', 'product-thirteen','Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua','Lorem ipsum dolor sit amet','Product 13','',''),
-
-
-(14,1,'Product 14', 'product-fourteen','Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua','Lorem ipsum dolor sit amet','Product 14','',''),
-
-
-(15,1,'Product 15', 'product-fifteen','Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua','Lorem ipsum dolor sit amet','Product 15','',''),
-
-
-(16,1,'Product 16', 'product-sixteen','Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua','Lorem ipsum dolor sit amet','Product 16','',''),
-
-
-(17,1,'Product 17', 'product-seventeen','Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua','Lorem ipsum dolor sit amet','Product 17','',''),
-
-
-(18,1,'Product 18','product-eighteen','Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua','Lorem ipsum dolor sit amet','Product 18','',''),
-
-
-(19,1,'Product 19', 'product-nineteen','<p>All in the world know the beauty of the beautiful, and in doing this they have (the idea of) what ugliness is; they all know the skill of the skilful, and in doing this they have (the idea of) what the want of skill is.</p>
-
-<p>So it is that existence and nonexistence give birth the one to (the idea of) the other; that difficulty and ease produce the one (the idea of) the other; that length and shortness fashion out the one the figure of the other; that (the ideas of) height and lowness arise from the contrast of the one with the other; that the musical notes and tones become harmonious through the relation of one with another; and that being before and behind give the idea of one following another.</p>
-
-<p>Therefore the sage manages affairs without doing anything, and conveys his instructions without the use of speech.</p>
-
-<p>All things spring up, and there is not one which declines to show itself; they grow, and there is no claim made for their ownership; they go through their processes, and there is no expectation (of a reward for the results). The work is accomplished, and there is no resting in it (as an achievement).</p>
-
-<blockquote>
- <p>
- <span>The work is done, but how no one can see;</span>
- <br />
- <span>`This this that makes the power not cease to be.</span>
- </p>
-</blockquote>','Lorem ipsum dolor sit amet','Product 19','','');
+(2,1,'Product 2', 'product-two','Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua','Lorem ipsum dolor sit amet','Product 2','','');
diff --git a/install/sql/insert/product/product_discount.sql b/install/sql/insert/product/product_discount.sql
index b6ad2a1..9ca3add 100755
--- a/install/sql/insert/product/product_discount.sql
+++ b/install/sql/insert/product/product_discount.sql
@@ -1,4 +1,3 @@
INSERT INTO `product_discount` VALUES
(1,19,1,30,1,66.0000,'2022-05-01 00:00:00', '2022-05-01 00:00:00'),
-(2,19,1,20,1,77.0000,'2022-05-01 00:00:00', '2022-05-01 00:00:00'),
-(3,19,1,10,1,88.0000,'2022-05-01 00:00:00', '2022-05-01 00:00:00');
\ No newline at end of file
+(2,19,1,20,1,77.0000,'2022-05-01 00:00:00', '2022-05-01 00:00:00');
\ No newline at end of file
diff --git a/install/sql/insert/product/product_image.sql b/install/sql/insert/product/product_image.sql
index f7efed1..b8e4474 100755
--- a/install/sql/insert/product/product_image.sql
+++ b/install/sql/insert/product/product_image.sql
@@ -6,68 +6,4 @@ INSERT INTO `product_image` (product_id,image) VALUES
-- 2
(2,'demo/products/2-1.jpg'),
(2,'demo/products/2-2.jpg'),
-(2,'demo/products/3-3.jpg'),
--- 3
-(3,'demo/products/3-1.jpg'),
-(3,'demo/products/3-2.jpg'),
-(3,'demo/products/3-3.jpg'),
--- 4
-(4,'demo/products/4-1.jpg'),
-(4,'demo/products/4-2.jpg'),
-(4,'demo/products/4-3.jpg'),
--- 5
-(5,'demo/products/5-1.jpg'),
-(5,'demo/products/5-2.jpg'),
--- 6
-(6,'demo/products/6-1.jpg'),
-(6,'demo/products/6-2.jpg'),
-(6,'demo/products/6-3.jpg'),
--- 7
-(7,'demo/products/7-1.jpg'),
-(7,'demo/products/7-2.jpg'),
--- 8
-(8,'demo/products/8-1.jpg'),
-(8,'demo/products/8-2.jpg'),
-(8,'demo/products/8-3.jpg'),
--- 9
-(9,'demo/products/9-1.jpg'),
-(9,'demo/products/9-2.jpg'),
-(9,'demo/products/9-3.jpg'),
--- 10
-(10,'demo/products/10-1.jpg'),
-(10,'demo/products/10-2.jpg'),
-(10,'demo/products/10-3.jpg'),
--- 11
-(11,'demo/products/1-1.jpg'),
-(11,'demo/products/1-2.jpg'),
-(11,'demo/products/1-3.jpg'),
--- 12
-(12,'demo/products/2-1.jpg'),
-(12,'demo/products/2-2.jpg'),
-(12,'demo/products/3-3.jpg'),
--- 13
-(13,'demo/products/3-1.jpg'),
-(13,'demo/products/3-2.jpg'),
-(13,'demo/products/3-3.jpg'),
--- 14
-(14,'demo/products/4-1.jpg'),
-(14,'demo/products/4-2.jpg'),
-(14,'demo/products/4-3.jpg'),
--- 15
-(15,'demo/products/5-1.jpg'),
-(15,'demo/products/5-2.jpg'),
--- 16
-(16,'demo/products/6-1.jpg'),
-(16,'demo/products/6-2.jpg'),
-(16,'demo/products/6-3.jpg'),
--- 7
-(17,'demo/products/7-1.jpg'),
-(17,'demo/products/7-2.jpg'),
--- 18
-(18,'demo/products/8-1.jpg'),
-(18,'demo/products/8-2.jpg'),
-(18,'demo/products/8-3.jpg'),
--- 19
-(19,'demo/products/9-1.jpg'),
-(19,'demo/products/9-2.jpg'),
-(19,'demo/products/9-3.jpg');
\ No newline at end of file
+(2,'demo/products/3-3.jpg');
\ No newline at end of file
diff --git a/install/sql/insert/product/product_points.sql b/install/sql/insert/product/product_points.sql
old mode 100644
new mode 100755
index 66e6dc2..83fa712
--- a/install/sql/insert/product/product_points.sql
+++ b/install/sql/insert/product/product_points.sql
@@ -1,12 +1,3 @@
INSERT INTO `product_points` (`product_points_id`, `product_id`, `user_group_id`, `points`) VALUES
-(1, 19, 1, 600),
-(2, 18, 1, 700),
-(3, 17, 1, 800),
-(4, 16, 1, 100),
-(5, 15, 1, 200),
-(6, 14, 1, 300),
-(7, 13, 1, 400),
-(8, 12, 1, 500),
-(9, 11, 1, 100),
-(10, 10, 1, 200),
-(11, 9, 1, 300);
\ No newline at end of file
+(1, 1, 1, 600),
+(2, 2, 1, 700);
\ No newline at end of file
diff --git a/install/sql/insert/product/product_promotion.sql b/install/sql/insert/product/product_promotion.sql
old mode 100644
new mode 100755
index c0ada00..19b4766
--- a/install/sql/insert/product/product_promotion.sql
+++ b/install/sql/insert/product/product_promotion.sql
@@ -1,2 +1,2 @@
INSERT INTO `product_promotion` (`product_promotion_id`, `product_id`, `user_group_id`, `priority`, `price`, `from_date`, `to_date`) VALUES
-(1, 19, 1, 1, 20.0000, '2023-10-20', '2023-10-20');
\ No newline at end of file
+(1, 1, 1, 1, 20.0000, '2023-10-20', '2023-10-20');
\ No newline at end of file
diff --git a/install/sql/insert/product/product_related.sql b/install/sql/insert/product/product_related.sql
old mode 100644
new mode 100755
index dfa91af..a2d23e3
--- a/install/sql/insert/product/product_related.sql
+++ b/install/sql/insert/product/product_related.sql
@@ -1,5 +1,2 @@
INSERT INTO `product_related` (`product_id`, `product_related_id`) VALUES
-(19, 15),
-(19, 16),
-(19, 17),
-(19, 18);
\ No newline at end of file
+(1, 2);
\ No newline at end of file
diff --git a/install/sql/insert/product/product_review.sql b/install/sql/insert/product/product_review.sql
index c781e22..3450476 100755
--- a/install/sql/insert/product/product_review.sql
+++ b/install/sql/insert/product/product_review.sql
@@ -1,7 +1,4 @@
INSERT INTO `product_review` (`product_review_id`, `product_id`, `user_id`, `author`, `content`, `rating`, `status`, `parent_id`, `created_at`, `updated_at`) VALUES
-(1, 19, 1, 'John Doe', 'Cool product!', 5, 1, 0, '2022-05-01 00:00:00', '2022-05-01 00:00:00'),
-(2, 19, 1, 'John Doe', 'This is another review', 5, 1, 0, '2022-05-01 00:00:00', '2022-05-01 00:00:00'),
-(3, 19, 1, 'John Doe', 'Pending review', 5, 0, 0, '2022-05-01 00:00:00', '2022-05-01 00:00:00'),
-(4, 19, 1, 'John Doe', 'Spam review', 5, 2, 0, '2022-05-01 00:00:00', '2022-05-01 00:00:00'),
-(5, 19, 1, 'John Doe', 'Trash review', 5, 3, 0, '2022-05-01 00:00:00', '2022-05-01 00:00:00');
\ No newline at end of file
+(1, 2, 1, 'John Doe', 'Cool product!', 5, 0, 0, '2022-05-01 00:00:00', '2022-05-01 00:00:00'),
+(2, 2, 1, 'John Doe', 'This is another review', 5, 0, 0, '2022-05-01 00:00:00', '2022-05-01 00:00:00');
\ No newline at end of file
diff --git a/install/sql/insert/product/product_review_media.sql b/install/sql/insert/product/product_review_media.sql
index 2e1d9df..dea8cce 100755
--- a/install/sql/insert/product/product_review_media.sql
+++ b/install/sql/insert/product/product_review_media.sql
@@ -1,20 +1,9 @@
INSERT INTO `product_review_media` (product_review_id, product_id, user_id, image) VALUES
-- 1
-(1,19,1,'demo/products/1-1.jpg'),
-(1,19,1,'demo/products/1-2.jpg'),
-(1,19,1,'demo/products/1-3.jpg'),
+(1,2,1,'demo/products/1-1.jpg'),
+(1,2,1,'demo/products/1-2.jpg'),
+(1,2,1,'demo/products/1-3.jpg'),
-- 2
-(2,19,1,'demo/products/2-1.jpg'),
-(2,19,1,'demo/products/2-2.jpg'),
-(2,19,1,'demo/products/3-3.jpg'),
--- 3
-(3,19,1,'demo/products/3-1.jpg'),
-(3,19,1,'demo/products/3-2.jpg'),
-(3,19,1,'demo/products/3-3.jpg'),
--- 4
-(4,19,1,'demo/products/4-1.jpg'),
-(4,19,1,'demo/products/4-2.jpg'),
-(4,19,1,'demo/products/4-3.jpg'),
--- 5
-(5,19,1,'demo/products/5-1.jpg'),
-(5,19,1,'demo/products/5-2.jpg');
\ No newline at end of file
+(2,2,1,'demo/products/2-1.jpg'),
+(2,2,1,'demo/products/2-2.jpg'),
+(2,2,1,'demo/products/3-3.jpg');
\ No newline at end of file
diff --git a/install/sql/insert/product/product_to_site.sql b/install/sql/insert/product/product_to_site.sql
index b2c17eb..5193064 100755
--- a/install/sql/insert/product/product_to_site.sql
+++ b/install/sql/insert/product/product_to_site.sql
@@ -1,20 +1,3 @@
INSERT INTO `product_to_site` VALUES
(1,1),
-(2,1),
-(3,1),
-(4,1),
-(5,1),
-(6,1),
-(7,1),
-(8,1),
-(9,1),
-(10,1),
-(11,1),
-(12,1),
-(13,1),
-(14,1),
-(15,1),
-(16,1),
-(17,1),
-(18,1),
-(19,1);
+(2,1);
diff --git a/install/sql/insert/product/product_to_taxonomy_item.sql b/install/sql/insert/product/product_to_taxonomy_item.sql
old mode 100644
new mode 100755
index 6118fc1..28c68e1
--- a/install/sql/insert/product/product_to_taxonomy_item.sql
+++ b/install/sql/insert/product/product_to_taxonomy_item.sql
@@ -1,31 +1,5 @@
INSERT INTO `product_to_taxonomy_item` VALUES
-(1,50),
-(2,51),
-(3,52),
-(4,53),
-(5,54),
-(6,55),
-(7,56),
-(8,57),
-(9,58),
-(10,59),
-(11,60),
-(12,61),
-(13,62),
-(14,63),
-(15,64),
-(16,65),
-(17,66),
-(18,67),
-(19,67),
-(19,68),
-(19,88),
-(18,88),
-(17,88),
-(16,88),
-(15,88),
-(14,88),
-(13,88),
-(12,88),
-(11,88),
-(10,88);
\ No newline at end of file
+(1,2),
+(1,3),
+(2,2),
+(2,3);
\ No newline at end of file
diff --git a/install/sql/insert/product/product_variant.sql b/install/sql/insert/product/product_variant.sql
old mode 100644
new mode 100755
index 4b88e21..6103c83
--- a/install/sql/insert/product/product_variant.sql
+++ b/install/sql/insert/product/product_variant.sql
@@ -1,27 +1,27 @@
INSERT INTO `product_variant` (`product_variant_id`, `product_id`, `options`, `image`, `price`, `stock_quantity`, `weight`, `sku`, `barcode`) VALUES
-(1, 19, '1:1,2:4,3:8', '', 1000.0000, 100, 0.00000000, '', ''),
-(2, 19, '1:1,2:4,3:9', '', 1100.0000, 100, 0.00000000, '', ''),
-(3, 19, '1:1,2:5,3:7', '', 1200.0000, 100, 0.00000000, '', ''),
-(4, 19, '1:1,2:5,3:8', '', 1300.0000, 0, 0.00000000, '', ''),
-(5, 19, '1:1,2:5,3:9', '', 1400.0000, 100, 0.00000000, '', ''),
-(6, 19, '1:1,2:6,3:7', '', 1500.0000, 100, 0.00000000, '', ''),
-(7, 19, '1:1,2:6,3:8', '', 1600.0000, 100, 0.00000000, '', ''),
-(8, 19, '1:1,2:6,3:9', '', 1700.0000, 100, 0.00000000, '', ''),
-(9, 19, '1:2,2:4,3:7', '', 1800.0000, 100, 0.00000000, '', ''),
-(10, 19, '1:2,2:4,3:8', '', 1900.0000, 100, 0.00000000, '', ''),
-(11, 19, '1:2,2:4,3:9', '', 2000.0000, 100, 0.00000000, '', ''),
-(12, 19, '1:2,2:5,3:7', '', 2100.0000, 0, 0.00000000, '', ''),
-(13, 19, '1:2,2:5,3:8', '', 2200.0000, 100, 0.00000000, '', ''),
-(14, 19, '1:2,2:5,3:9', '', 2300.0000, 100, 0.00000000, '', ''),
-(15, 19, '1:2,2:6,3:7', '', 2400.0000, 100, 0.00000000, '', ''),
-(16, 19, '1:2,2:6,3:8', '', 2500.0000, 100, 0.00000000, '', ''),
-(17, 19, '1:2,2:6,3:9', '', 2600.0000, 100, 0.00000000, '', ''),
-(18, 19, '1:3,2:4,3:7', '', 2700.0000, 100, 0.00000000, '', ''),
-(19, 19, '1:3,2:4,3:8', '', 2800.0000, 100, 0.00000000, '', ''),
-(20, 19, '1:3,2:4,3:9', '', 2900.0000, 100, 0.00000000, '', ''),
-(21, 19, '1:3,2:5,3:7', '', 3000.0000, 100, 0.00000000, '', ''),
-(22, 19, '1:3,2:5,3:8', '', 3100.0000, 100, 0.00000000, '', ''),
-(23, 19, '1:3,2:5,3:9', '', 3200.0000, 100, 0.00000000, '', ''),
-(24, 19, '1:3,2:6,3:7', '', 3300.0000, 100, 0.00000000, '', ''),
-(25, 19, '1:3,2:6,3:8', '', 3400.0000, 100, 0.00000000, '', ''),
-(26, 19, '1:3,2:6,3:9', '', 3500.0000, 100, 0.00000000, '', '');
\ No newline at end of file
+(1, 1, '1:1,2:4,3:8', '', 1000.0000, 100, 0.00000000, '', ''),
+(2, 1, '1:1,2:4,3:9', '', 1100.0000, 100, 0.00000000, '', ''),
+(3, 1, '1:1,2:5,3:7', '', 1200.0000, 100, 0.00000000, '', ''),
+(4, 1, '1:1,2:5,3:8', '', 1300.0000, 0, 0.00000000, '', ''),
+(5, 1, '1:1,2:5,3:9', '', 1400.0000, 100, 0.00000000, '', ''),
+(6, 1, '1:1,2:6,3:7', '', 1500.0000, 100, 0.00000000, '', ''),
+(7, 1, '1:1,2:6,3:8', '', 1600.0000, 100, 0.00000000, '', ''),
+(8, 1, '1:1,2:6,3:9', '', 1700.0000, 100, 0.00000000, '', ''),
+(9, 1, '1:2,2:4,3:7', '', 1800.0000, 100, 0.00000000, '', ''),
+(10, 1, '1:2,2:4,3:8', '', 1900.0000, 100, 0.00000000, '', ''),
+(11, 1, '1:2,2:4,3:9', '', 2000.0000, 100, 0.00000000, '', ''),
+(12, 1, '1:2,2:5,3:7', '', 2100.0000, 0, 0.00000000, '', ''),
+(13, 1, '1:2,2:5,3:8', '', 2200.0000, 100, 0.00000000, '', ''),
+(14, 1, '1:2,2:5,3:9', '', 2300.0000, 100, 0.00000000, '', ''),
+(15, 1, '1:2,2:6,3:7', '', 2400.0000, 100, 0.00000000, '', ''),
+(16, 1, '1:2,2:6,3:8', '', 2500.0000, 100, 0.00000000, '', ''),
+(17, 1, '1:2,2:6,3:9', '', 2600.0000, 100, 0.00000000, '', ''),
+(18, 1, '1:3,2:4,3:7', '', 2700.0000, 100, 0.00000000, '', ''),
+(19, 1, '1:3,2:4,3:8', '', 2800.0000, 100, 0.00000000, '', ''),
+(20, 1, '1:3,2:4,3:9', '', 2900.0000, 100, 0.00000000, '', ''),
+(21, 1, '1:3,2:5,3:7', '', 3000.0000, 100, 0.00000000, '', ''),
+(22, 1, '1:3,2:5,3:8', '', 3100.0000, 100, 0.00000000, '', ''),
+(23, 1, '1:3,2:5,3:9', '', 3200.0000, 100, 0.00000000, '', ''),
+(24, 1, '1:3,2:6,3:7', '', 3300.0000, 100, 0.00000000, '', ''),
+(25, 1, '1:3,2:6,3:8', '', 3400.0000, 100, 0.00000000, '', ''),
+(26, 1, '1:3,2:6,3:9', '', 3500.0000, 100, 0.00000000, '', '');
\ No newline at end of file
diff --git a/install/sql/insert/product/vendor.sql b/install/sql/insert/product/vendor.sql
index 164ab35..193afc9 100755
--- a/install/sql/insert/product/vendor.sql
+++ b/install/sql/insert/product/vendor.sql
@@ -1,7 +1,2 @@
INSERT INTO `vendor` VALUES
-(1,1,'Vendor 1','vendor-1','demo/posts/1.jpg',0),
-(2,1,'Vendor 2','vendor-2','demo/posts/2.jpg',0),
-(3,1,'Vendor 3','vendor-3','demo/posts/3.jpg',0),
-(4,1,'Vendor 4','vendor-4','demo/posts/4.jpg',0),
-(5,1,'Vendor 5','vendor-5','demo/posts/5.jpg',0),
-(6,1,'Vendor 6','vendor-6','demo/posts/6.jpg',0);
+(1,1,'Vendor 1','vendor-1','demo/posts/1.jpg',0);
diff --git a/install/sql/insert/product/vendor_to_site.sql b/install/sql/insert/product/vendor_to_site.sql
index 7ca1329..b432208 100755
--- a/install/sql/insert/product/vendor_to_site.sql
+++ b/install/sql/insert/product/vendor_to_site.sql
@@ -1,7 +1,2 @@
INSERT INTO `vendor_to_site` VALUES
-(1,1),
-(2,1),
-(3,1),
-(4,1),
-(5,1),
-(6,1);
+(1,1);
diff --git a/install/sql/insert/site/site.sql b/install/sql/insert/site/site.sql
old mode 100644
new mode 100755
index 3371fb3..3afb3b9
--- a/install/sql/insert/site/site.sql
+++ b/install/sql/insert/site/site.sql
@@ -1,2 +1,2 @@
INSERT INTO `site` (`site_id`, `name`, `settings`) VALUES
-(1, 'Default', '{"description":{"1":{"title": "Vvveb","description": "The next generation website builder","meta-keywords": "cms, page builder, drag and drop, ecommerce, ecommerce platform, designer, developer, php, bootstrap 5","meta-description": "Powerful and easy to use drag and drop website builder for blogs, presentation or ecommerce stores","phone-number": "+55 (111) 123 777"}},"address":"West 21st Street Brooklyn NY","admin-email":"[email protected]","contact-email":"[email protected]","logo":"logo.png","logo-sticky":"logo.png","logo-dark":"logo-white.png","logo-dark-sticky":"logo-white.png","favicon":"favicon.ico","webbanner":"biglogo.png","post_xlarge_width":"1200","post_xlarge_height":"675","post_large_width":"800","post_large_height":"450","post_medium_width":"400","post_medium_height":"225","post_thumb_width":"150","post_thumb_height":"84","product_xlarge_width":"1200","product_xlarge_height":"1536","product_large_width":"800","product_large_height":"1021","product_medium_width":"400","product_medium_height":"510","product_thumb_width":"150","product_thumb_height":"190","date_format":"j F Y","time_format":"g:i A", "country_id":"223","region_id":"3655","language_id":"1","currency_id":"1","language":"en","languages":"","currency":"USD","currencies":"","invoice_format":"I-{year2}-{month}-{order_id}-{user_id}-{customer_order_id}","order_id_format":"{rand-str-12}-{year2}","language_id":"1","currency_id":"1","length_type_id":"1","weight_type_id":"1","order_status_id":"1", "default_comment_status":"1","anonymous_comments":"1"}');
+(1, 'Default', '{"description":{"1":{"title": "Vvveb","description": "The next generation website builder","meta-keywords": "cms, page builder, drag and drop, ecommerce, ecommerce platform, designer, developer, php, bootstrap 5","meta-description": "Powerful and easy to use drag and drop website builder for blogs, presentation or ecommerce stores","phone-number": "+55 (111) 123 777"}},"address":"West 21st Street Brooklyn NY","admin-email":"[email protected]","contact-email":"[email protected]","logo":"logo.png","logo-sticky":"logo.png","logo-dark":"logo-white.png","logo-dark-sticky":"logo-white.png","favicon":"favicon.ico","webbanner":"biglogo.png","post_xlarge_width":"1200","post_xlarge_height":"675","post_large_width":"800","post_large_height":"450","post_medium_width":"400","post_medium_height":"225","post_thumb_width":"150","post_thumb_height":"84","product_xlarge_width":"1200","product_xlarge_height":"1536","product_large_width":"800","product_large_height":"1021","product_medium_width":"400","product_medium_height":"510","product_thumb_width":"150","product_thumb_height":"190","date_format":"j F Y","time_format":"g:i A", "country_id":"223","region_id":"3655","language_id":"1","currency_id":"1","language":"en","languages":"","currency":"USD","currencies":"","invoice_format":"I-{year}-{date_added}-{rand-no-3}","order_id_format":"{date_added}-{rand-no-3}","language_id":"1","currency_id":"1","length_type_id":"1","weight_type_id":"1","order_status_id":"1", "default_comment_status":"1","anonymous_comments":"1"}');
diff --git a/install/sql/insert/subscription/product_subscription.sql b/install/sql/insert/subscription/product_subscription.sql
old mode 100644
new mode 100755
index db073a5..1d90c16
--- a/install/sql/insert/subscription/product_subscription.sql
+++ b/install/sql/insert/subscription/product_subscription.sql
@@ -1,6 +1,6 @@
INSERT INTO `product_subscription` (`product_id`, `subscription_plan_id`, `user_group_id`, `trial_price`, `price`) VALUES
-(19, 1, 1, 10.0000, 100.0000),
-(19, 2, 1, 20.0000, 200.0000),
-(19, 3, 1, 30.0000, 200.0000),
-(18, 1, 1, 10.0000, 10.0000),
-(18, 2, 1, 10.0000, 20.0000);
+(2, 1, 1, 10.0000, 100.0000),
+(2, 2, 1, 20.0000, 200.0000),
+(2, 3, 1, 30.0000, 200.0000),
+(1, 1, 1, 10.0000, 10.0000),
+(1, 2, 1, 10.0000, 20.0000);
diff --git a/install/sql/insert/taxonomy/taxonomy.sql b/install/sql/insert/taxonomy/taxonomy.sql
index 6c94e84..e7b4486 100755
--- a/install/sql/insert/taxonomy/taxonomy.sql
+++ b/install/sql/insert/taxonomy/taxonomy.sql
@@ -1,6 +1,7 @@
INSERT INTO `taxonomy` VALUES
(1,'Categories', 'post', 'categories',0),
(2,'Tags', 'post', 'tags', 0),
-(3,'Menus', 'page', 'menus', 0),
-(4,'Categories', 'product', 'categories', 0),
-(5,'Tags', 'product', 'tags', 0);
+(3,'Categories', 'product', 'categories', 0),
+(4,'Tags', 'product', 'tags', 0),
+(5,'Categories', 'page', 'categories',0),
+(6,'Tags', 'page', 'tags', 0);
diff --git a/install/sql/insert/taxonomy/taxonomy_content.sql b/install/sql/insert/taxonomy/taxonomy_content.sql
index 59d0235..b81916d 100755
--- a/install/sql/insert/taxonomy/taxonomy_content.sql
+++ b/install/sql/insert/taxonomy/taxonomy_content.sql
@@ -1,10 +1,4 @@
INSERT INTO `taxonomy_content` VALUES
(1,1,'Categories','categories','Post Categories'),
(2,1,'Tags','tags','Post Tags'),
-(3,1,'Menus','menus','Page Menus'),
-(4,1,'Menus','categories','Product categories'),
-
-(1,2,'Categorii','categories','Categorii Postari'),
-(2,2,'Tags','tags','Etichete Postari'),
-(3,2,'Menus','menus','Meniuri Pagini'),
-(4,2,'Menus','categories','Categorii Produse');
+(3,1,'Menus','categories','Product categories');
diff --git a/install/sql/insert/taxonomy/taxonomy_item.sql b/install/sql/insert/taxonomy/taxonomy_item.sql
index c9ee86a..91c2252 100755
--- a/install/sql/insert/taxonomy/taxonomy_item.sql
+++ b/install/sql/insert/taxonomy/taxonomy_item.sql
@@ -1,93 +1,7 @@
INSERT INTO `taxonomy_item` VALUES
-- post categories
(1,1,'','',0,null,3,1),
-(2,1,'','',3,null,2,1),
-(3,1,'','',0,null,1,1),
-(4,1,'','',0,null,5,1),
-(5,1,'','',0,null,2,1),
-(6,1,'','',0,null,4,1),
-(7,1,'','',1,null,1,1),
-(8,1,'','',3,null,1,1),
-(9,1,'','',1,null,1,1),
-(10,1,'','',1,null,1,1),
-(11,1,'','',1,null,1,1),
-(12,1,'','',1,null,1,1),
-(13,1,'','',0,null,6,1),
-(14,1,'','',0,null,7,1),
-(15,1,'','',7,null,0,1),
-(16,1,'','',7,null,0,1),
-(17,1,'','',14,null,0,1),
-(18,1,'','',14,null,0,1),
-(19,1,'','',14,null,0,1),
-(20,1,'','',14,null,0,1),
-(21,1,'','',14,null,0,1),
-(22,1,'','',14,null,0,1),
-(23,1,'','',14,null,0,1),
-(24,1,'','',14,null,0,1),
-(25,1,'','',5,null,0,1),
-(26,1,'','',5,null,0,1),
-(27,1,'','',14,null,0,1),
-(28,1,'','',14,null,0,1),
-(29,1,'','',14,null,0,1),
-(30,1,'','',14,null,0,1),
-(31,1,'','',14,null,0,1),
-(32,1,'','',14,null,0,1),
-(33,1,'','',14,null,0,1),
-(34,1,'','',14,null,0,1),
-(35,1,'','',14,null,0,1),
-(36,1,'','',14,null,0,1),
-(37,1,'','',0,null,3,1),
-(38,1,'','',32,null,0,1),
-- tags
-(39,2,'','',0,null,0,1),
-(40,2,'','',0,null,0,1),
-(41,2,'','',0,null,0,1),
--- menu
-(42,3,'','',0,null,0,1),
-(43,3,'','',0,null,0,1),
-(44,3,'','',0,null,0,1),
-(45,3,'','',0,null,0,1),
-(46,3,'','',0,null,0,1),
-(47,3,'','',44,null,0,1),
-(48,3,'','',44,null,0,1),
-(49,3,'','',0,null,0,1),
+(2,2,'','',0,null,0,1),
-- product categories
-(50,4,'','',0,null,3,1),
-(51,4,'','',52,null,2,1),
-(52,4,'','',0,null,4,1),
-(53,4,'','',0,null,5,1),
-(54,4,'','',0,null,2,1),
-(55,4,'','',0,null,4,1),
-(56,4,'','',50,null,4,1),
-(57,4,'','',52,null,4,1),
-(58,4,'','',50,null,4,1),
-(59,4,'','',50,null,4,1),
-(60,4,'','',50,null,4,1),
-(61,4,'','',50,null,4,1),
-(62,4,'','',0,null,6,1),
-(63,4,'','',0,null,7,1),
-(64,4,'','',56,null,0,1),
-(65,4,'','',56,null,0,1),
-(66,4,'','',63,null,0,1),
-(67,4,'','',63,null,0,1),
-(68,4,'','',63,null,0,1),
-(69,4,'','',63,null,0,1),
-(70,4,'','',63,null,0,1),
-(71,4,'','',63,null,0,1),
-(72,4,'','',63,null,0,1),
-(73,4,'','',63,null,0,1),
-(74,4,'','',54,null,0,1),
-(75,4,'','',54,null,0,1),
-(76,4,'','',63,null,0,1),
-(77,4,'','',63,null,0,1),
-(78,4,'','',63,null,0,1),
-(79,4,'','',63,null,0,1),
-(80,4,'','',63,null,0,1),
-(81,4,'','',63,null,0,1),
-(82,4,'','',63,null,0,1),
-(83,4,'','',63,null,0,1),
-(84,4,'','',63,null,0,1),
-(85,4,'','',63,null,0,1),
-(86,4,'','',0,null,3,1),
-(87,4,'','',81,null,0,1),
-(88,5,'','',0,null,0,1);
+(3,3,'','',0,null,3,1);
diff --git a/install/sql/insert/taxonomy/taxonomy_item_content.sql b/install/sql/insert/taxonomy/taxonomy_item_content.sql
index cabe4f8..5298cfb 100755
--- a/install/sql/insert/taxonomy/taxonomy_item_content.sql
+++ b/install/sql/insert/taxonomy/taxonomy_item_content.sql
@@ -1,181 +1,6 @@
INSERT INTO `taxonomy_item_content` VALUES
(1,1,'Electronics','electronics','Electronics','Electronics','',''),
-(2,1,'Fashion','fashion','Fashion','Fashion','',''),
-(3,1,'Toys','toys','Toys','Toys','',''),
-(4,1,'Books','books','Books','Books','',''),
-(5,1,'Computers','computers','Computers','Computers','',''),
-(6,1,'Home and Kitchen','home-kitchen','Home and Kitchen','Home and Kitchen','',''),
-(7,1,'Games','games','Games','Games','',''),
-(8,1,'Smartphones','smartphones','Smartphones','Smartphones','',''),
-(9,1,'Software','software','Software','Software','',''),
-(10,1,'Appliances','appliances','Appliances','Appliances','',''),
-(11,1,'Tablets','tablets','Tablets','Tablets','',''),
-
-(12,1,'Desktops','desktops','Example of taxonomy_item description text','Desktops','Example of taxonomy_item description',''),
-
-(13,1,'category 1','category-1','category 1','category 1','',''),
-(14,1,'category 2','category-2','category 2','category 2','',''),
-(15,1,'category 5','category-5','category 5','category 5','',''),
-(16,1,'category 4','category-4','category 4','category 4','',''),
-(17,1,'category 6','category-6','category 6','category 6','',''),
-(18,1,'category 7','category-7','category 7','category 7','',''),
-(19,1,'category 8','category-8','category 8','category 8','',''),
-(20,1,'category 9','category-9','category 9','category 9','',''),
-(21,1,'category 11','category-11','category 11','category 11','',''),
-
-(22,1,'MP3 Players','mp3-players','Example of taxonomy_item description text','MP3 Players','',''),
-
-
-(23,1,'Laptops & Notebooks','laptop-notebooks','Example of taxonomy_item description text','Laptops & Notebooks','',''),
-(24,1,'category 12','category-12','category 12','category 12','',''),
-(25,1,'Windows','windows','Windows','Windows','',''),
-(26,1,'Games','games','Games','Gamess','',''),
-(27,1,'category 15','category-15','category 15','category 15','',''),
-(28,1,'category 16','category-16','category 16','category 16','',''),
-(29,1,'category 17','category-17','category 17','category 17','',''),
-(30,1,'category 18','category-18','category 18','category 18','',''),
-(31,1,'category 19','category-19','category 19','category 19','',''),
-(32,1,'category 20','category-20','category 20','category 20','',''),
-(33,1,'category 21','category-21','category 21','category 21','',''),
-(34,1,'category 22','category-22','category 22','category 22','',''),
-(35,1,'category 23','category-23','category 23','category 23','',''),
-(36,1,'category 24','category-24','category 24','category 24','',''),
-(37,1,'Tablets','tablets','Tablets','Tablets','',''),
-(38,1,'category 25','category-25','category 25','category 25','',''),
-
-
-(1,2, 'Electronice', 'electronice', 'Electronice', 'Electronice', '', ''),
-(2,2, 'Moda', 'moda', 'Moda', 'Moda', '', ''),
-(3,2, 'Jucarii', 'jucarii', 'Jucarii', 'Jucarii', '',''),
-(4,2, 'Scannere', 'scanere', 'Scanere', 'Scanere', '', ''),
-(5,2, 'Carti', 'carti', 'Carti', 'Carti', '', ''),
-(6,2, 'Casa si Bucatarie', 'casa-bucatarie', 'Casa si Bucatarie', 'Casa si Bucatarie', '', ''),
-(7,2, 'Jocuri', 'jocuri', 'Jocuri', 'Jocuri', '', ''),
-(8,2, 'Smartphones', 'smartphones', 'Smartphones', 'Smartphones', '', ''),
-(9,2, 'Software', 'software', 'Software', 'Software', '', ''),
-(10,2, 'Componente', 'componente', 'Componente', 'Componente', '', ''),
-(11,2, 'Tablete', 'tablete', 'Tablete', 'Tablete', '', ''),
-
-(12,2, 'Desktop-uri', 'desktop-uri', 'Exemplu de descriere a categoriei text', 'Desktop', 'Exemplu a descrierii categoriei ',' '),
-
-(13,2, 'category 1', 'category-1', 'category 1', 'category 1', '', ''),
-(14,2, 'category 2', 'category-2', 'category 2', 'category 2', '', ''),
-(15,2, 'category 5', 'category-5', 'category 5', 'category 5', '', ''),
-(16,2, 'category 4', 'category-4', 'category 4', 'category 4', '', ''),
-(17,2, 'category 6', 'category-6', 'category 6', 'category 6', '', ''),
-(18,2, 'category 7', 'category-7', 'category 7', 'category 7', '', ''),
-(19,2, 'category 8', 'category-8', 'category 8', 'category 8', '', ''),
-(20,2, 'category 9', 'category-9', 'category 9', 'category 9', '', ''),
-(21,2, 'category 11', 'category-11', 'category 11', 'category 11', '', ''),
-
-(22,2, 'Playere MP3', 'playere-mp3', 'Example of taxonomy_item description text',' Playere MP3 ',' ',' ') ,
-
-
-(23,2, 'Laptopuri si notebook-uri', 'laptop-notebook-uri', 'Example of taxonomy description text ',' Laptopuri si notebook-uri ',' ',' '),
-(24,2, 'category 12', 'category-12', 'category 12', 'category 12', '', ''),
-(25,2, 'Windows', 'windows', 'Windows', 'Windows', '', ''),
-(26,2, 'Jocuro', 'jocuri', 'Jocuri', 'Jocuri', '', ''),
-(27,2, 'category 15', 'category-15', 'category 15', 'category 15', '', ''),
-(28,2, 'category 16', 'category-16', 'category 16', 'category 16', '', ''),
-(29,2, 'category 17', 'category-17', 'category 17', 'category 17', '', ''),
-(30,2, 'category 18', 'category-18', 'category 18', 'category 18', '', ''),
-(31,2, 'category 19', 'category-19', 'category 19', 'category 19', '', ''),
-(32,2, 'category 20', 'category-20', 'category 20', 'category 20', '', ''),
-(33,2, 'category 21', 'category-21', 'category 21', 'category 21', '', ''),
-(34,2, 'category 22', 'category-22', 'category 22', 'category 22', '', ''),
-(35,2, 'category 23', 'category-23', 'category 23', 'category 23', '', ''),
-(36,2, 'category 24', 'category-24', 'category 24', 'category 24', '', ''),
-(37,2, 'Tablete', 'tablete', 'Tablete', 'Tablete', '', ''),
-(38,2, 'category 25', 'test 25', 'test 25', 'test 25', '', ''),
-- tags
-(39,1, 'Tag 1', 'tag-1', 'tag 1', 'tag1', '', ''),
-(40,1, 'Tag 2', 'tag-2', 'tag 2', 'tag2', '', ''),
-(41,1, 'Tag 3', 'tag-3', 'tag 3', 'tag3', '', ''),
--- menu
-(42,1, 'Themes', 'themes', 'Themes', 'themes', '', ''),
-(43,1, 'Plugins', 'plugins', 'Plugins', 'tag3', '', ''),
-(44,1, 'Resources', 'resources', 'Resources', 'tag3', '', ''),
-(45,1, 'Github', 'github', 'Github', 'tag3', '', ''),
-(46,1, 'Contact', 'Tag 3', 'tag 3', 'tag3', '', ''),
-(47,1, 'User documentation', 'Tag 3', 'tag 3', 'tag3', '', ''),
-(48,1, 'Developer', 'Developer', 'Developer', 'Developer', '', ''),
-(49,1, 'Blog', 'Blog', 'Blog', 'Blog', '', ''),
+(2,1, 'Tag 1', 'tag-1', 'tag 1', 'tag1', '', ''),
-- product categories
-(50 ,1,'Electronics','electronics','Electronics','Electronics','',''),
-(51 ,1,'Fashion','fashion','Fashion','Fashion','',''),
-(52 ,1,'Toys','toys','Toys','Toys','',''),
-(53 ,1,'Books','books','Books','Books','',''),
-(54 ,1,'Computers','computers','Computers','Computers','',''),
-(55 ,1,'Home and Kitchen','home-kitchen','Home and Kitchen','Home and Kitchen','',''),
-(56 ,1,'Games','games','Games','Games','',''),
-(57 ,1,'Smartphones','smartphones','Smartphones','Smartphones','',''),
-(58 ,1,'Software','software','Software','Software','',''),
-(59 ,1,'Appliances','appliances','Appliances','Appliances','',''),
-(60 ,1,'Tablets','tablets','Tablets','Tablets','',''),
-(61 ,1,'Desktops','desktops','Example of taxonomy_item description text','Desktops','Example of taxonomy_item description',''),
-(62 ,1,'category 1','category-1','category 1','category 1','',''),
-(63 ,1,'category 2','category-2','category 2','category 2','',''),
-(64 ,1,'category 5','category-5','category 5','category 5','',''),
-(65 ,1,'category 4','category-4','category 4','category 4','',''),
-(66 ,1,'category 6','category-6','category 6','category 6','',''),
-(67 ,1,'category 7','category-7','category 7','category 7','',''),
-(68 ,1,'category 8','category-8','category 8','category 8','',''),
-(69 ,1,'category 9','category-9','category 9','category 9','',''),
-(70 ,1,'category 11','category-11','category 11','category 11','',''),
-(71 ,1,'MP3 Players','mp3-players','Example of taxonomy_item description text','MP3 Players','',''),
-(72 ,1,'Laptops & Notebooks','laptop-notebooks','Example of taxonomy_item description text','Laptops & Notebooks','',''),
-(73 ,1,'category 12','category-12','category 12','category 12','',''),
-(74 ,1,'Windows','windows','Windows','Windows','',''),
-(75 ,1,'Games','games','Games','Gamess','',''),
-(76 ,1,'category 15','category-15','category 15','category 15','',''),
-(77 ,1,'category 16','category-16','category 16','category 16','',''),
-(78 ,1,'category 17','category-17','category 17','category 17','',''),
-(79 ,1,'category 18','category-18','category 18','category 18','',''),
-(80 ,1,'category 19','category-19','category 19','category 19','',''),
-(81 ,1,'category 20','category-20','category 20','category 20','',''),
-(82 ,1,'category 21','category-21','category 21','category 21','',''),
-(83 ,1,'category 22','category-22','category 22','category 22','',''),
-(84 ,1,'category 23','category-23','category 23','category 23','',''),
-(85 ,1,'category 24','category-24','category 24','category 24','',''),
-(86 ,1,'Tablets','tablets','Tablets','Tablets','',''),
-(87 ,1,'category 25','category-25','category 25','category 25','',''),
-
-(50 ,2, 'Electronice', 'electronice', 'Electronice', 'Electronice', '', ''),
-(51 ,2, 'Moda', 'moda', 'Moda', 'Moda', '', ''),
-(52 ,2, 'Jucarii', 'jucarii', 'Jucarii', 'Jucarii', '',''),
-(53 ,2, 'Scannere', 'scanere', 'Scanere', 'Scanere', '', ''),
-(54 ,2, 'Carti', 'carti', 'Carti', 'Carti', '', ''),
-(55 ,2, 'Casa si Bucatarie', 'casa-bucatarie', 'Casa si Bucatarie', 'Casa si Bucatarie', '', ''),
-(56 ,2, 'Jocuri', 'jocuri', 'Jocuri', 'Jocuri', '', ''),
-(57 ,2, 'Smartphones', 'smartphones', 'Smartphones', 'Smartphones', '', ''),
-(58 ,2, 'Software', 'software', 'Software', 'Software', '', ''),
-(59 ,2, 'Componente', 'componente', 'Componente', 'Componente', '', ''),
-(60 ,2, 'Tablete', 'tablete', 'Tablete', 'Tablete', '', ''),
-(61 ,2, 'Desktop-uri', 'desktop-uri', 'Exemplu de descriere a categoriei text', 'Desktop', 'Exemplu a descrierii categoriei ',' '),
-(62 ,2, 'category 1', 'category-1', 'category 1', 'category 1', '', ''),
-(63 ,2, 'category 2', 'category-2', 'category 2', 'category 2', '', ''),
-(64 ,2, 'category 5', 'category-5', 'category 5', 'category 5', '', ''),
-(65 ,2, 'category 4', 'category-4', 'category 4', 'category 4', '', ''),
-(66 ,2, 'category 6', 'category-6', 'category 6', 'category 6', '', ''),
-(67 ,2, 'category 7', 'category-7', 'category 7', 'category 7', '', ''),
-(68 ,2, 'category 8', 'category-8', 'category 8', 'category 8', '', ''),
-(69 ,2, 'category 9', 'category-9', 'category 9', 'category 9', '', ''),
-(70 ,2, 'category 11', 'category-11', 'category 11', 'category 11', '', ''),
-(71 ,2, 'Playere MP3', 'playere-mp3', 'Example of taxonomy_item description text',' Playere MP3 ',' ',' ') ,
-(72 ,2, 'Laptopuri si notebook-uri', 'laptop-notebook-uri', 'Example of taxonomy description text ',' Laptopuri si notebook-uri ',' ',' '),
-(73 ,2, 'category 12', 'category-12', 'category 12', 'category 12', '', ''),
-(74 ,2, 'Windows', 'windows', 'Windows', 'Windows', '', ''),
-(75 ,2, 'Jocuro', 'jocuri', 'Jocuri', 'Jocuri', '', ''),
-(76 ,2, 'category 15', 'category-15', 'category 15', 'category 15', '', ''),
-(77 ,2, 'category 16', 'category-16', 'category 16', 'category 16', '', ''),
-(78 ,2, 'category 17', 'category-17', 'category 17', 'category 17', '', ''),
-(79 ,2, 'category 18', 'category-18', 'category 18', 'category 18', '', ''),
-(80 ,2, 'category 19', 'category-19', 'category 19', 'category 19', '', ''),
-(81 ,2, 'category 20', 'category-20', 'category 20', 'category 20', '', ''),
-(82 ,2, 'category 21', 'category-21', 'category 21', 'category 21', '', ''),
-(83 ,2, 'category 22', 'category-22', 'category 22', 'category 22', '', ''),
-(84 ,2, 'category 23', 'category-23', 'category 23', 'category 23', '', ''),
-(85 ,2, 'category 24', 'category-24', 'category 24', 'category 24', '', ''),
-(86 ,2, 'Tablete', 'tablete', 'Tablete', 'Tablete', '', ''),
-(87 ,2, 'category 25', 'test 25', 'test 25', 'test 25', '', ''),
-(88 ,1, 'Homepage', 'homepage', 'homepage', 'homepage', '', '');
\ No newline at end of file
+(3 ,1,'Electronics','electronics','Electronics','Electronics','','');
\ No newline at end of file
diff --git a/install/sql/insert/taxonomy/taxonomy_to_site.sql b/install/sql/insert/taxonomy/taxonomy_to_site.sql
index e484e27..6661a4d 100755
--- a/install/sql/insert/taxonomy/taxonomy_to_site.sql
+++ b/install/sql/insert/taxonomy/taxonomy_to_site.sql
@@ -1,89 +1,4 @@
INSERT INTO `taxonomy_to_site` VALUES
(1,1),
(2,1),
-(3,1),
-(4,1),
-(5,1),
-(6,1),
-(7,1),
-(8,1),
-(9,1),
-(10,1),
-(11,1),
-(12,1),
-(13,1),
-(14,1),
-(15,1),
-(16,1),
-(17,1),
-(18,1),
-(19,1),
-(20,1),
-(21,1),
-(22,1),
-(23,1),
-(24,1),
-(25,1),
-(26,1),
-(27,1),
-(28,1),
-(29,1),
-(30,1),
-(31,1),
-(32,1),
-(33,1),
-(34,1),
-(35,1),
-(36,1),
-(37,1),
-(38,1),
-(39,1),
-(40,1),
-(41,1),
-(42,1),
-(43,1),
-(44,1),
-(45,1),
-(46,1),
-(47,1),
-(48,1),
-(49,1),
-(50,1),
-(51,1),
-(52,1),
-(53,1),
-(54,1),
-(55,1),
-(56,1),
-(57,1),
-(58,1),
-(59,1),
-(60,1),
-(61,1),
-(62,1),
-(63,1),
-(64,1),
-(65,1),
-(66,1),
-(67,1),
-(68,1),
-(69,1),
-(70,1),
-(71,1),
-(72,1),
-(73,1),
-(74,1),
-(75,1),
-(76,1),
-(77,1),
-(78,1),
-(79,1),
-(80,1),
-(81,1),
-(82,1),
-(83,1),
-(84,1),
-(85,1),
-(86,1),
-(87,1),
-(88,1);
+(3,1);
diff --git a/install/sql/mysqli/menu.sql b/install/sql/mysqli/menu.sql
old mode 100644
new mode 100755
diff --git a/install/sql/mysqli/schema/admin/admin_auth_token.sql b/install/sql/mysqli/schema/admin/admin_auth_token.sql
old mode 100644
new mode 100755
diff --git a/install/sql/mysqli/schema/admin/admin_failed_login.sql b/install/sql/mysqli/schema/admin/admin_failed_login.sql
old mode 100644
new mode 100755
index 17b1ca6..654ce82
--- a/install/sql/mysqli/schema/admin/admin_failed_login.sql
+++ b/install/sql/mysqli/schema/admin/admin_failed_login.sql
@@ -2,8 +2,8 @@ DROP TABLE IF EXISTS `admin_failed_login`;
CREATE TABLE `admin_failed_login` (
`admin_id` INT UNSIGNED NOT NULL,
- `count` INT UNSIGNED DEFAULT 0,
- `last_ip` VARCHAR(16) NOT NULL DEFAULT '',
+ `count` INT UNSIGNED NOT NULL DEFAULT 1,
+ `last_ip` VARCHAR(45) NOT NULL DEFAULT '',
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`admin_id`, `updated_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
diff --git a/install/sql/mysqli/schema/admin/admin_password_resets.sql b/install/sql/mysqli/schema/admin/admin_password_resets.sql
index f9d745b..81549ab 100755
--- a/install/sql/mysqli/schema/admin/admin_password_resets.sql
+++ b/install/sql/mysqli/schema/admin/admin_password_resets.sql
@@ -3,5 +3,6 @@ DROP TABLE IF EXISTS `admin_password_resets`;
CREATE TABLE `admin_password_resets` (
`email` varchar(191) NOT NULL,
`token` varchar(191) NOT NULL,
- `created_at` timestamp NULL DEFAULT NULL
-) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
+ `created_at` timestamp NULL DEFAULT NULL,
+ PRIMARY KEY (`email`,`token`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
diff --git a/install/sql/mysqli/schema/cart/cart.sql b/install/sql/mysqli/schema/cart/cart.sql
old mode 100644
new mode 100755
index 8a3508e..94f9b47
--- a/install/sql/mysqli/schema/cart/cart.sql
+++ b/install/sql/mysqli/schema/cart/cart.sql
@@ -7,5 +7,6 @@ CREATE TABLE `cart` (
`data` TEXT NOT NULL,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`cart_id`),
- KEY `user_id` (`user_id`)
-);
+ KEY `user_id` (`user_id`),
+ KEY `session_id` (`session_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
diff --git a/install/sql/mysqli/schema/cart/coupon_log.sql b/install/sql/mysqli/schema/cart/coupon_log.sql
index db12b0b..7904ba2 100755
--- a/install/sql/mysqli/schema/cart/coupon_log.sql
+++ b/install/sql/mysqli/schema/cart/coupon_log.sql
@@ -7,5 +7,8 @@ CREATE TABLE `coupon_log` (
`user_id` INT UNSIGNED NOT NULL,
`discount` decimal(15,4) NOT NULL,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
- PRIMARY KEY (`coupon_log_id`)
+ PRIMARY KEY (`coupon_log_id`),
+ KEY `coupon_id` (`coupon_id`),
+ KEY `order_id` (`order_id`),
+ KEY `user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
diff --git a/install/sql/mysqli/schema/cart/coupon_product.sql b/install/sql/mysqli/schema/cart/coupon_product.sql
index 5b081d7..7623f81 100755
--- a/install/sql/mysqli/schema/cart/coupon_product.sql
+++ b/install/sql/mysqli/schema/cart/coupon_product.sql
@@ -4,5 +4,7 @@ CREATE TABLE `coupon_product` (
`coupon_product_id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`coupon_id` INT UNSIGNED NOT NULL,
`product_id` INT UNSIGNED NOT NULL,
- PRIMARY KEY (`coupon_product_id`)
+ PRIMARY KEY (`coupon_product_id`),
+ KEY `coupon_id` (`coupon_id`),
+ KEY `product_id` (`product_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
\ No newline at end of file
diff --git a/install/sql/mysqli/schema/cart/coupon_taxonomy.sql b/install/sql/mysqli/schema/cart/coupon_taxonomy.sql
index 81bf747..b334b75 100755
--- a/install/sql/mysqli/schema/cart/coupon_taxonomy.sql
+++ b/install/sql/mysqli/schema/cart/coupon_taxonomy.sql
@@ -4,4 +4,4 @@ CREATE TABLE `coupon_taxonomy` (
`coupon_id` INT UNSIGNED NOT NULL,
`taxonomy_item_id` INT UNSIGNED NOT NULL,
PRIMARY KEY (`coupon_id`,`taxonomy_item_id`)
-) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
diff --git a/install/sql/mysqli/schema/checkout/voucher.sql b/install/sql/mysqli/schema/checkout/voucher.sql
index af4a626..b584fd6 100755
--- a/install/sql/mysqli/schema/checkout/voucher.sql
+++ b/install/sql/mysqli/schema/checkout/voucher.sql
@@ -12,5 +12,6 @@ CREATE TABLE `voucher` (
`credit` decimal(15,4) NOT NULL,
`status` tinyint NOT NULL,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
- PRIMARY KEY (`voucher_id`)
+ PRIMARY KEY (`voucher_id`),
+ KEY `order_id` (`order_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
\ No newline at end of file
diff --git a/install/sql/mysqli/schema/checkout/voucher_log.sql b/install/sql/mysqli/schema/checkout/voucher_log.sql
index 1ee8488..43f49e8 100755
--- a/install/sql/mysqli/schema/checkout/voucher_log.sql
+++ b/install/sql/mysqli/schema/checkout/voucher_log.sql
@@ -6,5 +6,7 @@ CREATE TABLE `voucher_log` (
`order_id` INT UNSIGNED NOT NULL,
`credit` decimal(15,4) NOT NULL,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
- PRIMARY KEY (`voucher_log_id`)
+ PRIMARY KEY (`voucher_log_id`),
+ KEY `voucher_id` (`voucher_id`),
+ KEY `order_id` (`order_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
diff --git a/install/sql/mysqli/schema/fields/field_group.sql b/install/sql/mysqli/schema/fields/field_group.sql
index d9b04a6..e4bafef 100755
--- a/install/sql/mysqli/schema/fields/field_group.sql
+++ b/install/sql/mysqli/schema/fields/field_group.sql
@@ -2,10 +2,10 @@ DROP TABLE IF EXISTS `field_group`;
CREATE TABLE `field_group` (
`field_group_id` int NOT NULL AUTO_INCREMENT,
- `type` varchar(128) NOT NULL DEFAULT 'post',
- `subtype` varchar(128) NOT NULL DEFAULT 'page',
- `conditions` text,
+ `type` varchar(128) NOT NULL DEFAULT 'post', -- post, product, taxonomy_item, user, order
+ `subtype` varchar(128) NOT NULL DEFAULT 'page', -- post, page, product, user, taxonomy item
+ `conditions` text, -- json conditions
`status` tinyint NOT NULL,
- `sort_order` int NOT NULL NOT NULL DEFAULT 0,
+ `sort_order` int NOT NULL DEFAULT 0,
PRIMARY KEY (`field_group_id`)
-) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
\ No newline at end of file
diff --git a/install/sql/mysqli/schema/fields/field_value_content.sql b/install/sql/mysqli/schema/fields/field_value_content.sql
index 8119d85..cbca1a5 100755
--- a/install/sql/mysqli/schema/fields/field_value_content.sql
+++ b/install/sql/mysqli/schema/fields/field_value_content.sql
@@ -7,16 +7,4 @@ CREATE TABLE `field_value_content` (
`name` varchar(128) NOT NULL,
`content` longtext NOT NULL,
PRIMARY KEY (`field_value_id`,`language_id`)
-) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
-
-
-DROP TABLE IF EXISTS `post_field_value_content`;
-
-CREATE TABLE `post_field_value_content` (
- `post_field_value_id` int(10) UNSIGNED NOT NULL,
- `language_id` int(10) UNSIGNED NOT NULL,
- `field_id` int(10) UNSIGNED NOT NULL,
- `name` varchar(128) NOT NULL,
- `content` longtext NOT NULL,
- PRIMARY KEY (`post_field_value_id`,`language_id`)
-) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
diff --git a/install/sql/mysqli/schema/fields/order_field_value.sql b/install/sql/mysqli/schema/fields/order_field_value.sql
old mode 100644
new mode 100755
index 8ca1d38..4dadc67
--- a/install/sql/mysqli/schema/fields/order_field_value.sql
+++ b/install/sql/mysqli/schema/fields/order_field_value.sql
@@ -8,3 +8,5 @@ CREATE TABLE `order_field_value` (
`sort_order` int(3) NOT NULL DEFAULT 0,
PRIMARY KEY (`order_field_value_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
+
+CREATE INDEX `order_field_value_field` ON `order_field_value` (`field_id`);
diff --git a/install/sql/mysqli/schema/fields/post_field_value.sql b/install/sql/mysqli/schema/fields/post_field_value.sql
old mode 100644
new mode 100755
index e8a37c6..e3566ba
--- a/install/sql/mysqli/schema/fields/post_field_value.sql
+++ b/install/sql/mysqli/schema/fields/post_field_value.sql
@@ -6,4 +6,6 @@ CREATE TABLE `post_field_value` (
`language_id` int(10) UNSIGNED NOT NULL,
`value` text NOT NULL,
PRIMARY KEY (`post_id`, `field_id`, `language_id`)
-) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+
+CREATE INDEX `post_field_value_field` ON `post_field_value` (`field_id`);
diff --git a/install/sql/mysqli/schema/fields/product_field_value.sql b/install/sql/mysqli/schema/fields/product_field_value.sql
old mode 100644
new mode 100755
index ac6d113..b00b100
--- a/install/sql/mysqli/schema/fields/product_field_value.sql
+++ b/install/sql/mysqli/schema/fields/product_field_value.sql
@@ -8,3 +8,5 @@ CREATE TABLE `product_field_value` (
`value` text NOT NULL,
PRIMARY KEY (`product_field_value_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
+
+CREATE INDEX `product_field_value_field` ON `product_field_value` (`field_id`);
diff --git a/install/sql/mysqli/schema/fields/taxonomy_item_field_value.sql b/install/sql/mysqli/schema/fields/taxonomy_item_field_value.sql
old mode 100644
new mode 100755
index c739086..93f5aa3
--- a/install/sql/mysqli/schema/fields/taxonomy_item_field_value.sql
+++ b/install/sql/mysqli/schema/fields/taxonomy_item_field_value.sql
@@ -8,3 +8,5 @@ CREATE TABLE `taxonomy_item_field_value` (
`sort_order` int(3) NOT NULL DEFAULT 0,
PRIMARY KEY (`taxonomy_item_field_value_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
+
+CREATE INDEX `taxonomy_item_field_value_field` ON `taxonomy_item_field_value` (`field_id`);
diff --git a/install/sql/mysqli/schema/fields/user_field_value.sql b/install/sql/mysqli/schema/fields/user_field_value.sql
old mode 100644
new mode 100755
index a2ec3de..0ca5762
--- a/install/sql/mysqli/schema/fields/user_field_value.sql
+++ b/install/sql/mysqli/schema/fields/user_field_value.sql
@@ -8,3 +8,5 @@ CREATE TABLE `user_field_value` (
`sort_order` int(3) NOT NULL DEFAULT 0,
PRIMARY KEY (`user_field_value_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
+
+CREATE INDEX `user_field_value_field` ON `user_field_value` (`field_id`);
diff --git a/install/sql/mysqli/schema/geoip/region.sql b/install/sql/mysqli/schema/geoip/region.sql
index 6592a57..ee73ea6 100755
--- a/install/sql/mysqli/schema/geoip/region.sql
+++ b/install/sql/mysqli/schema/geoip/region.sql
@@ -6,5 +6,6 @@ CREATE TABLE `region` (
`name` varchar(128) NOT NULL,
`code` varchar(32) NOT NULL,
`status` tinyint NOT NULL DEFAULT '1',
- PRIMARY KEY (`region_id`)
+ PRIMARY KEY (`region_id`),
+ KEY `country_id` (`country_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
\ No newline at end of file
diff --git a/install/sql/mysqli/schema/geoip/region_to_region_group.sql b/install/sql/mysqli/schema/geoip/region_to_region_group.sql
index 4e89c77..cf9b2e7 100755
--- a/install/sql/mysqli/schema/geoip/region_to_region_group.sql
+++ b/install/sql/mysqli/schema/geoip/region_to_region_group.sql
@@ -6,5 +6,8 @@ CREATE TABLE `region_to_region_group` (
`region_id` INT UNSIGNED NOT NULL DEFAULT '0',
`region_group_id` INT UNSIGNED NOT NULL,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
- PRIMARY KEY (`region_to_region_group_id`)
+ PRIMARY KEY (`region_to_region_group_id`),
+ KEY `country_id` (`country_id`),
+ KEY `region_id` (`region_id`),
+ KEY `region_group_id` (`region_group_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
\ No newline at end of file
diff --git a/install/sql/mysqli/schema/media/media.sql b/install/sql/mysqli/schema/media/media.sql
old mode 100644
new mode 100755
diff --git a/install/sql/mysqli/schema/media/media_content.sql b/install/sql/mysqli/schema/media/media_content.sql
old mode 100644
new mode 100755
index dcdd2c9..fc56d10
--- a/install/sql/mysqli/schema/media/media_content.sql
+++ b/install/sql/mysqli/schema/media/media_content.sql
@@ -1,7 +1,7 @@
DROP TABLE IF EXISTS `media_content`;
CREATE TABLE `media_content` (
- `media_id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `media_id` INT UNSIGNED NOT NULL,
`language_id` INT UNSIGNED NOT NULL,
`name` varchar(191) NOT NULL DEFAULT "",
`caption` varchar(191) NOT NULL DEFAULT "",
diff --git a/install/sql/mysqli/schema/menu/menu.sql b/install/sql/mysqli/schema/menu/menu.sql
index 3359a68..b68e310 100755
--- a/install/sql/mysqli/schema/menu/menu.sql
+++ b/install/sql/mysqli/schema/menu/menu.sql
@@ -4,6 +4,5 @@ CREATE TABLE `menu` (
`menu_id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`name` varchar(191) NOT NULL DEFAULT '',
`slug` varchar(191) NOT NULL DEFAULT '',
- PRIMARY KEY (`menu_id`),
- KEY `menu_id` (`menu_id`)
+ PRIMARY KEY (`menu_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
diff --git a/install/sql/mysqli/schema/menu/menu_item.sql b/install/sql/mysqli/schema/menu/menu_item.sql
index 791f220..0bf155e 100755
--- a/install/sql/mysqli/schema/menu/menu_item.sql
+++ b/install/sql/mysqli/schema/menu/menu_item.sql
@@ -11,6 +11,7 @@ CREATE TABLE `menu_item` (
`sort_order` int(3) NOT NULL DEFAULT 0,
`status` tinyint NOT NULL DEFAULT 0,
PRIMARY KEY (`menu_item_id`),
- KEY `parent_id` (`parent_id`)
+ KEY `parent_id` (`parent_id`),
+ KEY `menu_id` (`menu_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
diff --git a/install/sql/mysqli/schema/menu/menu_to_site.sql b/install/sql/mysqli/schema/menu/menu_to_site.sql
index fd5cf53..d3b5d2d 100755
--- a/install/sql/mysqli/schema/menu/menu_to_site.sql
+++ b/install/sql/mysqli/schema/menu/menu_to_site.sql
@@ -5,3 +5,5 @@ CREATE TABLE `menu_to_site` (
`site_id` tinyint(6) NOT NULL,
PRIMARY KEY (`menu_id`,`site_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+
+CREATE INDEX `menu_to_site_site` ON `menu_to_site` (`site_id`);
diff --git a/install/sql/mysqli/schema/message.sql b/install/sql/mysqli/schema/message.sql
deleted file mode 100755
index d12ca10..0000000
--- a/install/sql/mysqli/schema/message.sql
+++ /dev/null
@@ -1,14 +0,0 @@
-DROP TABLE IF EXISTS `message`;
-
-CREATE TABLE IF NOT EXISTS `message` (
- `message_id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
- `type` varchar(20) NOT NULL DEFAULT 'message',
- `data` text NOT NULL,
- `meta` text NOT NULL,
- `status` tinyint(6) NOT NULL DEFAULT '0', -- unread = 0, read = 1
- `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
- `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
- PRIMARY KEY (`message_id`),
- KEY `type_status_date` (`status`, `type`,`created_at`,`message_id`)
-) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
-
diff --git a/install/sql/mysqli/schema/option/product_option.sql b/install/sql/mysqli/schema/option/product_option.sql
index b880a65..98648fc 100755
--- a/install/sql/mysqli/schema/option/product_option.sql
+++ b/install/sql/mysqli/schema/option/product_option.sql
@@ -6,6 +6,7 @@ CREATE TABLE `product_option` (
`option_id` INT UNSIGNED NOT NULL,
`value` text NOT NULL,
`required` tinyint NOT NULL DEFAULT 0,
+ `sort_order` tinyint NOT NULL DEFAULT 0,
PRIMARY KEY (`product_option_id`),
KEY `product_option` (`product_id`),
KEY `option_id` (`option_id`)
diff --git a/install/sql/mysqli/schema/option/product_option_value.sql b/install/sql/mysqli/schema/option/product_option_value.sql
index 7028ee4..2c792c6 100755
--- a/install/sql/mysqli/schema/option/product_option_value.sql
+++ b/install/sql/mysqli/schema/option/product_option_value.sql
@@ -14,5 +14,11 @@ CREATE TABLE `product_option_value` (
`points` int(8) NOT NULL DEFAULT 0,
`weight_operator` varchar(1) NOT NULL DEFAULT '+',
`weight` decimal(15,8) NOT NULL DEFAULT 0,
+ `width_operator` varchar(1) NOT NULL DEFAULT '+',
+ `width` decimal(15,8) NOT NULL DEFAULT 0,
+ `height_operator` varchar(1) NOT NULL DEFAULT '+',
+ `height` decimal(15,8) NOT NULL DEFAULT 0,
+ `length_operator` varchar(1) NOT NULL DEFAULT '+',
+ `length` decimal(15,8) NOT NULL DEFAULT 0,
PRIMARY KEY (`product_option_value_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
diff --git a/install/sql/mysqli/schema/order/order.sql b/install/sql/mysqli/schema/order/order.sql
index 720f253..758c864 100755
--- a/install/sql/mysqli/schema/order/order.sql
+++ b/install/sql/mysqli/schema/order/order.sql
@@ -7,6 +7,7 @@ CREATE TABLE `order` (
`invoice_prefix` varchar(26) NOT NULL DEFAULT 'I-',
`site_id` tinyint(6) NOT NULL DEFAULT '0',
`site_name` varchar(64) NOT NULL,
+ `site_url` varchar(191) NOT NULL,
`user_id` INT UNSIGNED NOT NULL DEFAULT 0,
`user_group_id` INT UNSIGNED NOT NULL DEFAULT '0',
`first_name` varchar(32) NOT NULL,
@@ -21,6 +22,7 @@ CREATE TABLE `order` (
`billing_address_2` varchar(191) NOT NULL DEFAULT '',
`billing_city` varchar(128) NOT NULL DEFAULT '',
`billing_post_code` varchar(10) NOT NULL DEFAULT '',
+ `billing_country` varchar(128) NOT NULL DEFAULT '',
`billing_country_id` INT UNSIGNED NOT NULL,
`billing_region` varchar(128) NOT NULL DEFAULT '',
`billing_region_id` INT UNSIGNED NOT NULL,
@@ -38,7 +40,7 @@ CREATE TABLE `order` (
`shipping_post_code` varchar(10) NOT NULL DEFAULT '',
`shipping_country` varchar(128) NOT NULL DEFAULT '',
`shipping_country_id` INT UNSIGNED NOT NULL DEFAULT 0,
- `shipping_region` varchar(128) NOT NULL DEFAULT '',
+ `shipping_region` varchar(128) NOT NULL DEFAULT '',
`shipping_region_id` INT UNSIGNED NOT NULL DEFAULT 0,
-- `shipping_fields` text,
`shipping_method` varchar(128) NOT NULL DEFAULT '',
@@ -54,8 +56,8 @@ CREATE TABLE `order` (
`remote_ip` varchar(40) NOT NULL DEFAULT '',
`forwarded_for_ip` varchar(40) NOT NULL DEFAULT '',
`user_agent` varchar(191) NOT NULL DEFAULT '',
- `created_at` datetime NOT NULL DEFAULT current_timestamp,
- `updated_at` datetime NOT NULL DEFAULT current_timestamp,
+ `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`order_id`),
KEY `order_status_id` (`site_id`,`order_status_id`,`created_at`),
KEY `customer_order_id` (`customer_order_id`,`order_status_id`,`created_at`)
diff --git a/install/sql/mysqli/schema/order/order_log.sql b/install/sql/mysqli/schema/order/order_log.sql
index d6f3c3b..4df7d07 100755
--- a/install/sql/mysqli/schema/order/order_log.sql
+++ b/install/sql/mysqli/schema/order/order_log.sql
@@ -8,5 +8,6 @@ CREATE TABLE `order_log` (
`public` tinyint NOT NULL DEFAULT '0',
`note` text NOT NULL,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
- PRIMARY KEY (`order_log_id`)
+ PRIMARY KEY (`order_log_id`),
+ KEY `order_id` (`order_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
diff --git a/install/sql/mysqli/schema/order/order_meta.sql b/install/sql/mysqli/schema/order/order_meta.sql
index a071bb8..d6b7cea 100755
--- a/install/sql/mysqli/schema/order/order_meta.sql
+++ b/install/sql/mysqli/schema/order/order_meta.sql
@@ -5,5 +5,5 @@ CREATE TABLE `order_meta` (
`namespace` varchar(32) NOT NULL DEFAULT '',
`key` varchar(191) NOT NULL,
`value` longtext,
- PRIMARY KEY (`order_id`,`namespace`,`key`)
+ PRIMARY KEY (`order_id`,`namespace`,`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
diff --git a/install/sql/mysqli/schema/order/order_product.sql b/install/sql/mysqli/schema/order/order_product.sql
index 12d1977..6025794 100755
--- a/install/sql/mysqli/schema/order/order_product.sql
+++ b/install/sql/mysqli/schema/order/order_product.sql
@@ -12,5 +12,6 @@ CREATE TABLE `order_product` (
`tax` decimal(15,4) NOT NULL DEFAULT '0.0000',
`points` int(8) NOT NULL DEFAULT 0,
PRIMARY KEY (`order_product_id`),
- KEY `order_id` (`order_id`)
+ KEY `order_id` (`order_id`),
+ KEY `product_id` (`product_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
\ No newline at end of file
diff --git a/install/sql/mysqli/schema/order/order_product_option.sql b/install/sql/mysqli/schema/order/order_product_option.sql
index 0f9ef86..5477233 100755
--- a/install/sql/mysqli/schema/order/order_product_option.sql
+++ b/install/sql/mysqli/schema/order/order_product_option.sql
@@ -10,5 +10,7 @@ CREATE TABLE `order_product_option` (
`name` varchar(191) NOT NULL,
`price` decimal(15,4) NOT NULL DEFAULT '0.0000',
`type` varchar(32) NOT NULL DEFAULT '',
- PRIMARY KEY (`order_product_option_id`)
+ PRIMARY KEY (`order_product_option_id`),
+ KEY `order_id` (`order_id`),
+ KEY `order_product_id` (`order_product_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
\ No newline at end of file
diff --git a/install/sql/mysqli/schema/order/order_shipment.sql b/install/sql/mysqli/schema/order/order_shipment.sql
index adc723c..e4390e4 100755
--- a/install/sql/mysqli/schema/order/order_shipment.sql
+++ b/install/sql/mysqli/schema/order/order_shipment.sql
@@ -6,5 +6,6 @@ CREATE TABLE `order_shipment` (
`shipping_method` varchar(191) NOT NULL,
`tracking_number` varchar(191) NOT NULL,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
- PRIMARY KEY (`order_shipment_id`)
+ PRIMARY KEY (`order_shipment_id`),
+ KEY `order_id` (`order_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
\ No newline at end of file
diff --git a/install/sql/mysqli/schema/order/order_status.sql b/install/sql/mysqli/schema/order/order_status.sql
index 19bd3ae..66aa839 100755
--- a/install/sql/mysqli/schema/order/order_status.sql
+++ b/install/sql/mysqli/schema/order/order_status.sql
@@ -1,8 +1,8 @@
DROP TABLE IF EXISTS `order_status`;
CREATE TABLE `order_status` (
- `order_status_id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `order_status_id` INT UNSIGNED NOT NULL,
`language_id` INT UNSIGNED NOT NULL,
`name` varchar(32) NOT NULL,
PRIMARY KEY (`order_status_id`,`language_id`)
-) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
\ No newline at end of file
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
\ No newline at end of file
diff --git a/install/sql/mysqli/schema/order/order_transaction.sql b/install/sql/mysqli/schema/order/order_transaction.sql
new file mode 100755
index 0000000..2d6b726
--- /dev/null
+++ b/install/sql/mysqli/schema/order/order_transaction.sql
@@ -0,0 +1,17 @@
+DROP TABLE IF EXISTS `order_transaction`;
+
+CREATE TABLE `order_transaction` (
+ `order_transaction_id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `order_id` INT UNSIGNED NOT NULL,
+ `kind` varchar(32) NOT NULL DEFAULT '',
+ `gateway` varchar(64) NOT NULL DEFAULT '',
+ `reference` varchar(191) NOT NULL DEFAULT '',
+ `amount` decimal(15,4) NOT NULL DEFAULT '0.0000',
+ `tax_amount` decimal(15,4) NOT NULL DEFAULT '0.0000',
+ `currency` varchar(3) NOT NULL DEFAULT '',
+ `status` varchar(32) NOT NULL DEFAULT '',
+ `note` text,
+ `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ PRIMARY KEY (`order_transaction_id`),
+ KEY `order_id` (`order_id`)
+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
diff --git a/install/sql/mysqli/schema/order/order_voucher.sql b/install/sql/mysqli/schema/order/order_voucher.sql
index ea886c1..bce0e6f 100755
--- a/install/sql/mysqli/schema/order/order_voucher.sql
+++ b/install/sql/mysqli/schema/order/order_voucher.sql
@@ -12,5 +12,7 @@ CREATE TABLE `order_voucher` (
`to_email` varchar(96) NOT NULL,
`message` text NOT NULL,
`amount` decimal(15,4) NOT NULL,
- PRIMARY KEY (`order_voucher_id`)
+ PRIMARY KEY (`order_voucher_id`),
+ KEY `order_id` (`order_id`),
+ KEY `voucher_id` (`voucher_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
\ No newline at end of file
diff --git a/install/sql/mysqli/schema/order/payment_status.sql b/install/sql/mysqli/schema/order/payment_status.sql
old mode 100644
new mode 100755
index abeae7a..0e0a4fa
--- a/install/sql/mysqli/schema/order/payment_status.sql
+++ b/install/sql/mysqli/schema/order/payment_status.sql
@@ -1,8 +1,8 @@
DROP TABLE IF EXISTS `payment_status`;
CREATE TABLE `payment_status` (
- `payment_status_id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `payment_status_id` INT UNSIGNED NOT NULL,
`language_id` INT UNSIGNED NOT NULL,
`name` varchar(32) NOT NULL,
PRIMARY KEY (`payment_status_id`,`language_id`)
-) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
diff --git a/install/sql/mysqli/schema/order/return.sql b/install/sql/mysqli/schema/order/return.sql
index 880ebaa..4a20a00 100755
--- a/install/sql/mysqli/schema/order/return.sql
+++ b/install/sql/mysqli/schema/order/return.sql
@@ -21,5 +21,8 @@ CREATE TABLE `return` (
`date_ordered` date NOT NULL,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
- PRIMARY KEY (`return_id`)
+ PRIMARY KEY (`return_id`),
+ KEY `order_id` (`order_id`),
+ KEY `product_id` (`product_id`),
+ KEY `user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
diff --git a/install/sql/mysqli/schema/order/return_log.sql b/install/sql/mysqli/schema/order/return_log.sql
index af8681c..73e8c3a 100755
--- a/install/sql/mysqli/schema/order/return_log.sql
+++ b/install/sql/mysqli/schema/order/return_log.sql
@@ -7,5 +7,6 @@ CREATE TABLE `return_log` (
`notify` tinyint NOT NULL,
`note` text NOT NULL,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
- PRIMARY KEY (`return_log_id`)
+ PRIMARY KEY (`return_log_id`),
+ KEY `return_id` (`return_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
diff --git a/install/sql/mysqli/schema/order/return_reason.sql b/install/sql/mysqli/schema/order/return_reason.sql
index d3fa4d9..326bef1 100755
--- a/install/sql/mysqli/schema/order/return_reason.sql
+++ b/install/sql/mysqli/schema/order/return_reason.sql
@@ -1,8 +1,8 @@
DROP TABLE IF EXISTS `return_reason`;
CREATE TABLE `return_reason` (
- `return_reason_id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `return_reason_id` INT UNSIGNED NOT NULL,
`language_id` INT UNSIGNED NOT NULL DEFAULT '0',
`name` varchar(128) NOT NULL,
PRIMARY KEY (`return_reason_id`,`language_id`)
-) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
\ No newline at end of file
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
\ No newline at end of file
diff --git a/install/sql/mysqli/schema/order/return_resolution.sql b/install/sql/mysqli/schema/order/return_resolution.sql
index b2d855a..8907b03 100755
--- a/install/sql/mysqli/schema/order/return_resolution.sql
+++ b/install/sql/mysqli/schema/order/return_resolution.sql
@@ -1,8 +1,8 @@
DROP TABLE IF EXISTS `return_resolution`;
CREATE TABLE `return_resolution` (
- `return_resolution_id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `return_resolution_id` INT UNSIGNED NOT NULL,
`language_id` INT UNSIGNED NOT NULL DEFAULT '0',
`name` varchar(64) NOT NULL,
PRIMARY KEY (`return_resolution_id`,`language_id`)
-) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
\ No newline at end of file
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
\ No newline at end of file
diff --git a/install/sql/mysqli/schema/order/return_status.sql b/install/sql/mysqli/schema/order/return_status.sql
index 479e5ee..3bbea53 100755
--- a/install/sql/mysqli/schema/order/return_status.sql
+++ b/install/sql/mysqli/schema/order/return_status.sql
@@ -1,8 +1,8 @@
DROP TABLE IF EXISTS `return_status`;
CREATE TABLE `return_status` (
- `return_status_id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `return_status_id` INT UNSIGNED NOT NULL,
`language_id` INT UNSIGNED NOT NULL DEFAULT '0',
`name` varchar(32) NOT NULL,
PRIMARY KEY (`return_status_id`,`language_id`)
-) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
\ No newline at end of file
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
\ No newline at end of file
diff --git a/install/sql/mysqli/schema/order/shipping_status.sql b/install/sql/mysqli/schema/order/shipping_status.sql
old mode 100644
new mode 100755
index 29aa16f..23fb82a
--- a/install/sql/mysqli/schema/order/shipping_status.sql
+++ b/install/sql/mysqli/schema/order/shipping_status.sql
@@ -1,8 +1,8 @@
DROP TABLE IF EXISTS `shipping_status`;
CREATE TABLE `shipping_status` (
- `shipping_status_id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `shipping_status_id` INT UNSIGNED NOT NULL,
`language_id` INT UNSIGNED NOT NULL,
`name` varchar(32) NOT NULL,
PRIMARY KEY (`shipping_status_id`,`language_id`)
-) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
diff --git a/install/sql/mysqli/schema/order/warehouse.sql b/install/sql/mysqli/schema/order/warehouse.sql
new file mode 100755
index 0000000..c9a28e4
--- /dev/null
+++ b/install/sql/mysqli/schema/order/warehouse.sql
@@ -0,0 +1,21 @@
+DROP TABLE IF EXISTS `warehouse`;
+
+CREATE TABLE `warehouse` (
+ `warehouse_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+ `name` varchar(191) NOT NULL DEFAULT '',
+ `country_id` int(10) UNSIGNED NOT NULL DEFAULT 0,
+ `region_id` int(10) UNSIGNED NOT NULL DEFAULT 0,
+ `city` varchar(191) NOT NULL DEFAULT '',
+ `postal_code` varchar(32) NOT NULL DEFAULT '',
+ `address_1` varchar(191) NOT NULL DEFAULT '',
+ `status` tinyint NOT NULL DEFAULT 1,
+ `sort_order` int(3) NOT NULL DEFAULT 0,
+ PRIMARY KEY (`warehouse_id`)
+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
+DROP TABLE IF EXISTS `product_warehouse`;
+
+CREATE TABLE `product_warehouse` (
+ `product_id` int(10) UNSIGNED NOT NULL,
+ `warehouse_id` int(10) UNSIGNED NOT NULL,
+ PRIMARY KEY (`product_id`,`warehouse_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
diff --git a/install/sql/mysqli/schema/plugin/message.sql b/install/sql/mysqli/schema/plugin/message.sql
index d12ca10..769488a 100755
--- a/install/sql/mysqli/schema/plugin/message.sql
+++ b/install/sql/mysqli/schema/plugin/message.sql
@@ -5,10 +5,10 @@ CREATE TABLE IF NOT EXISTS `message` (
`type` varchar(20) NOT NULL DEFAULT 'message',
`data` text NOT NULL,
`meta` text NOT NULL,
- `status` tinyint(6) NOT NULL DEFAULT '0', -- unread = 0, read = 1
+ `status` tinyint NOT NULL DEFAULT '0', -- unread = 0, read = 1
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`message_id`),
- KEY `type_status_date` (`status`, `type`,`created_at`,`message_id`)
-) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
+ KEY `type_status_date` (`type`,`status`,`created_at`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
diff --git a/install/sql/mysqli/schema/plugin/newsletter_list.sql b/install/sql/mysqli/schema/plugin/newsletter_list.sql
index 984e3b0..5c9b6f7 100755
--- a/install/sql/mysqli/schema/plugin/newsletter_list.sql
+++ b/install/sql/mysqli/schema/plugin/newsletter_list.sql
@@ -4,9 +4,9 @@ CREATE TABLE IF NOT EXISTS `newsletter_list` (
`newsletter_list_id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`name` varchar(254) NOT NULL,
`data` text NOT NULL,
- `status` tinyint(6) NOT NULL DEFAULT '0', -- unread = 0, read = 1
+ `status` tinyint NOT NULL DEFAULT '0', -- unread = 0, read = 1
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`newsletter_list_id`)
-) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
diff --git a/install/sql/mysqli/schema/plugin/newsletter_mail.sql b/install/sql/mysqli/schema/plugin/newsletter_mail.sql
old mode 100644
new mode 100755
index b39654c..86e856b
--- a/install/sql/mysqli/schema/plugin/newsletter_mail.sql
+++ b/install/sql/mysqli/schema/plugin/newsletter_mail.sql
@@ -1,14 +1,14 @@
-- DROP TABLE IF EXISTS `newsletter_mail`;
CREATE TABLE IF NOT EXISTS `newsletter_mail` (
- `newsletter_list_id` INT UNSIGNED,
+ `newsletter_list_id` INT UNSIGNED NOT NULL,
`email` varchar(254) NOT NULL,
`first_name` varchar(254) NOT NULL DEFAULT '',
`last_name` varchar(254) NOT NULL DEFAULT '',
`data` text NOT NULL,
- `status` tinyint(6) NOT NULL DEFAULT '0', -- inactive = 0, active = 1, unsubsubscribed = 2
+ `status` tinyint NOT NULL DEFAULT '0', -- inactive = 0, active = 1, unsubsubscribed = 2
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`email`, `newsletter_list_id`),
KEY `newsletter_list` (`newsletter_list_id`)
-) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
diff --git a/install/sql/mysqli/schema/plugin/newsletter_post.sql b/install/sql/mysqli/schema/plugin/newsletter_post.sql
old mode 100644
new mode 100755
index 8a00add..8ec7f37
--- a/install/sql/mysqli/schema/plugin/newsletter_post.sql
+++ b/install/sql/mysqli/schema/plugin/newsletter_post.sql
@@ -5,11 +5,11 @@ CREATE TABLE IF NOT EXISTS `newsletter_post` (
`name` varchar(191) NOT NULL,
`content` longtext NOT NULL,
`status` tinyint(6) NOT NULL DEFAULT 1, -- archived = 0, active = 1
- `sent` INT(6) NOT NULL DEFAULT 0,
- `open` INT(6) NOT NULL DEFAULT 0,
- `click` INT(6) NOT NULL DEFAULT 0,
+ `sent` INT NOT NULL DEFAULT 0,
+ `open` INT NOT NULL DEFAULT 0,
+ `click` INT NOT NULL DEFAULT 0,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`newsletter_post_id`)
-) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
diff --git a/install/sql/mysqli/schema/post/comment.sql b/install/sql/mysqli/schema/post/comment.sql
index 2d631ad..51ee5a4 100755
--- a/install/sql/mysqli/schema/post/comment.sql
+++ b/install/sql/mysqli/schema/post/comment.sql
@@ -5,18 +5,18 @@ CREATE TABLE `comment` (
`post_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
`user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
`author` tinytext NOT NULL,
- `email` varchar(100) NOT NULL DEFAULT '',
- `url` varchar(200) NOT NULL DEFAULT '',
- `ip` varchar(100) NOT NULL DEFAULT '',
- `content` text NOT NULL,
+ `email` varchar(100) NOT NULL DEFAULT '',
+ `url` varchar(200) NOT NULL DEFAULT '',
+ `ip` varchar(40) NOT NULL DEFAULT '',
+ `content` text NOT NULL,
`status` tinyint UNSIGNED NOT NULL DEFAULT 0,
- `votes` SMALLINT(3) UNSIGNED NOT NULL DEFAULT 0,
- `type` varchar(20) NOT NULL DEFAULT '',
+ `votes` SMALLINT UNSIGNED NOT NULL DEFAULT 0,
+ `type` varchar(20) NOT NULL DEFAULT '',
`parent_id` INT UNSIGNED NOT NULL DEFAULT '0',
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`comment_id`),
KEY `post_id` (`post_id`, `status`),
KEY `parent` (`parent_id`),
- KEY `email` (`email`(10))
+ KEY `email` (`email`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
diff --git a/install/sql/mysqli/schema/post/post.sql b/install/sql/mysqli/schema/post/post.sql
index 57e4264..3a69f2a 100755
--- a/install/sql/mysqli/schema/post/post.sql
+++ b/install/sql/mysqli/schema/post/post.sql
@@ -1,22 +1,22 @@
DROP TABLE IF EXISTS `post`;
CREATE TABLE `post` (
- `post_id` INT unsigned NOT NULL AUTO_INCREMENT,
- `admin_id` INT unsigned NOT NULL DEFAULT '0',
- `status` varchar(20) NOT NULL DEFAULT 'publish',
- `image` varchar(191) NOT NULL DEFAULT '',
- `comment_status` varchar(20) NOT NULL DEFAULT 'open',
- `password` varchar(191) NOT NULL DEFAULT '',
- `parent` INT unsigned NOT NULL DEFAULT '0',
- `sort_order` INT UNSIGNED NOT NULL DEFAULT '0',
- `type` varchar(20) NOT NULL DEFAULT 'post',
- `template` varchar(191) NOT NULL DEFAULT '',
- `comment_count` INT NOT NULL DEFAULT '0',
- `views` INT unsigned NOT NULL DEFAULT '0',
- `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
- `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ `post_id` INT unsigned NOT NULL AUTO_INCREMENT COMMENT 'Unique identifier for the post',
+ `admin_id` INT unsigned NOT NULL COMMENT 'The id for the author of the post',
+ `status` varchar(20) NOT NULL DEFAULT 'publish' COMMENT 'The post status',
+ `image` varchar(191) NOT NULL DEFAULT '' COMMENT '',
+ `comment_status` varchar(20) NOT NULL DEFAULT 'open' COMMENT '',
+ `password` varchar(191) NOT NULL DEFAULT '' COMMENT '',
+ `parent` INT unsigned NOT NULL DEFAULT '0' COMMENT '',
+ `sort_order` INT UNSIGNED NOT NULL DEFAULT '0' COMMENT '',
+ `type` varchar(20) NOT NULL DEFAULT 'post' COMMENT '',
+ `template` varchar(191) NOT NULL DEFAULT '' COMMENT '',
+ `comment_count` INT NOT NULL DEFAULT '0' COMMENT '',
+ `views` INT unsigned NOT NULL DEFAULT '0' COMMENT '',
+ `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'The date the post was created',
+ `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'The date the post was last modified',
PRIMARY KEY (`post_id`),
- KEY `type_status_date` (`type`,`status`,`sort_order`,`created_at`,`post_id`),
+ KEY `type_status_date_post_id` (`type`,`status`,`sort_order`,`created_at`,`post_id`),
KEY `parent` (`parent`),
KEY `author` (`admin_id`),
KEY `updated_at` (`updated_at`)
diff --git a/install/sql/mysqli/schema/post/post_content.sql b/install/sql/mysqli/schema/post/post_content.sql
index 149e7ca..600e3c9 100755
--- a/install/sql/mysqli/schema/post/post_content.sql
+++ b/install/sql/mysqli/schema/post/post_content.sql
@@ -1,14 +1,14 @@
DROP TABLE IF EXISTS `post_content`;
CREATE TABLE `post_content` (
- `post_id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
- `language_id` INT UNSIGNED NOT NULL,
- `name` varchar(191) NOT NULL DEFAULT "",
- `slug` varchar(191) NOT NULL DEFAULT "",
- `content` longtext,
- `excerpt` text,
- `meta_keywords` varchar(191) NOT NULL DEFAULT "",
- `meta_description` varchar(191) NOT NULL DEFAULT "",
+ `post_id` INT UNSIGNED NOT NULL COMMENT 'Unique identifier for the post',
+ `language_id` INT UNSIGNED NOT NULL COMMENT 'The id of the language of the content',
+ `name` varchar(191) NOT NULL COMMENT 'The name for post language',
+ `slug` varchar(191) NOT NULL COMMENT 'The slug for post language',
+ `content` longtext NOT NULL COMMENT 'The content for post language',
+ `excerpt` text COMMENT 'The excerpt for the post language',
+ `meta_keywords` varchar(191) NOT NULL DEFAULT "" COMMENT 'The meta keyword for the post language',
+ `meta_description` varchar(191) NOT NULL DEFAULT "" COMMENT 'The meta description for the post language',
PRIMARY KEY (`post_id`,`language_id`),
KEY `slug` (`slug`),
FULLTEXT `search` (`name`,`content`)
diff --git a/install/sql/mysqli/schema/post/post_content_revision.sql b/install/sql/mysqli/schema/post/post_content_revision.sql
index 431d461..7964863 100755
--- a/install/sql/mysqli/schema/post/post_content_revision.sql
+++ b/install/sql/mysqli/schema/post/post_content_revision.sql
@@ -1,7 +1,7 @@
DROP TABLE IF EXISTS `post_content_revision`;
CREATE TABLE `post_content_revision` (
- `post_id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `post_id` INT UNSIGNED NOT NULL,
`language_id` INT UNSIGNED NOT NULL,
`content` longtext,
`admin_id` INT UNSIGNED NOT NULL,
diff --git a/install/sql/mysqli/schema/post/post_to_site.sql b/install/sql/mysqli/schema/post/post_to_site.sql
index 2866bbd..fa887b6 100755
--- a/install/sql/mysqli/schema/post/post_to_site.sql
+++ b/install/sql/mysqli/schema/post/post_to_site.sql
@@ -5,3 +5,5 @@ CREATE TABLE `post_to_site` (
`site_id` tinyint(6) NOT NULL DEFAULT '0',
PRIMARY KEY (`post_id`,`site_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+
+CREATE INDEX `post_to_site_site` ON `post_to_site` (`site_id`);
diff --git a/install/sql/mysqli/schema/product/length_type_content.sql b/install/sql/mysqli/schema/product/length_type_content.sql
index 13c0be0..4b1ea86 100755
--- a/install/sql/mysqli/schema/product/length_type_content.sql
+++ b/install/sql/mysqli/schema/product/length_type_content.sql
@@ -6,4 +6,4 @@ CREATE TABLE `length_type_content` (
`name` varchar(32) NOT NULL,
`unit` varchar(4) NOT NULL,
PRIMARY KEY (`length_type_id`,`language_id`)
-) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
\ No newline at end of file
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
\ No newline at end of file
diff --git a/install/sql/mysqli/schema/product/manufacturer_to_site.sql b/install/sql/mysqli/schema/product/manufacturer_to_site.sql
index 26e5097..bc45485 100755
--- a/install/sql/mysqli/schema/product/manufacturer_to_site.sql
+++ b/install/sql/mysqli/schema/product/manufacturer_to_site.sql
@@ -1,7 +1,9 @@
-DROP TABLE IF EXISTS `manufacturer_to_site`;
-
-CREATE TABLE `manufacturer_to_site` (
- `manufacturer_id` INT UNSIGNED NOT NULL,
- `site_id` tinyint(6) NOT NULL DEFAULT '0',
- PRIMARY KEY (`manufacturer_id`,`site_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+DROP TABLE IF EXISTS `manufacturer_to_site`;
+
+CREATE TABLE `manufacturer_to_site` (
+ `manufacturer_id` INT UNSIGNED NOT NULL,
+ `site_id` tinyint(6) NOT NULL DEFAULT '0',
+ PRIMARY KEY (`manufacturer_id`,`site_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+
+CREATE INDEX `manufacturer_to_site_site` ON `manufacturer_to_site` (`site_id`);
diff --git a/install/sql/mysqli/schema/product/product.sql b/install/sql/mysqli/schema/product/product.sql
index 47330b1..1d36ae6 100755
--- a/install/sql/mysqli/schema/product/product.sql
+++ b/install/sql/mysqli/schema/product/product.sql
@@ -35,7 +35,7 @@ CREATE TABLE `product` (
`date_available` date,
`type` varchar(20) NOT NULL DEFAULT 'product',
`template` varchar(191) NOT NULL DEFAULT '',
- `views` INT(5) unsigned NOT NULL DEFAULT 0,
+ `views` INT UNSIGNED NOT NULL DEFAULT 0,
`subtract_stock` tinyint NOT NULL DEFAULT 1,
`minimum_quantity` INT UNSIGNED NOT NULL DEFAULT 1,
`subscription_onetime` tinyint UNSIGNED NOT NULL DEFAULT 1,
@@ -44,10 +44,10 @@ CREATE TABLE `product` (
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`product_id`),
- KEY `type_status_date` (`type`,`status`,`created_at`,`product_id`),
+ KEY `type_status_date` (`type`,`status`,`created_at`),
KEY `stock_status_id` (`stock_status_id`),
KEY `vendor_id` (`vendor_id`),
- KEY `manufacturer_id` (`stock_status_id`),
+ KEY `manufacturer_id` (`manufacturer_id`),
KEY `barcode` (`barcode`),
KEY `sku` (`sku`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
diff --git a/install/sql/mysqli/schema/product/product_content_meta.sql b/install/sql/mysqli/schema/product/product_content_meta.sql
old mode 100644
new mode 100755
diff --git a/install/sql/mysqli/schema/product/product_content_revision.sql b/install/sql/mysqli/schema/product/product_content_revision.sql
index 0ab0696..051037c 100755
--- a/install/sql/mysqli/schema/product/product_content_revision.sql
+++ b/install/sql/mysqli/schema/product/product_content_revision.sql
@@ -1,7 +1,7 @@
DROP TABLE IF EXISTS `product_content_revision`;
CREATE TABLE `product_content_revision` (
- `product_id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `product_id` INT UNSIGNED NOT NULL,
`language_id` INT UNSIGNED NOT NULL,
`content` longtext,
`admin_id` INT UNSIGNED NOT NULL,
diff --git a/install/sql/mysqli/schema/product/product_discount.sql b/install/sql/mysqli/schema/product/product_discount.sql
index f0843a8..c96d7ec 100755
--- a/install/sql/mysqli/schema/product/product_discount.sql
+++ b/install/sql/mysqli/schema/product/product_discount.sql
@@ -10,5 +10,6 @@ CREATE TABLE `product_discount` (
`from_date` date,
`to_date` date,
PRIMARY KEY (`product_discount_id`),
- KEY `product_id` (`product_id`)
+ KEY `product_id` (`product_id`),
+ KEY `user_group_id` (`user_group_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
\ No newline at end of file
diff --git a/install/sql/mysqli/schema/product/product_meta.sql b/install/sql/mysqli/schema/product/product_meta.sql
old mode 100644
new mode 100755
index 0e4999d..d79be0a
--- a/install/sql/mysqli/schema/product/product_meta.sql
+++ b/install/sql/mysqli/schema/product/product_meta.sql
@@ -2,7 +2,7 @@ DROP TABLE IF EXISTS `product_meta`;
CREATE TABLE `product_meta` (
`product_id` INT unsigned NOT NULL,
- `namespace` varchar(32) NOT NULL,
+ `namespace` varchar(191) NOT NULL DEFAULT '',
`key` varchar(191) NOT NULL DEFAULT '',
`value` longtext,
PRIMARY KEY (`product_id`,`namespace`,`key`)
diff --git a/install/sql/mysqli/schema/product/product_promotion.sql b/install/sql/mysqli/schema/product/product_promotion.sql
index 517c3bf..dafb4e2 100755
--- a/install/sql/mysqli/schema/product/product_promotion.sql
+++ b/install/sql/mysqli/schema/product/product_promotion.sql
@@ -9,6 +9,6 @@ CREATE TABLE `product_promotion` (
`from_date` date,
`to_date` date,
PRIMARY KEY (`product_promotion_id`),
-
- KEY `product_id` (`product_id`)
+ KEY `product_id` (`product_id`),
+ KEY `user_group_id` (`user_group_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
diff --git a/install/sql/mysqli/schema/product/product_related.sql b/install/sql/mysqli/schema/product/product_related.sql
index 4c42ae1..afa0e0b 100755
--- a/install/sql/mysqli/schema/product/product_related.sql
+++ b/install/sql/mysqli/schema/product/product_related.sql
@@ -1,7 +1,9 @@
-DROP TABLE IF EXISTS `product_related`;
-
-CREATE TABLE `product_related` (
- `product_id` INT UNSIGNED NOT NULL,
- `product_related_id` INT UNSIGNED NOT NULL,
- PRIMARY KEY (`product_id`,`product_related_id`)
-) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
+DROP TABLE IF EXISTS `product_related`;
+
+CREATE TABLE `product_related` (
+ `product_id` INT UNSIGNED NOT NULL,
+ `product_related_id` INT UNSIGNED NOT NULL,
+ PRIMARY KEY (`product_id`,`product_related_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+
+CREATE INDEX `product_related_related` ON `product_related` (`product_related_id`);
diff --git a/install/sql/mysqli/schema/product/product_review_media.sql b/install/sql/mysqli/schema/product/product_review_media.sql
old mode 100644
new mode 100755
index 4ab51d7..f5f6c99
--- a/install/sql/mysqli/schema/product/product_review_media.sql
+++ b/install/sql/mysqli/schema/product/product_review_media.sql
@@ -9,5 +9,6 @@ CREATE TABLE `product_review_media` (
`sort_order` int(3) NOT NULL DEFAULT '0',
PRIMARY KEY (`product_review_media_id`),
KEY `product_review_id` (`product_review_id`),
- KEY `product_id` (`product_id`,`user_id`)
+ KEY `product_id` (`product_id`,`user_id`),
+ KEY `user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
diff --git a/install/sql/mysqli/schema/product/product_to_digital_asset.sql b/install/sql/mysqli/schema/product/product_to_digital_asset.sql
index c02cbed..5d06436 100755
--- a/install/sql/mysqli/schema/product/product_to_digital_asset.sql
+++ b/install/sql/mysqli/schema/product/product_to_digital_asset.sql
@@ -4,4 +4,4 @@ CREATE TABLE `product_to_digital_asset` (
`product_id` INT UNSIGNED NOT NULL,
`digital_asset_id` INT UNSIGNED NOT NULL,
PRIMARY KEY (`product_id`,`digital_asset_id`)
-) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
diff --git a/install/sql/mysqli/schema/product/product_to_site.sql b/install/sql/mysqli/schema/product/product_to_site.sql
index 65e2ec5..e77d55a 100755
--- a/install/sql/mysqli/schema/product/product_to_site.sql
+++ b/install/sql/mysqli/schema/product/product_to_site.sql
@@ -5,3 +5,5 @@ CREATE TABLE `product_to_site` (
`site_id` tinyint(6) NOT NULL DEFAULT '0',
PRIMARY KEY (`product_id`,`site_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+
+CREATE INDEX `product_to_site_site` ON `product_to_site` (`site_id`);
diff --git a/install/sql/mysqli/schema/product/product_to_taxonomy_item.sql b/install/sql/mysqli/schema/product/product_to_taxonomy_item.sql
index de150a2..68ed1c1 100755
--- a/install/sql/mysqli/schema/product/product_to_taxonomy_item.sql
+++ b/install/sql/mysqli/schema/product/product_to_taxonomy_item.sql
@@ -5,4 +5,4 @@ CREATE TABLE `product_to_taxonomy_item` (
`taxonomy_item_id` INT UNSIGNED NOT NULL,
PRIMARY KEY (`product_id`,`taxonomy_item_id`),
KEY `taxonomy_item_id` (`taxonomy_item_id`)
-) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
\ No newline at end of file
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
\ No newline at end of file
diff --git a/install/sql/mysqli/schema/product/stock_status.sql b/install/sql/mysqli/schema/product/stock_status.sql
index 5d295e8..aacc4e9 100755
--- a/install/sql/mysqli/schema/product/stock_status.sql
+++ b/install/sql/mysqli/schema/product/stock_status.sql
@@ -1,8 +1,8 @@
DROP TABLE IF EXISTS `stock_status`;
CREATE TABLE `stock_status` (
- `stock_status_id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `stock_status_id` INT UNSIGNED NOT NULL,
`language_id` INT UNSIGNED NOT NULL,
`name` varchar(32) NOT NULL,
PRIMARY KEY (`stock_status_id`,`language_id`)
-) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
diff --git a/install/sql/mysqli/schema/product/vendor_to_site.sql b/install/sql/mysqli/schema/product/vendor_to_site.sql
index 1d23525..3084905 100755
--- a/install/sql/mysqli/schema/product/vendor_to_site.sql
+++ b/install/sql/mysqli/schema/product/vendor_to_site.sql
@@ -1,8 +1,9 @@
-DROP TABLE IF EXISTS `vendor_to_site`;
-
-CREATE TABLE `vendor_to_site` (
- `vendor_id` INT UNSIGNED NOT NULL,
- `site_id` tinyint(6) NOT NULL DEFAULT '0',
- PRIMARY KEY (`vendor_id`,`site_id`)
-) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
-
+DROP TABLE IF EXISTS `vendor_to_site`;
+
+CREATE TABLE `vendor_to_site` (
+ `vendor_id` INT UNSIGNED NOT NULL,
+ `site_id` tinyint(6) NOT NULL DEFAULT '0',
+ PRIMARY KEY (`vendor_id`,`site_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+
+CREATE INDEX `vendor_to_site_site` ON `vendor_to_site` (`site_id`);
diff --git a/install/sql/mysqli/schema/product/weight_type.sql b/install/sql/mysqli/schema/product/weight_type.sql
index f7731bd..0d7a9a8 100755
--- a/install/sql/mysqli/schema/product/weight_type.sql
+++ b/install/sql/mysqli/schema/product/weight_type.sql
@@ -4,4 +4,4 @@ CREATE TABLE `weight_type` (
`weight_type_id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`value` decimal(15,8) NOT NULL DEFAULT '0.00000000',
PRIMARY KEY (`weight_type_id`)
-) ENGINE=InnoDb AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
diff --git a/install/sql/mysqli/schema/queue/queue.sql b/install/sql/mysqli/schema/queue/queue.sql
new file mode 100755
index 0000000..2ec92d7
--- /dev/null
+++ b/install/sql/mysqli/schema/queue/queue.sql
@@ -0,0 +1,33 @@
+DROP TABLE IF EXISTS `queue_jobs`;
+
+CREATE TABLE `queue_jobs` (
+ `id` bigint unsigned NOT NULL AUTO_INCREMENT,
+ `job_id` varchar(36) NOT NULL,
+ `queue` varchar(128) NOT NULL DEFAULT 'default',
+ `job` varchar(255) NOT NULL,
+ `payload` json DEFAULT NULL,
+ `attempts` int NOT NULL DEFAULT 0,
+ `max_attempts` int NOT NULL DEFAULT 3,
+ `available_at` bigint NOT NULL DEFAULT 0,
+ `reserved_at` bigint DEFAULT NULL,
+ `created_at` bigint NOT NULL DEFAULT 0,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `u_job_id` (`job_id`),
+ KEY `idx_queue_available` (`queue`, `available_at`),
+ KEY `idx_reserved_at` (`reserved_at`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+
+DROP TABLE IF EXISTS `failed_jobs`;
+
+CREATE TABLE `failed_jobs` (
+ `job_id` varchar(36) NOT NULL,
+ `queue` varchar(128) NOT NULL DEFAULT 'default',
+ `job` varchar(255) NOT NULL,
+ `payload` json DEFAULT NULL,
+ `error` text,
+ `attempts` int NOT NULL DEFAULT 0,
+ `max_attempts` int NOT NULL DEFAULT 3,
+ `failed_at` bigint NOT NULL DEFAULT 0,
+ PRIMARY KEY (`job_id`),
+ KEY `idx_failed_queue` (`queue`, `failed_at`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
diff --git a/install/sql/mysqli/schema/site/site.sql b/install/sql/mysqli/schema/site/site.sql
old mode 100644
new mode 100755
diff --git a/install/sql/mysqli/schema/subscription/order_subscription.sql b/install/sql/mysqli/schema/subscription/order_subscription.sql
old mode 100644
new mode 100755
index 75f19e8..3c05cde
--- a/install/sql/mysqli/schema/subscription/order_subscription.sql
+++ b/install/sql/mysqli/schema/subscription/order_subscription.sql
@@ -20,5 +20,7 @@ CREATE TABLE `order_subscription` (
`cycle` smallint(6) NOT NULL,
`length` smallint(6) NOT NULL,
PRIMARY KEY (`order_subscription_id`),
- KEY `order_id` (`order_id`)
+ KEY `order_id` (`order_id`),
+ KEY `product_id` (`product_id`),
+ KEY `subscription_plan_id` (`subscription_plan_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
diff --git a/install/sql/mysqli/schema/subscription/product_subscription.sql b/install/sql/mysqli/schema/subscription/product_subscription.sql
index a2831af..087b08e 100755
--- a/install/sql/mysqli/schema/subscription/product_subscription.sql
+++ b/install/sql/mysqli/schema/subscription/product_subscription.sql
@@ -4,10 +4,9 @@ CREATE TABLE `product_subscription` (
`product_id` int(10) UNSIGNED NOT NULL,
`subscription_plan_id` int(11) NOT NULL,
`user_group_id` int(10) UNSIGNED NOT NULL,
- `type` char(1) NOT NULL DEFAULT '',
+ `type` char(1) NOT NULL DEFAULT '', -- empty = original price, p = percentage discount, f = fixed discount, n = flat price
`discount` decimal(15,4) NOT NULL DEFAULT 0,
`price` decimal(10,4) NOT NULL,
`trial_price` decimal(10,4) NOT NULL,
--- PRIMARY KEY (`product_id`,`subscription_plan_id`,`user_group_id`)
- KEY (`product_id`,`subscription_plan_id`,`user_group_id`)
-) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
+ PRIMARY KEY (`product_id`,`subscription_plan_id`,`user_group_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
diff --git a/install/sql/mysqli/schema/subscription/subscription.sql b/install/sql/mysqli/schema/subscription/subscription.sql
old mode 100644
new mode 100755
index 7512e55..33aeba2
--- a/install/sql/mysqli/schema/subscription/subscription.sql
+++ b/install/sql/mysqli/schema/subscription/subscription.sql
@@ -6,10 +6,10 @@ CREATE TABLE `subscription` (
`order_product_id` int(10) UNSIGNED NOT NULL,
`site_id` int(10) UNSIGNED NOT NULL,
`user_id` int(10) UNSIGNED NOT NULL,
- `payment_address_id` int(10) UNSIGNED NOT NULL,
- `payment_method` text NOT NULL,
- `shipping_address_id` int(10) UNSIGNED NOT NULL,
- `shipping_method` text NOT NULL,
+ `payment_address_id` int(10) UNSIGNED,
+ `payment_method` text,
+ `shipping_address_id` int(10) UNSIGNED,
+ `shipping_method` text,
`product_id` int(10) UNSIGNED NOT NULL,
`quantity` int(4) NOT NULL,
`subscription_plan_id` int(10) UNSIGNED NOT NULL,
@@ -17,8 +17,8 @@ CREATE TABLE `subscription` (
`period` enum('day','week','month','year') NOT NULL,
`cycle` smallint(6) NOT NULL,
`length` smallint(6) NOT NULL,
- `left` smallint(6) NOT NULL,
- `trial_price` decimal(10,4) NOT NULL,
+ `left` smallint(6) NOT NULL DEFAULT 0,
+ `trial_price` decimal(10,4) NOT NULL DEFAULT 0,
`trial_period` enum('day','week','month','year') NOT NULL,
`trial_cycle` smallint(6) NOT NULL,
`trial_length` smallint(6) NOT NULL,
@@ -30,5 +30,9 @@ CREATE TABLE `subscription` (
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`subscription_id`),
- KEY `order_id` (`order_id`)
+ KEY `order_id` (`order_id`),
+ KEY `user_id` (`user_id`),
+ KEY `product_id` (`product_id`),
+ KEY `subscription_plan_id` (`subscription_plan_id`),
+ KEY `subscription_status_id` (`subscription_status_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
diff --git a/install/sql/mysqli/schema/subscription/subscription_log.sql b/install/sql/mysqli/schema/subscription/subscription_log.sql
old mode 100644
new mode 100755
index df202d4..f977c51
--- a/install/sql/mysqli/schema/subscription/subscription_log.sql
+++ b/install/sql/mysqli/schema/subscription/subscription_log.sql
@@ -7,5 +7,6 @@ CREATE TABLE `subscription_log` (
`notify` tinyint NOT NULL DEFAULT 0,
`note` text NOT NULL,
`created_at` datetime NOT NULL,
- PRIMARY KEY (`subscription_log_id`)
+ PRIMARY KEY (`subscription_log_id`),
+ KEY `subscription_id` (`subscription_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
diff --git a/install/sql/mysqli/schema/subscription/subscription_plan.sql b/install/sql/mysqli/schema/subscription/subscription_plan.sql
old mode 100644
new mode 100755
diff --git a/install/sql/mysqli/schema/subscription/subscription_plan_content.sql b/install/sql/mysqli/schema/subscription/subscription_plan_content.sql
old mode 100644
new mode 100755
diff --git a/install/sql/mysqli/schema/subscription/subscription_status.sql b/install/sql/mysqli/schema/subscription/subscription_status.sql
index 1520bd4..ddfb3db 100755
--- a/install/sql/mysqli/schema/subscription/subscription_status.sql
+++ b/install/sql/mysqli/schema/subscription/subscription_status.sql
@@ -1,8 +1,8 @@
DROP TABLE IF EXISTS `subscription_status`;
CREATE TABLE `subscription_status` (
- `subscription_status_id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
+ `subscription_status_id` INT UNSIGNED NOT NULL,
`language_id` INT UNSIGNED NOT NULL,
`name` varchar(32) NOT NULL,
PRIMARY KEY (`subscription_status_id`,`language_id`)
-) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
diff --git a/install/sql/mysqli/schema/tax/tax_rate.sql b/install/sql/mysqli/schema/tax/tax_rate.sql
index 682dca3..c2b84a7 100755
--- a/install/sql/mysqli/schema/tax/tax_rate.sql
+++ b/install/sql/mysqli/schema/tax/tax_rate.sql
@@ -8,5 +8,6 @@ CREATE TABLE `tax_rate` (
`type` char(1) NOT NULL,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
- PRIMARY KEY (`tax_rate_id`)
+ PRIMARY KEY (`tax_rate_id`),
+ KEY `region_group_id` (`region_group_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
\ No newline at end of file
diff --git a/install/sql/mysqli/schema/tax/tax_rate_to_user_group.sql b/install/sql/mysqli/schema/tax/tax_rate_to_user_group.sql
index f868156..9ae1317 100755
--- a/install/sql/mysqli/schema/tax/tax_rate_to_user_group.sql
+++ b/install/sql/mysqli/schema/tax/tax_rate_to_user_group.sql
@@ -4,4 +4,4 @@ CREATE TABLE `tax_rate_to_user_group` (
`tax_rate_id` INT UNSIGNED NOT NULL,
`user_group_id` INT UNSIGNED NOT NULL,
PRIMARY KEY (`tax_rate_id`,`user_group_id`)
-) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
\ No newline at end of file
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
\ No newline at end of file
diff --git a/install/sql/mysqli/schema/post_category/post_to_taxonomy_item.sql b/install/sql/mysqli/schema/taxonomy/post_to_taxonomy_item.sql
similarity index 100%
rename from install/sql/mysqli/schema/post_category/post_to_taxonomy_item.sql
rename to install/sql/mysqli/schema/taxonomy/post_to_taxonomy_item.sql
diff --git a/install/sql/mysqli/schema/post_category/taxonomy.sql b/install/sql/mysqli/schema/taxonomy/taxonomy.sql
old mode 100755
new mode 100644
similarity index 71%
rename from install/sql/mysqli/schema/post_category/taxonomy.sql
rename to install/sql/mysqli/schema/taxonomy/taxonomy.sql
index 33adc2c..f9f46ae
--- a/install/sql/mysqli/schema/post_category/taxonomy.sql
+++ b/install/sql/mysqli/schema/taxonomy/taxonomy.sql
@@ -6,6 +6,5 @@ CREATE TABLE `taxonomy` (
`post_type` varchar(191) NOT NULL DEFAULT '',
`type` varchar(50) NOT NULL DEFAULT 'categories',
`site_id` INT UNSIGNED NOT NULL DEFAULT 0,
- PRIMARY KEY (`taxonomy_id`),
- KEY `taxonomy_id` (`taxonomy_id`)
+ PRIMARY KEY (`taxonomy_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
\ No newline at end of file
diff --git a/install/sql/mysqli/schema/post_category/taxonomy_content.sql b/install/sql/mysqli/schema/taxonomy/taxonomy_content.sql
old mode 100755
new mode 100644
similarity index 100%
rename from install/sql/mysqli/schema/post_category/taxonomy_content.sql
rename to install/sql/mysqli/schema/taxonomy/taxonomy_content.sql
diff --git a/install/sql/mysqli/schema/post_category/taxonomy_item.sql b/install/sql/mysqli/schema/taxonomy/taxonomy_item.sql
old mode 100755
new mode 100644
similarity index 100%
rename from install/sql/mysqli/schema/post_category/taxonomy_item.sql
rename to install/sql/mysqli/schema/taxonomy/taxonomy_item.sql
diff --git a/install/sql/mysqli/schema/post_category/taxonomy_item_content.sql b/install/sql/mysqli/schema/taxonomy/taxonomy_item_content.sql
old mode 100755
new mode 100644
similarity index 100%
rename from install/sql/mysqli/schema/post_category/taxonomy_item_content.sql
rename to install/sql/mysqli/schema/taxonomy/taxonomy_item_content.sql
diff --git a/install/sql/mysqli/schema/post_category/taxonomy_item_meta.sql b/install/sql/mysqli/schema/taxonomy/taxonomy_item_meta.sql
old mode 100755
new mode 100644
similarity index 100%
rename from install/sql/mysqli/schema/post_category/taxonomy_item_meta.sql
rename to install/sql/mysqli/schema/taxonomy/taxonomy_item_meta.sql
diff --git a/install/sql/mysqli/schema/post_category/taxonomy_to_site.sql b/install/sql/mysqli/schema/taxonomy/taxonomy_to_site.sql
old mode 100755
new mode 100644
similarity index 76%
rename from install/sql/mysqli/schema/post_category/taxonomy_to_site.sql
rename to install/sql/mysqli/schema/taxonomy/taxonomy_to_site.sql
index 8d32481..337e876
--- a/install/sql/mysqli/schema/post_category/taxonomy_to_site.sql
+++ b/install/sql/mysqli/schema/taxonomy/taxonomy_to_site.sql
@@ -5,3 +5,5 @@ CREATE TABLE `taxonomy_to_site` (
`site_id` tinyint(6) NOT NULL,
PRIMARY KEY (`taxonomy_item_id`,`site_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+
+CREATE INDEX `taxonomy_to_site_site` ON `taxonomy_to_site` (`site_id`);
diff --git a/install/sql/mysqli/schema/user/digital_asset.sql b/install/sql/mysqli/schema/user/digital_asset.sql
old mode 100644
new mode 100755
diff --git a/install/sql/mysqli/schema/user/digital_asset_content.sql b/install/sql/mysqli/schema/user/digital_asset_content.sql
index 34adc44..0d2537e 100755
--- a/install/sql/mysqli/schema/user/digital_asset_content.sql
+++ b/install/sql/mysqli/schema/user/digital_asset_content.sql
@@ -5,4 +5,4 @@ CREATE TABLE `digital_asset_content` (
`language_id` INT UNSIGNED NOT NULL,
`name` varchar(64) NOT NULL,
PRIMARY KEY (`digital_asset_id`,`language_id`)
-) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
diff --git a/install/sql/mysqli/schema/user/password_resets.sql b/install/sql/mysqli/schema/user/password_resets.sql
index 2e3da6a..c54c9e3 100755
--- a/install/sql/mysqli/schema/user/password_resets.sql
+++ b/install/sql/mysqli/schema/user/password_resets.sql
@@ -3,5 +3,6 @@ DROP TABLE IF EXISTS `password_resets`;
CREATE TABLE `password_resets` (
`email` varchar(191) NOT NULL,
`token` varchar(191) NOT NULL,
- `created_at` timestamp NULL DEFAULT NULL
-) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
\ No newline at end of file
+ `created_at` timestamp NULL DEFAULT NULL,
+ PRIMARY KEY (`email`,`token`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
\ No newline at end of file
diff --git a/install/sql/mysqli/schema/user/user_failed_login.sql b/install/sql/mysqli/schema/user/user_failed_login.sql
old mode 100644
new mode 100755
index 2bea541..5851eba
--- a/install/sql/mysqli/schema/user/user_failed_login.sql
+++ b/install/sql/mysqli/schema/user/user_failed_login.sql
@@ -3,7 +3,7 @@ DROP TABLE IF EXISTS `user_failed_login`;
CREATE TABLE `user_failed_login` (
`user_id` INT UNSIGNED NOT NULL,
`count` INT UNSIGNED DEFAULT 0,
- `last_ip` VARCHAR(16) NOT NULL DEFAULT '',
+ `last_ip` VARCHAR(45) NOT NULL DEFAULT '',
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`user_id`, `updated_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
diff --git a/install/sql/mysqli/schema/user/user_group.sql b/install/sql/mysqli/schema/user/user_group.sql
index ef8744b..00c41f9 100755
--- a/install/sql/mysqli/schema/user/user_group.sql
+++ b/install/sql/mysqli/schema/user/user_group.sql
@@ -2,7 +2,7 @@ DROP TABLE IF EXISTS `user_group`;
CREATE TABLE `user_group` (
`user_group_id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
- `status` int(1) NOT NULL,
- `sort_order` int(3) NOT NULL DEFAULT 0,
+ `status` tinyint NOT NULL,
+ `sort_order` int NOT NULL DEFAULT 0,
PRIMARY KEY (`user_group_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
\ No newline at end of file
diff --git a/install/sql/mysqli/schema/user/user_points.sql b/install/sql/mysqli/schema/user/user_points.sql
index 7a7e7b9..f504288 100755
--- a/install/sql/mysqli/schema/user/user_points.sql
+++ b/install/sql/mysqli/schema/user/user_points.sql
@@ -7,5 +7,7 @@ CREATE TABLE `user_points` (
`content` text NOT NULL,
`points` int(8) NOT NULL DEFAULT '0',
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
- PRIMARY KEY (`user_points_id`)
+ PRIMARY KEY (`user_points_id`),
+ KEY `user_id` (`user_id`),
+ KEY `order_id` (`order_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
\ No newline at end of file
diff --git a/install/sql/mysqli/schema/user/user_wishlist.sql b/install/sql/mysqli/schema/user/user_wishlist.sql
index 2d2148a..a9044b5 100755
--- a/install/sql/mysqli/schema/user/user_wishlist.sql
+++ b/install/sql/mysqli/schema/user/user_wishlist.sql
@@ -5,4 +5,6 @@ CREATE TABLE `user_wishlist` (
`product_id` INT UNSIGNED NOT NULL,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`user_id`,`product_id`)
-) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
\ No newline at end of file
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+
+CREATE INDEX `user_wishlist_product` ON `user_wishlist` (`product_id`);
diff --git a/install/sql/pgsql/menu.sql b/install/sql/pgsql/menu.sql
old mode 100644
new mode 100755
diff --git a/install/sql/pgsql/schema/admin/admin.sql b/install/sql/pgsql/schema/admin/admin.sql
index 16c9c56..c89ebca 100755
--- a/install/sql/pgsql/schema/admin/admin.sql
+++ b/install/sql/pgsql/schema/admin/admin.sql
@@ -16,7 +16,7 @@ CREATE TABLE "admin" (
"display_name" varchar(250) NOT NULL DEFAULT '',
"avatar" varchar(250) NOT NULL DEFAULT '',
"cover" varchar(250) NOT NULL DEFAULT '',
- "bio" varchar(250) NOT NULL DEFAULT '',
+ "bio" varchar(250) DEFAULT NULL,
"role_id" int check ("role_id" > 0) DEFAULT NULL,
"site_access" text NOT NULL,
"status" int check ("status" >= 0) NOT NULL DEFAULT 0,
diff --git a/install/sql/pgsql/schema/admin/admin_auth_token.sql b/install/sql/pgsql/schema/admin/admin_auth_token.sql
old mode 100644
new mode 100755
index 55760ef..7c14fc0
--- a/install/sql/pgsql/schema/admin/admin_auth_token.sql
+++ b/install/sql/pgsql/schema/admin/admin_auth_token.sql
@@ -6,11 +6,11 @@ DROP TABLE IF EXISTS "admin_auth_token";
CREATE TABLE "admin_auth_token" (
"admin_auth_token_id" SERIAL PRIMARY KEY,
"admin_id" int check ("admin_id" > 0) NOT NULL,
- "token" varchar(191) NOT NULL DEFAULT '',
+ "token" varchar(191) NOT NULL,
"description" varchar(191) NOT NULL DEFAULT '',
"created_at" timestamp(0) NOT NULL DEFAULT now(),
"updated_at" timestamp(0) NOT NULL DEFAULT now()
);
-CREATE INDEX "admin_auth_token_token" ON admin ("token", "admin_id");
+CREATE INDEX "admin_auth_token_token" ON "admin_auth_token" ("token", "admin_id");
diff --git a/install/sql/pgsql/schema/admin/admin_failed_login.sql b/install/sql/pgsql/schema/admin/admin_failed_login.sql
old mode 100644
new mode 100755
index 5f7ba25..d31c7f2
--- a/install/sql/pgsql/schema/admin/admin_failed_login.sql
+++ b/install/sql/pgsql/schema/admin/admin_failed_login.sql
@@ -3,7 +3,7 @@ DROP TABLE IF EXISTS "admin_failed_login";
CREATE TABLE "admin_failed_login" (
"admin_id" int check ("admin_id" > 0) NOT NULL,
"count" int check ("count" > 0) NOT NULL DEFAULT 1,
- "last_ip" varchar(16) NOT NULL DEFAULT '',
+ "last_ip" varchar(45) NOT NULL DEFAULT '',
"updated_at" timestamp(0) NOT NULL DEFAULT now(),
PRIMARY KEY("admin_id", "updated_at")
-);
\ No newline at end of file
+);
diff --git a/install/sql/pgsql/schema/admin/admin_password_resets.sql b/install/sql/pgsql/schema/admin/admin_password_resets.sql
index 0524698..f53a4f3 100755
--- a/install/sql/pgsql/schema/admin/admin_password_resets.sql
+++ b/install/sql/pgsql/schema/admin/admin_password_resets.sql
@@ -1,6 +1,10 @@
-DROP TABLE IF EXISTS admin_password_resets;
-CREATE TABLE admin_password_resets (
+DROP TABLE IF EXISTS "admin_password_resets";
+
+CREATE TABLE "admin_password_resets" (
"email" varchar(191) NOT NULL,
"token" varchar(191) NOT NULL,
- "created_at" timestamp(0) NOT NULL DEFAULT now()
-);
\ No newline at end of file
+ "created_at" timestamp(0) NULL DEFAULT NULL,
+ PRIMARY KEY ("email","token")
+);
+
+CREATE INDEX "admin_password_resets_email" ON "admin_password_resets" ("email");
diff --git a/install/sql/pgsql/schema/attribute/attribute.sql b/install/sql/pgsql/schema/attribute/attribute.sql
index 31d9d29..1f1db40 100755
--- a/install/sql/pgsql/schema/attribute/attribute.sql
+++ b/install/sql/pgsql/schema/attribute/attribute.sql
@@ -5,7 +5,7 @@ DROP TABLE IF EXISTS attribute;
CREATE TABLE "attribute" (
"attribute_id" int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, -- SERIAL PRIMARY KEY
- "attribute_group_id" int check ("attribute_group_id" > 0) NOT NULL DEFAULT 0,
+ "attribute_group_id" int check ("attribute_group_id" >= 0) NOT NULL,
"sort_order" INT NOT NULL DEFAULT 0
-- PRIMARY KEY("attribute_id")
);
diff --git a/install/sql/pgsql/schema/cart/cart.sql b/install/sql/pgsql/schema/cart/cart.sql
old mode 100644
new mode 100755
index de248d0..3c214f3
--- a/install/sql/pgsql/schema/cart/cart.sql
+++ b/install/sql/pgsql/schema/cart/cart.sql
@@ -12,4 +12,5 @@ CREATE TABLE cart (
-- PRIMARY KEY("cart_id")
);
-CREATE INDEX "cart_user_id" ON cart ("user_id");
\ No newline at end of file
+CREATE INDEX "cart_user_id" ON cart ("user_id");
+CREATE INDEX "cart_session_id" ON cart ("session_id");
\ No newline at end of file
diff --git a/install/sql/pgsql/schema/cart/coupon.sql b/install/sql/pgsql/schema/cart/coupon.sql
index 2066d36..519c8b2 100755
--- a/install/sql/pgsql/schema/cart/coupon.sql
+++ b/install/sql/pgsql/schema/cart/coupon.sql
@@ -15,8 +15,8 @@ CREATE TABLE coupon (
"logged_in" smallint NOT NULL,
"free_shipping" smallint NOT NULL,
"status" smallint NOT NULL,
- "from_date" date NOT NULL DEFAULT '1000-01-01',
- "to_date" date NOT NULL DEFAULT '1000-01-01',
+ "from_date" date,
+ "to_date" date,
"created_at" timestamp(0) NOT NULL DEFAULT now(),
"updated_at" timestamp(0) NOT NULL DEFAULT now()
-- PRIMARY KEY("coupon_id")
diff --git a/install/sql/pgsql/schema/cart/coupon_log.sql b/install/sql/pgsql/schema/cart/coupon_log.sql
index 1a48041..774da0e 100755
--- a/install/sql/pgsql/schema/cart/coupon_log.sql
+++ b/install/sql/pgsql/schema/cart/coupon_log.sql
@@ -13,4 +13,7 @@ CREATE TABLE coupon_log (
-- PRIMARY KEY("coupon_log_id")
);
+CREATE INDEX "coupon_log_coupon_id" ON coupon_log ("coupon_id");
+CREATE INDEX "coupon_log_order_id" ON coupon_log ("order_id");
+CREATE INDEX "coupon_log_user_id" ON coupon_log ("user_id");
-- SELECT setval('coupon_log_coupon_log_id_seq', 0, true); -- last inserted id by sample data
diff --git a/install/sql/pgsql/schema/cart/coupon_product.sql b/install/sql/pgsql/schema/cart/coupon_product.sql
index 6327a0a..901f7da 100755
--- a/install/sql/pgsql/schema/cart/coupon_product.sql
+++ b/install/sql/pgsql/schema/cart/coupon_product.sql
@@ -11,4 +11,6 @@ CREATE TABLE coupon_product (
-- PRIMARY KEY("coupon_product_id")
);
+CREATE INDEX "coupon_product_coupon_id" ON coupon_product ("coupon_id");
+CREATE INDEX "coupon_product_product_id" ON coupon_product ("product_id");
-- SELECT setval('coupon_product_coupon_product_id_seq', 0, true); -- last inserted id by sample data
diff --git a/install/sql/pgsql/schema/checkout/voucher.sql b/install/sql/pgsql/schema/checkout/voucher.sql
index 12bea58..4da57e9 100755
--- a/install/sql/pgsql/schema/checkout/voucher.sql
+++ b/install/sql/pgsql/schema/checkout/voucher.sql
@@ -18,4 +18,5 @@ CREATE TABLE voucher (
-- PRIMARY KEY("voucher_id")
);
+CREATE INDEX "voucher_order_id" ON voucher ("order_id");
SELECT setval('voucher_voucher_id_seq', 1, true); -- last inserted id by sample data
\ No newline at end of file
diff --git a/install/sql/pgsql/schema/checkout/voucher_log.sql b/install/sql/pgsql/schema/checkout/voucher_log.sql
index fbfc6d0..9bb259d 100755
--- a/install/sql/pgsql/schema/checkout/voucher_log.sql
+++ b/install/sql/pgsql/schema/checkout/voucher_log.sql
@@ -13,4 +13,6 @@ CREATE TABLE voucher_log (
-- PRIMARY KEY("voucher_log_id")
);
+CREATE INDEX "voucher_log_voucher_id" ON voucher_log ("voucher_id");
+CREATE INDEX "voucher_log_order_id" ON voucher_log ("order_id");
-- SELECT setval('voucher_log_voucher_log_id_seq', 0, true); -- last inserted id by sample data
\ No newline at end of file
diff --git a/install/sql/pgsql/schema/fields/field.sql b/install/sql/pgsql/schema/fields/field.sql
index 3b2fadb..58d1e40 100755
--- a/install/sql/pgsql/schema/fields/field.sql
+++ b/install/sql/pgsql/schema/fields/field.sql
@@ -8,7 +8,7 @@ CREATE TABLE field (
"field_id" int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, -- SERIAL PRIMARY KEY,
"field_group_id" int NOT NULL,
"type" varchar(32) NOT NULL,
- "default" text NOT NULL,
+ "default" text NOT NULL DEFAULT '',
"settings" text NOT NULL,
"validation" text NOT NULL,
"presentation" text NOT NULL,
diff --git a/install/sql/pgsql/schema/fields/field_content.sql b/install/sql/pgsql/schema/fields/field_content.sql
index aa0b3b0..e6c1982 100755
--- a/install/sql/pgsql/schema/fields/field_content.sql
+++ b/install/sql/pgsql/schema/fields/field_content.sql
@@ -4,5 +4,6 @@ CREATE TABLE field_content (
"field_id" int NOT NULL,
"language_id" int NOT NULL,
"name" varchar(128) NOT NULL,
+ "label" varchar(128) NOT NULL,
PRIMARY KEY("field_id","language_id")
);
diff --git a/install/sql/pgsql/schema/fields/field_group.sql b/install/sql/pgsql/schema/fields/field_group.sql
index 3b19aaf..1bc5170 100755
--- a/install/sql/pgsql/schema/fields/field_group.sql
+++ b/install/sql/pgsql/schema/fields/field_group.sql
@@ -7,8 +7,9 @@ DROP TABLE IF EXISTS field_group;
CREATE TABLE field_group (
"field_group_id" int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, -- SERIAL PRIMARY KEY,
"type" varchar(128) NOT NULL DEFAULT 'post', -- post, product, user, taxonomy item
- "subtype" varchar(128) NOT NULL DEFAULT 'post', -- post, page, product
- "status" smallint NOT NULL DEFAULT 1,
+ "subtype" varchar(128) NOT NULL DEFAULT 'page', -- post, page, product
+ "conditions" text, -- json conditions
+ "status" smallint NOT NULL,
"sort_order" int NOT NULL DEFAULT 0
-- PRIMARY KEY("field_group_id")
);
diff --git a/install/sql/pgsql/schema/fields/order_field_value.sql b/install/sql/pgsql/schema/fields/order_field_value.sql
old mode 100644
new mode 100755
index 4956362..a46f617
--- a/install/sql/pgsql/schema/fields/order_field_value.sql
+++ b/install/sql/pgsql/schema/fields/order_field_value.sql
@@ -1,14 +1,18 @@
DROP TABLE IF EXISTS order_field_value;
--- DROP SEQUENCE IF EXISTS order_field_value_field_value_id_seq;
--- CREATE SEQUENCE order_field_value_field_value_id_seq;
+-- DROP SEQUENCE IF EXISTS order_field_value_order_field_value_id_seq;
+-- CREATE SEQUENCE order_field_value_order_field_value_id_seq;
CREATE TABLE order_field_value (
- "order_id" int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, -- SERIAL PRIMARY KEY,
+ "order_field_value_id" int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, -- SERIAL PRIMARY KEY,
+ "language_id" int NOT NULL,
+ "order_id" int NOT NULL,
"field_id" int NOT NULL,
"sort_order" int NOT NULL DEFAULT 0
- -- PRIMARY KEY("field_value_id")
+ -- PRIMARY KEY("order_field_value_id")
);
--- SELECT setval('order_field_value_field_value_id_seq', 0, true); -- last inserted id by sample data
+-- SELECT setval('order_field_value_order_field_value_id_seq', 0, true); -- last inserted id by sample data
+
+CREATE INDEX IF NOT EXISTS "order_field_value_field" ON order_field_value ("field_id");
diff --git a/install/sql/pgsql/schema/fields/post_field_value.sql b/install/sql/pgsql/schema/fields/post_field_value.sql
old mode 100644
new mode 100755
index 1a98790..9d576e4
--- a/install/sql/pgsql/schema/fields/post_field_value.sql
+++ b/install/sql/pgsql/schema/fields/post_field_value.sql
@@ -5,11 +5,13 @@ DROP TABLE IF EXISTS post_field_value;
CREATE TABLE post_field_value (
- "post_id" int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, -- SERIAL PRIMARY KEY,
+ "post_id" int NOT NULL,
"field_id" int NOT NULL,
"language_id" INT NOT NULL,
- "value" TEXT NOT NULL
- -- PRIMARY KEY("field_value_id")
+ "value" TEXT NOT NULL,
+ PRIMARY KEY("post_id","field_id","language_id")
);
-- SELECT setval('post_field_value_field_value_id_seq', 0, true); -- last inserted id by sample data
+
+CREATE INDEX IF NOT EXISTS "post_field_value_field" ON post_field_value ("field_id");
diff --git a/install/sql/pgsql/schema/fields/product_field_value.sql b/install/sql/pgsql/schema/fields/product_field_value.sql
old mode 100644
new mode 100755
index 084a6b6..4074392
--- a/install/sql/pgsql/schema/fields/product_field_value.sql
+++ b/install/sql/pgsql/schema/fields/product_field_value.sql
@@ -14,3 +14,5 @@ CREATE TABLE product_field_value (
);
-- SELECT setval('product_field_value_field_value_id_seq', 0, true); -- last inserted id by sample data
+
+CREATE INDEX IF NOT EXISTS "product_field_value_field" ON product_field_value ("field_id");
diff --git a/install/sql/pgsql/schema/fields/taxonomy_item_field_value.sql b/install/sql/pgsql/schema/fields/taxonomy_item_field_value.sql
old mode 100644
new mode 100755
index eccd220..d6e4be0
--- a/install/sql/pgsql/schema/fields/taxonomy_item_field_value.sql
+++ b/install/sql/pgsql/schema/fields/taxonomy_item_field_value.sql
@@ -1,14 +1,18 @@
DROP TABLE IF EXISTS taxonomy_item_field_value;
--- DROP SEQUENCE IF EXISTS taxonomy_item_field_value_field_value_id_seq;
--- CREATE SEQUENCE taxonomy_item_field_value_field_value_id_seq;
+-- DROP SEQUENCE IF EXISTS taxonomy_item_field_value_taxonomy_item_field_value_id_seq;
+-- CREATE SEQUENCE taxonomy_item_field_value_taxonomy_item_field_value_id_seq;
CREATE TABLE taxonomy_item_field_value (
- "taxonomy_item_id" int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, -- SERIAL PRIMARY KEY,
+ "taxonomy_item_field_value_id" int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, -- SERIAL PRIMARY KEY,
+ "language_id" int NOT NULL,
+ "taxonomy_item_id" int NOT NULL,
"field_id" int NOT NULL,
"sort_order" int NOT NULL DEFAULT 0
- -- PRIMARY KEY("field_value_id")
+ -- PRIMARY KEY("taxonomy_item_field_value_id")
);
--- SELECT setval('taxonomy_item_field_value_field_value_id_seq', 0, true); -- last inserted id by sample data
+-- SELECT setval('taxonomy_item_field_value_taxonomy_item_field_value_id_seq', 0, true); -- last inserted id by sample data
+
+CREATE INDEX IF NOT EXISTS "taxonomy_item_field_value_field" ON taxonomy_item_field_value ("field_id");
diff --git a/install/sql/pgsql/schema/fields/user_field_value.sql b/install/sql/pgsql/schema/fields/user_field_value.sql
old mode 100644
new mode 100755
index a7073f3..14505fa
--- a/install/sql/pgsql/schema/fields/user_field_value.sql
+++ b/install/sql/pgsql/schema/fields/user_field_value.sql
@@ -1,14 +1,18 @@
DROP TABLE IF EXISTS user_field_value;
--- DROP SEQUENCE IF EXISTS user_field_value_field_value_id_seq;
--- CREATE SEQUENCE user_field_value_field_value_id_seq;
+-- DROP SEQUENCE IF EXISTS user_field_value_user_field_value_id_seq;
+-- CREATE SEQUENCE user_field_value_user_field_value_id_seq;
CREATE TABLE user_field_value (
- "user_id" int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, -- SERIAL PRIMARY KEY,
+ "user_field_value_id" int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, -- SERIAL PRIMARY KEY,
+ "language_id" int NOT NULL,
+ "user_id" int NOT NULL,
"field_id" int NOT NULL,
"sort_order" int NOT NULL DEFAULT 0
- -- PRIMARY KEY("field_value_id")
+ -- PRIMARY KEY("user_field_value_id")
);
--- SELECT setval('user_field_value_field_value_id_seq', 0, true); -- last inserted id by sample data
+-- SELECT setval('user_field_value_user_field_value_id_seq', 0, true); -- last inserted id by sample data
+
+CREATE INDEX IF NOT EXISTS "user_field_value_field" ON user_field_value ("field_id");
diff --git a/install/sql/pgsql/schema/geoip/country.sql b/install/sql/pgsql/schema/geoip/country.sql
index 823348b..360c0ae 100755
--- a/install/sql/pgsql/schema/geoip/country.sql
+++ b/install/sql/pgsql/schema/geoip/country.sql
@@ -9,7 +9,7 @@ CREATE TABLE country (
"name" varchar(128) NOT NULL,
"iso_code_2" varchar(2) NOT NULL,
"iso_code_3" varchar(3) NOT NULL,
- "status" smallint NOT NULL DEFAULT 1
+ "status" smallint NOT NULL DEFAULT 0
-- PRIMARY KEY("country_id")
);
diff --git a/install/sql/pgsql/schema/geoip/region.sql b/install/sql/pgsql/schema/geoip/region.sql
index 76947b9..b33b994 100755
--- a/install/sql/pgsql/schema/geoip/region.sql
+++ b/install/sql/pgsql/schema/geoip/region.sql
@@ -12,4 +12,5 @@ CREATE TABLE region (
-- PRIMARY KEY("region_id")
);
+CREATE INDEX "region_country_id" ON region ("country_id");
SELECT setval('region_region_id_seq', 4343, true); -- last inserted id by sample data
diff --git a/install/sql/pgsql/schema/geoip/region_group.sql b/install/sql/pgsql/schema/geoip/region_group.sql
index f5a91d3..0e97aae 100755
--- a/install/sql/pgsql/schema/geoip/region_group.sql
+++ b/install/sql/pgsql/schema/geoip/region_group.sql
@@ -7,7 +7,7 @@ DROP TABLE IF EXISTS region_group;
CREATE TABLE region_group (
"region_group_id" int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, -- SERIAL PRIMARY KEY
"name" varchar(32) NOT NULL,
- "content" varchar(191) NOT NULL,
+ "content" varchar(191) NOT NULL DEFAULT '',
"created_at" timestamp(0) NOT NULL DEFAULT now()
-- PRIMARY KEY("region_group_id")
);
diff --git a/install/sql/pgsql/schema/geoip/region_to_region_group.sql b/install/sql/pgsql/schema/geoip/region_to_region_group.sql
index 2221b09..6a157ad 100755
--- a/install/sql/pgsql/schema/geoip/region_to_region_group.sql
+++ b/install/sql/pgsql/schema/geoip/region_to_region_group.sql
@@ -12,4 +12,7 @@ CREATE TABLE region_to_region_group (
-- PRIMARY KEY("region_to_region_group_id")
);
+CREATE INDEX "region_to_region_group_country_id" ON region_to_region_group ("country_id");
+CREATE INDEX "region_to_region_group_region_id" ON region_to_region_group ("region_id");
+CREATE INDEX "region_to_region_group_region_group_id" ON region_to_region_group ("region_group_id");
SELECT setval('region_to_region_group_region_to_region_group_id_seq', 108, true); -- last inserted id by sample data
\ No newline at end of file
diff --git a/install/sql/pgsql/schema/localisation/currency.sql b/install/sql/pgsql/schema/localisation/currency.sql
index e821786..a9e008f 100755
--- a/install/sql/pgsql/schema/localisation/currency.sql
+++ b/install/sql/pgsql/schema/localisation/currency.sql
@@ -8,11 +8,11 @@ CREATE TABLE currency (
"currency_id" int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, -- SERIAL PRIMARY KEY
"name" varchar(32) NOT NULL,
"code" varchar(3) NOT NULL,
- "value" double precision NOT NULL,
- "sign_start" varchar(12) NOT NULL,
- "sign_end" varchar(12) NOT NULL,
- "decimal_place" char(1) NOT NULL,
- "status" smallint NOT NULL,
+ "value" double precision NOT NULL DEFAULT 1,
+ "sign_start" varchar(12) NOT NULL DEFAULT '',
+ "sign_end" varchar(12) NOT NULL DEFAULT '',
+ "decimal_place" smallint NOT NULL DEFAULT 2,
+ "status" smallint NOT NULL DEFAULT 0,
"updated_at" timestamp(0) NOT NULL DEFAULT now()
-- PRIMARY KEY("currency_id")
);
diff --git a/install/sql/pgsql/schema/localisation/language.sql b/install/sql/pgsql/schema/localisation/language.sql
old mode 100644
new mode 100755
index c3bcc5e..0059dbd
--- a/install/sql/pgsql/schema/localisation/language.sql
+++ b/install/sql/pgsql/schema/localisation/language.sql
@@ -12,7 +12,7 @@ CREATE TABLE language (
"slug" varchar(12) NOT NULL,
"rtl" smallint NOT NULL DEFAULT 0,
"sort_order" int NOT NULL DEFAULT 0,
- "status" smallint NOT NULL,
+ "status" smallint NOT NULL DEFAULT 0,
"default" smallint NOT NULL DEFAULT 0
-- PRIMARY KEY("language_id")
);
diff --git a/install/sql/pgsql/schema/menu/menu.sql b/install/sql/pgsql/schema/menu/menu.sql
index 4cf0d27..7f2dd62 100755
--- a/install/sql/pgsql/schema/menu/menu.sql
+++ b/install/sql/pgsql/schema/menu/menu.sql
@@ -11,5 +11,4 @@ CREATE TABLE menu (
-- PRIMARY KEY("menu_id")
);
-CREATE INDEX "menu_menu_id" ON menu ("menu_id");
SELECT setval('menu_menu_id_seq', 5, true); -- last inserted id by sample data
\ No newline at end of file
diff --git a/install/sql/pgsql/schema/menu/menu_item.sql b/install/sql/pgsql/schema/menu/menu_item.sql
index c4513cc..d0f37f0 100755
--- a/install/sql/pgsql/schema/menu/menu_item.sql
+++ b/install/sql/pgsql/schema/menu/menu_item.sql
@@ -17,5 +17,6 @@ CREATE TABLE menu_item (
-- PRIMARY KEY("menu_item_id")
);
+CREATE INDEX "menu_item_menu_id" ON menu_item ("menu_id");
CREATE INDEX "menu_item_parent_id" ON menu_item ("parent_id");
SELECT setval('menu_item_menu_item_id_seq', 68, true); -- last inserted id by sample data
\ No newline at end of file
diff --git a/install/sql/pgsql/schema/menu/menu_to_site.sql b/install/sql/pgsql/schema/menu/menu_to_site.sql
index 6826f8b..dee6ed3 100755
--- a/install/sql/pgsql/schema/menu/menu_to_site.sql
+++ b/install/sql/pgsql/schema/menu/menu_to_site.sql
@@ -4,4 +4,6 @@ CREATE TABLE menu_to_site (
"menu_id" int check ("menu_id" > 0) NOT NULL,
"site_id" smallint NOT NULL,
PRIMARY KEY("menu_id","site_id")
-);
\ No newline at end of file
+);
+
+CREATE INDEX IF NOT EXISTS "menu_to_site_site" ON menu_to_site ("site_id");
diff --git a/install/sql/pgsql/schema/option/option_value_content.sql b/install/sql/pgsql/schema/option/option_value_content.sql
index 8f7cb38..1b58305 100755
--- a/install/sql/pgsql/schema/option/option_value_content.sql
+++ b/install/sql/pgsql/schema/option/option_value_content.sql
@@ -7,3 +7,5 @@ CREATE TABLE "option_value_content" (
"name" TEXT NOT NULL,
PRIMARY KEY("option_value_id","language_id")
);
+
+CREATE INDEX "option_value_content_option_id" ON "option_value_content" ("option_id","language_id");
diff --git a/install/sql/pgsql/schema/option/product_option.sql b/install/sql/pgsql/schema/option/product_option.sql
index 5dbfff6..b9215ed 100755
--- a/install/sql/pgsql/schema/option/product_option.sql
+++ b/install/sql/pgsql/schema/option/product_option.sql
@@ -9,8 +9,11 @@ CREATE TABLE product_option (
"product_id" int check ("product_id" > 0) NOT NULL,
"option_id" int check ("option_id" > 0) NOT NULL,
"value" text NOT NULL,
- "required" smallint NOT NULL DEFAULT 0
+ "required" smallint NOT NULL DEFAULT 0,
+ "sort_order" smallint NOT NULL DEFAULT 0
-- PRIMARY KEY("product_option_id")
);
+CREATE INDEX "product_option_product_id" ON product_option ("product_id");
+CREATE INDEX "product_option_option_id" ON product_option ("option_id");
SELECT setval('product_option_product_option_id_seq', 3, true); -- last inserted id by sample data
\ No newline at end of file
diff --git a/install/sql/pgsql/schema/option/product_option_value.sql b/install/sql/pgsql/schema/option/product_option_value.sql
index 49a30e3..0495f51 100755
--- a/install/sql/pgsql/schema/option/product_option_value.sql
+++ b/install/sql/pgsql/schema/option/product_option_value.sql
@@ -17,7 +17,13 @@ CREATE TABLE product_option_value (
"points_operator" varchar(1) NOT NULL DEFAULT '+',
"points" int NOT NULL DEFAULT 0,
"weight_operator" varchar(1) NOT NULL DEFAULT '+',
- "weight" decimal(15,8) NOT NULL DEFAULT 0
+ "weight" decimal(15,8) NOT NULL DEFAULT 0,
+ "width_operator" varchar(1) NOT NULL DEFAULT '+',
+ "width" decimal(15,8) NOT NULL DEFAULT 0,
+ "height_operator" varchar(1) NOT NULL DEFAULT '+',
+ "height" decimal(15,8) NOT NULL DEFAULT 0,
+ "length_operator" varchar(1) NOT NULL DEFAULT '+',
+ "length" decimal(15,8) NOT NULL DEFAULT 0
-- PRIMARY KEY("product_option_value_id")
);
diff --git a/install/sql/pgsql/schema/order/order.sql b/install/sql/pgsql/schema/order/order.sql
index 7e3db79..f3a93c3 100755
--- a/install/sql/pgsql/schema/order/order.sql
+++ b/install/sql/pgsql/schema/order/order.sql
@@ -19,7 +19,7 @@ CREATE TABLE "order" (
"site_name" varchar(64) NOT NULL,
"site_url" varchar(191) NOT NULL,
"user_id" int NOT NULL DEFAULT 0,
- "user_group_id" int check ("user_group_id" > 0) NOT NULL DEFAULT 1,
+ "user_group_id" int check ("user_group_id" >= 0) NOT NULL DEFAULT 0,
"first_name" varchar(32) NOT NULL,
"last_name" varchar(32) NOT NULL,
"email" varchar(96) NOT NULL,
@@ -37,8 +37,8 @@ CREATE TABLE "order" (
"billing_region_id" int check ("billing_region_id" > 0) NOT NULL,
-- "billing_fields" text NOT NULL,
"payment_method" varchar(128) NOT NULL DEFAULT '',
- "payment_data" text NOT NULL DEFAULT '',
- "payment_status_id" int check ("order_status_id" > 0) NOT NULL DEFAULT 1,
+ "payment_data" text,
+ "payment_status_id" int check ("payment_status_id" > 0) NOT NULL DEFAULT 1,
"shipping_first_name" varchar(32) NOT NULL DEFAULT '',
"shipping_last_name" varchar(32) NOT NULL DEFAULT '',
"shipping_company" varchar(60) NOT NULL DEFAULT '',
@@ -47,20 +47,20 @@ CREATE TABLE "order" (
"shipping_city" varchar(128) NOT NULL DEFAULT '',
"shipping_post_code" varchar(10) NOT NULL DEFAULT '',
"shipping_country" varchar(128) NOT NULL DEFAULT '',
- "shipping_country_id" int check ("shipping_country_id" > 0) NOT NULL,
+ "shipping_country_id" int check ("shipping_country_id" >= 0) NOT NULL DEFAULT 0,
"shipping_region" varchar(128) NOT NULL DEFAULT '',
- "shipping_region_id" int check ("shipping_region_id" > 0) NOT NULL,
+ "shipping_region_id" int check ("shipping_region_id" >= 0) NOT NULL DEFAULT 0,
-- "shipping_fields" text NOT NULL,
"shipping_method" varchar(128) NOT NULL DEFAULT '',
- "shipping_data" text NOT NULL DEFAULT '',
- "shipping_status_id" int check ("order_status_id" > 0) NOT NULL DEFAULT 1,
+ "shipping_data" text,
+ "shipping_status_id" int check ("shipping_status_id" > 0) NOT NULL DEFAULT 1,
"total" decimal(15,4) NOT NULL DEFAULT 0.0000,
- "order_status_id" int check ("order_status_id" > 0) NOT NULL DEFAULT 1,
+ "order_status_id" int check ("order_status_id" >= 0) NOT NULL DEFAULT 0,
"language_id" int check ("language_id" > 0) NOT NULL,
"currency_id" int check ("currency_id" > 0) NOT NULL,
"currency" varchar(3) NOT NULL DEFAULT '',
"currency_value" decimal(15,8) NOT NULL DEFAULT 1.00000000,
- "notes" text NOT NULL DEFAULT '',
+ "notes" text,
"remote_ip" varchar(40) NOT NULL DEFAULT '',
"forwarded_for_ip" varchar(40) NOT NULL DEFAULT '',
"user_agent" varchar(191) NOT NULL DEFAULT '',
diff --git a/install/sql/pgsql/schema/order/order_log.sql b/install/sql/pgsql/schema/order/order_log.sql
index d42a85e..ff2575b 100755
--- a/install/sql/pgsql/schema/order/order_log.sql
+++ b/install/sql/pgsql/schema/order/order_log.sql
@@ -15,4 +15,5 @@ CREATE TABLE order_log (
-- PRIMARY KEY("order_log_id")
);
+CREATE INDEX "order_log_order_id" ON order_log ("order_id");
-- SELECT setval('order_log_order_log_id_seq', 0, true); -- last inserted id by sample data
\ No newline at end of file
diff --git a/install/sql/pgsql/schema/order/order_meta.sql b/install/sql/pgsql/schema/order/order_meta.sql
index 9c95d8c..a63f72e 100755
--- a/install/sql/pgsql/schema/order/order_meta.sql
+++ b/install/sql/pgsql/schema/order/order_meta.sql
@@ -7,8 +7,8 @@ CREATE TABLE order_meta (
"order_id" int check ("order_id" > 0) NOT NULL,
"namespace" varchar(32) NOT NULL DEFAULT '',
"key" varchar(191) NOT NULL,
- "value" text DEFAULT NULL
+ "value" text DEFAULT NULL,
+ PRIMARY KEY ("order_id","namespace","key")
);
-CREATE UNIQUE INDEX "order_meta_order_id" ON order_meta ("order_id","namespace","key");
-- SELECT setval('order_meta_order_meta_id_seq', 0, true); -- last inserted id by sample data
diff --git a/install/sql/pgsql/schema/order/order_product.sql b/install/sql/pgsql/schema/order/order_product.sql
index 8f2d4cb..4c8b793 100755
--- a/install/sql/pgsql/schema/order/order_product.sql
+++ b/install/sql/pgsql/schema/order/order_product.sql
@@ -19,4 +19,5 @@ CREATE TABLE order_product (
);
CREATE INDEX "order_product_order_id" ON order_product ("order_id");
+CREATE INDEX "order_product_product_id" ON order_product ("product_id");
-- SELECT setval('order_product_order_product_id_seq', 0, true); -- last inserted id by sample data
\ No newline at end of file
diff --git a/install/sql/pgsql/schema/order/order_product_option.sql b/install/sql/pgsql/schema/order/order_product_option.sql
index ed101e8..b2dd87f 100755
--- a/install/sql/pgsql/schema/order/order_product_option.sql
+++ b/install/sql/pgsql/schema/order/order_product_option.sql
@@ -17,4 +17,6 @@ CREATE TABLE order_product_option (
-- PRIMARY KEY("order_product_option_id")
);
+CREATE INDEX "order_product_option_order_id" ON order_product_option ("order_id");
+CREATE INDEX "order_product_option_order_product_id" ON order_product_option ("order_product_id");
-- SELECT setval('order_product_option_order_product_option_id_seq', 0, true); -- last inserted id by sample data
\ No newline at end of file
diff --git a/install/sql/pgsql/schema/order/order_shipment.sql b/install/sql/pgsql/schema/order/order_shipment.sql
index fd4dd41..c469981 100755
--- a/install/sql/pgsql/schema/order/order_shipment.sql
+++ b/install/sql/pgsql/schema/order/order_shipment.sql
@@ -13,4 +13,5 @@ CREATE TABLE order_shipment (
-- PRIMARY KEY("order_shipment_id")
);
+CREATE INDEX "order_shipment_order_id" ON order_shipment ("order_id");
-- SELECT setval('order_shipment_order_shipment_id_seq', 0, true); -- last inserted id by sample data
\ No newline at end of file
diff --git a/install/sql/pgsql/schema/order/order_transaction.sql b/install/sql/pgsql/schema/order/order_transaction.sql
new file mode 100755
index 0000000..e8bc71c
--- /dev/null
+++ b/install/sql/pgsql/schema/order/order_transaction.sql
@@ -0,0 +1,23 @@
+DROP TABLE IF EXISTS order_transaction;
+
+-- DROP SEQUENCE IF EXISTS order_transaction_order_transaction_id_seq;
+-- CREATE SEQUENCE order_transaction_order_transaction_id_seq;
+
+
+CREATE TABLE order_transaction (
+ "order_transaction_id" int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, -- SERIAL PRIMARY KEY,
+ "order_id" int check ("order_id" > 0) NOT NULL,
+ "kind" varchar(32) NOT NULL DEFAULT '',
+ "gateway" varchar(64) NOT NULL DEFAULT '',
+ "reference" varchar(191) NOT NULL DEFAULT '',
+ "amount" decimal(15,4) NOT NULL DEFAULT 0.0000,
+ "tax_amount" decimal(15,4) NOT NULL DEFAULT 0.0000,
+ "currency" varchar(3) NOT NULL DEFAULT '',
+ "status" varchar(32) NOT NULL DEFAULT '',
+ "note" text,
+ "created_at" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
+ -- PRIMARY KEY("order_transaction_id")
+);
+
+CREATE INDEX "order_id" ON order_transaction ("order_id");
+-- SELECT setval('order_transaction_order_transaction_id_seq', 0, true); -- last inserted id by sample data
diff --git a/install/sql/pgsql/schema/order/order_voucher.sql b/install/sql/pgsql/schema/order/order_voucher.sql
index 9b3237f..6811056 100755
--- a/install/sql/pgsql/schema/order/order_voucher.sql
+++ b/install/sql/pgsql/schema/order/order_voucher.sql
@@ -19,4 +19,6 @@ CREATE TABLE order_voucher (
-- PRIMARY KEY("order_voucher_id")
);
+CREATE INDEX "order_voucher_order_id" ON order_voucher ("order_id");
+CREATE INDEX "order_voucher_voucher_id" ON order_voucher ("voucher_id");
-- SELECT setval('order_voucher_order_voucher_id_seq', 0, true); -- last inserted id by sample data
\ No newline at end of file
diff --git a/install/sql/pgsql/schema/order/return.sql b/install/sql/pgsql/schema/order/return.sql
index 1d5e4ef..fb8f154 100755
--- a/install/sql/pgsql/schema/order/return.sql
+++ b/install/sql/pgsql/schema/order/return.sql
@@ -8,6 +8,7 @@ CREATE TABLE return (
"return_id" int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, -- SERIAL PRIMARY KEY
"order_id" int check ("order_id" > 0) NOT NULL,
"customer_order_id" varchar(64) NOT NULL DEFAULT 0,
+ "product_id" int check ("product_id" > 0) NOT NULL,
"user_id" int check ("user_id" > 0) NOT NULL,
"first_name" varchar(32) NOT NULL,
"last_name" varchar(32) NOT NULL,
@@ -17,9 +18,9 @@ CREATE TABLE return (
"model" varchar(64) NOT NULL,
"quantity" int NOT NULL,
"opened" smallint NOT NULL,
- "return_reason_id" int check ("return_reason_id" > 0) NOT NULL,
- "return_resolution_id" int check ("return_resolution_id" > 0) NOT NULL DEFAULT 1,
- "return_status_id" int check ("return_status_id" > 0) NOT NULL DEFAULT 1,
+ "return_reason_id" int check ("return_reason_id" >= 0) NOT NULL DEFAULT 0,
+ "return_resolution_id" int check ("return_resolution_id" >= 0) NOT NULL DEFAULT 0,
+ "return_status_id" int check ("return_status_id" >= 0) NOT NULL DEFAULT 0,
"note" text NOT NULL,
"date_ordered" date NOT NULL,
"created_at" timestamp(0) NOT NULL DEFAULT now(),
@@ -27,4 +28,7 @@ CREATE TABLE return (
-- PRIMARY KEY("return_id")
);
+CREATE INDEX "return_order_id" ON return ("order_id");
+CREATE INDEX "return_product_id" ON return ("product_id");
+CREATE INDEX "return_user_id" ON return ("user_id");
-- SELECT setval('return_return_id_seq', 0, true); -- last inserted id by sample data
diff --git a/install/sql/pgsql/schema/order/return_log.sql b/install/sql/pgsql/schema/order/return_log.sql
index 3ad04bd..fe24ccd 100755
--- a/install/sql/pgsql/schema/order/return_log.sql
+++ b/install/sql/pgsql/schema/order/return_log.sql
@@ -14,4 +14,5 @@ CREATE TABLE return_log (
-- PRIMARY KEY("return_log_id")
);
+CREATE INDEX "return_log_return_id" ON return_log ("return_id");
-- SELECT setval('return_log_return_log_id_seq', 0, true); -- last inserted id by sample data
\ No newline at end of file
diff --git a/install/sql/pgsql/schema/order/warehouse.sql b/install/sql/pgsql/schema/order/warehouse.sql
new file mode 100755
index 0000000..656682f
--- /dev/null
+++ b/install/sql/pgsql/schema/order/warehouse.sql
@@ -0,0 +1,25 @@
+DROP TABLE IF EXISTS warehouse;
+
+-- DROP SEQUENCE IF EXISTS warehouse_warehouse_id_seq;
+-- CREATE SEQUENCE warehouse_warehouse_id_seq;
+
+
+CREATE TABLE "warehouse" (
+ "warehouse_id" int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, -- SERIAL PRIMARY KEY
+ "name" varchar(191) NOT NULL DEFAULT '',
+ "country_id" INT NOT NULL DEFAULT 0,
+ "region_id" INT NOT NULL DEFAULT 0,
+ "city" varchar(191) NOT NULL DEFAULT '',
+ "postal_code" varchar(32) NOT NULL DEFAULT '',
+ "address_1" varchar(191) NOT NULL DEFAULT '',
+ "status" smallint NOT NULL DEFAULT 1,
+ "sort_order" INT NOT NULL DEFAULT 0
+-- PRIMARY KEY ("warehouse_id")
+);
+DROP TABLE IF EXISTS product_warehouse;
+
+CREATE TABLE "product_warehouse" (
+ "product_id" INT NOT NULL,
+ "warehouse_id" INT NOT NULL,
+ PRIMARY KEY ("product_id","warehouse_id")
+);
diff --git a/install/sql/pgsql/schema/plugin/message.sql b/install/sql/pgsql/schema/plugin/message.sql
index a5d13f2..5c5a118 100755
--- a/install/sql/pgsql/schema/plugin/message.sql
+++ b/install/sql/pgsql/schema/plugin/message.sql
@@ -7,8 +7,8 @@ DROP TABLE IF EXISTS message;
CREATE TABLE message (
"message_id" int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, -- SERIAL PRIMARY KEY
"type" varchar(20) NOT NULL DEFAULT 'message',
- "data" text DEFAULT NULL,
- "meta" text DEFAULT NULL,
+ "data" text NOT NULL,
+ "meta" text NOT NULL,
"status" smallint NOT NULL DEFAULT 0, -- unread = 0, read = 1
"created_at" timestamp(0) NOT NULL DEFAULT now(),
"updated_at" timestamp(0) NOT NULL DEFAULT now()
@@ -18,5 +18,5 @@ CREATE TABLE message (
DROP INDEX IF EXISTS "message_type_status_date";
-CREATE INDEX "message_type_status_date" ON message ("type","created_at","message_id");
+CREATE INDEX "message_type_status_date" ON message ("type","status","created_at");
-- SELECT setval('message_message_id_seq', 0, true); -- last inserted id by sample data
diff --git a/install/sql/pgsql/schema/plugin/newsletter_list.sql b/install/sql/pgsql/schema/plugin/newsletter_list.sql
old mode 100644
new mode 100755
index 42fb4af..e43a9c7
--- a/install/sql/pgsql/schema/plugin/newsletter_list.sql
+++ b/install/sql/pgsql/schema/plugin/newsletter_list.sql
@@ -4,7 +4,7 @@ CREATE TABLE IF NOT EXISTS newsletter_list (
"newsletter_list_id" int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, -- SERIAL PRIMARY KEY
"name" varchar(254) NOT NULL,
"data" text NOT NULL,
- "status" smallint NOT NULL DEFAULT '0',
+ "status" smallint NOT NULL DEFAULT 0,
"created_at" timestamp(0) NOT NULL DEFAULT now(),
"updated_at" timestamp(0) NOT NULL DEFAULT now()
);
diff --git a/install/sql/pgsql/schema/plugin/newsletter_mail.sql b/install/sql/pgsql/schema/plugin/newsletter_mail.sql
old mode 100644
new mode 100755
index 84960b8..45312aa
--- a/install/sql/pgsql/schema/plugin/newsletter_mail.sql
+++ b/install/sql/pgsql/schema/plugin/newsletter_mail.sql
@@ -1,14 +1,15 @@
-- DROP TABLE IF EXISTS "newsletter_mail";
CREATE TABLE IF NOT EXISTS "newsletter_mail" (
- "newsletter_list_id" INT,
+ "newsletter_list_id" INT NOT NULL,
"email" varchar(254) NOT NULL,
"first_name" varchar(254) NOT NULL DEFAULT '',
"last_name" varchar(254) NOT NULL DEFAULT '',
"data" text NOT NULL,
"status" smallint NOT NULL DEFAULT '0', -- inactive = 0, active = 1, unsubsubscribed = 2
"created_at" timestamp(0) NOT NULL DEFAULT now(),
- "updated_at" timestamp(0) NOT NULL DEFAULT now()
+ "updated_at" timestamp(0) NOT NULL DEFAULT now(),
+ PRIMARY KEY ("email", "newsletter_list_id")
);
-CREATE INDEX "newsletter_mail_email_newsletter_list_id" ON newsletter_mail ("email","newsletter_list_id");
+CREATE INDEX "newsletter_mail_newsletter_list_id" ON newsletter_mail ("newsletter_list_id");
diff --git a/install/sql/pgsql/schema/plugin/newsletter_post.sql b/install/sql/pgsql/schema/plugin/newsletter_post.sql
old mode 100644
new mode 100755
diff --git a/install/sql/pgsql/schema/post/post_content.sql b/install/sql/pgsql/schema/post/post_content.sql
index e8169d4..8d5431a 100755
--- a/install/sql/pgsql/schema/post/post_content.sql
+++ b/install/sql/pgsql/schema/post/post_content.sql
@@ -7,7 +7,7 @@ CREATE TABLE post_content (
"name" varchar(191) NOT NULL,
"slug" varchar(191) NOT NULL,
"content" text NOT NULL,
- "excerpt" text DEFAULT '',
+ "excerpt" text,
"meta_keywords" text NOT NULL DEFAULT '',
"meta_description" text NOT NULL DEFAULT '',
PRIMARY KEY ("post_id","language_id")
diff --git a/install/sql/pgsql/schema/post/post_content_revision.sql b/install/sql/pgsql/schema/post/post_content_revision.sql
index b4c9596..afaa5af 100755
--- a/install/sql/pgsql/schema/post/post_content_revision.sql
+++ b/install/sql/pgsql/schema/post/post_content_revision.sql
@@ -9,7 +9,7 @@ CREATE TABLE IF NOT EXISTS post_content_revision (
"content" text DEFAULT NULL,
"admin_id" int check ("admin_id" > 0) NOT NULL,
"created_at" timestamp(0) NOT NULL DEFAULT now(),
- PRIMARY KEY("post_id","language_id","created_at")
+ PRIMARY KEY("post_id","language_id","created_at","admin_id")
);
diff --git a/install/sql/pgsql/schema/post/post_to_site.sql b/install/sql/pgsql/schema/post/post_to_site.sql
index eef4c65..042531d 100755
--- a/install/sql/pgsql/schema/post/post_to_site.sql
+++ b/install/sql/pgsql/schema/post/post_to_site.sql
@@ -5,3 +5,5 @@ CREATE TABLE post_to_site (
"site_id" smallint NOT NULL DEFAULT 0,
PRIMARY KEY("post_id","site_id")
);
+
+CREATE INDEX IF NOT EXISTS "post_to_site_site" ON post_to_site ("site_id");
diff --git a/install/sql/pgsql/schema/product/length_type_content.sql b/install/sql/pgsql/schema/product/length_type_content.sql
index 06c677d..8b5d264 100755
--- a/install/sql/pgsql/schema/product/length_type_content.sql
+++ b/install/sql/pgsql/schema/product/length_type_content.sql
@@ -3,6 +3,6 @@ CREATE TABLE length_type_content (
"length_type_id" int check ("length_type_id" > 0) NOT NULL,
"language_id" int check ("language_id" > 0) NOT NULL,
"name" varchar(32) NOT NULL,
- "unit" varchar(4) NOT NULL
- -- PRIMARY KEY("length_type_id","language_id")
+ "unit" varchar(4) NOT NULL,
+ PRIMARY KEY("length_type_id","language_id")
);
\ No newline at end of file
diff --git a/install/sql/pgsql/schema/product/manufacturer.sql b/install/sql/pgsql/schema/product/manufacturer.sql
index fb4f7f3..3bd3487 100755
--- a/install/sql/pgsql/schema/product/manufacturer.sql
+++ b/install/sql/pgsql/schema/product/manufacturer.sql
@@ -7,7 +7,7 @@ CREATE TABLE manufacturer (
"manufacturer_id" int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, -- SERIAL PRIMARY KEY
"name" varchar(191) NOT NULL DEFAULT '',
"slug" varchar(191) NOT NULL DEFAULT '',
- "image" varchar(191) NOT NULL,
+ "image" varchar(191) NOT NULL DEFAULT '',
"sort_order" int NOT NULL DEFAULT 0
-- PRIMARY KEY("manufacturer_id")
);
diff --git a/install/sql/pgsql/schema/product/manufacturer_to_site.sql b/install/sql/pgsql/schema/product/manufacturer_to_site.sql
index 2cf376f..17708fa 100755
--- a/install/sql/pgsql/schema/product/manufacturer_to_site.sql
+++ b/install/sql/pgsql/schema/product/manufacturer_to_site.sql
@@ -2,6 +2,8 @@ DROP TABLE IF EXISTS manufacturer_to_site;
CREATE TABLE manufacturer_to_site (
"manufacturer_id" int check ("manufacturer_id" > 0) NOT NULL,
- "site_id" smallint NOT NULL,
+ "site_id" smallint NOT NULL DEFAULT 0,
PRIMARY KEY("manufacturer_id","site_id")
);
+
+CREATE INDEX IF NOT EXISTS "manufacturer_to_site_site" ON manufacturer_to_site ("site_id");
diff --git a/install/sql/pgsql/schema/product/product.sql b/install/sql/pgsql/schema/product/product.sql
old mode 100644
new mode 100755
index e942cbd..31942df
--- a/install/sql/pgsql/schema/product/product.sql
+++ b/install/sql/pgsql/schema/product/product.sql
@@ -20,7 +20,7 @@ CREATE TABLE product (
"mid_code" varchar(13) NOT NULL DEFAULT '',
"location" varchar(128) NOT NULL DEFAULT '',
"stock_quantity" int NOT NULL DEFAULT 1,
- "stock_status_id" int check ("stock_status_id" >= 0) NOT NULL DEFAULT 0,
+ "stock_status_id" int check ("stock_status_id" >= 0) NOT NULL DEFAULT 1,
"image" varchar(191) NOT NULL DEFAULT '',
"manufacturer_id" int check ("manufacturer_id" >= 0) NOT NULL DEFAULT 0,
"vendor_id" int check ("vendor_id" >= 0) NOT NULL DEFAULT 0,
@@ -36,7 +36,7 @@ CREATE TABLE product (
"width" decimal(15,8) NOT NULL DEFAULT 0.00000000,
"height" decimal(15,8) NOT NULL DEFAULT 0.00000000,
"length_type_id" int check ("length_type_id" >= 0) NOT NULL DEFAULT 0,
- "date_available" date NOT NULL DEFAULT '1000-01-01',
+ "date_available" date,
"template" varchar(191) NOT NULL DEFAULT '',
"views" int NOT NULL DEFAULT 0,
"subtract_stock" smallint NOT NULL DEFAULT 1,
@@ -50,6 +50,11 @@ CREATE TABLE product (
-- PRIMARY KEY("product_id")
);
-CREATE INDEX "product_type_status_date" ON product ("type","status","created_at","product_id");
+CREATE INDEX "product_type_status_date" ON product ("type","status","created_at");
+CREATE INDEX "product_stock_status_id" ON product ("stock_status_id");
+CREATE INDEX "product_vendor_id" ON product ("vendor_id");
+CREATE INDEX "product_manufacturer_id" ON product ("manufacturer_id");
+CREATE INDEX "product_barcode" ON product ("barcode");
+CREATE INDEX "product_sku" ON product ("sku");
-- SELECT setval('product_product_id_seq', 19, true); -- last inserted id by sample data
diff --git a/install/sql/pgsql/schema/product/product_content.sql b/install/sql/pgsql/schema/product/product_content.sql
index ef555a1..a829756 100755
--- a/install/sql/pgsql/schema/product/product_content.sql
+++ b/install/sql/pgsql/schema/product/product_content.sql
@@ -6,7 +6,7 @@ CREATE TABLE product_content (
"name" varchar(191) NOT NULL DEFAULT '',
"slug" varchar(191) NOT NULL DEFAULT '',
"content" text DEFAULT NULL,
- "excerpt" text DEFAULT '',
+ "excerpt" text,
"meta_title" varchar(191) NOT NULL DEFAULT '',
"meta_description" varchar(191) NOT NULL DEFAULT '',
"meta_keywords" varchar(191) NOT NULL DEFAULT '',
diff --git a/install/sql/pgsql/schema/product/product_content_revision.sql b/install/sql/pgsql/schema/product/product_content_revision.sql
index 6b214ef..e153d8a 100755
--- a/install/sql/pgsql/schema/product/product_content_revision.sql
+++ b/install/sql/pgsql/schema/product/product_content_revision.sql
@@ -11,7 +11,7 @@ CREATE TABLE product_content_revision (
"content" text DEFAULT NULL,
"admin_id" int check ("admin_id" > 0) NOT NULL,
"created_at" timestamp(0) NOT NULL DEFAULT now(),
- PRIMARY KEY("product_id","language_id","created_at")
+ PRIMARY KEY("product_id","language_id","created_at","admin_id")
);
diff --git a/install/sql/pgsql/schema/product/product_discount.sql b/install/sql/pgsql/schema/product/product_discount.sql
index e5689c4..10db9d3 100755
--- a/install/sql/pgsql/schema/product/product_discount.sql
+++ b/install/sql/pgsql/schema/product/product_discount.sql
@@ -10,10 +10,11 @@ CREATE TABLE product_discount (
"quantity" int NOT NULL DEFAULT 0,
"priority" int NOT NULL DEFAULT 1,
"price" decimal(15,4) NOT NULL DEFAULT 0.0000,
- "from_date" date NOT NULL DEFAULT '1000-01-01',
- "to_date" date NOT NULL DEFAULT '1000-01-01'
+ "from_date" date,
+ "to_date" date
-- PRIMARY KEY("product_discount_id")
);
--- CREATE INDEX "product_discount_product_id" ON product_discount ("product_id");
+CREATE INDEX "product_discount_product_id" ON product_discount ("product_id");
+CREATE INDEX "product_discount_user_group_id" ON product_discount ("user_group_id");
SELECT setval('product_discount_product_discount_id_seq', 19, true); -- last inserted id by sample data
\ No newline at end of file
diff --git a/install/sql/pgsql/schema/product/product_meta.sql b/install/sql/pgsql/schema/product/product_meta.sql
index 739771a..6c209e0 100755
--- a/install/sql/pgsql/schema/product/product_meta.sql
+++ b/install/sql/pgsql/schema/product/product_meta.sql
@@ -1,14 +1,9 @@
DROP TABLE IF EXISTS product_meta;
--- DROP SEQUENCE IF EXISTS product_meta_product_meta_id_seq;
--- CREATE SEQUENCE product_meta_product_meta_id_seq;
-
CREATE TABLE product_meta (
"product_id" int check ("product_id" > 0) NOT NULL,
"namespace" varchar(32) NOT NULL DEFAULT '',
- "key" varchar(191) NOT NULL,
- "value" text DEFAULT NULL
+ "key" varchar(191) NOT NULL DEFAULT '',
+ "value" text DEFAULT NULL,
+ PRIMARY KEY ("product_id","namespace","key")
);
-
-CREATE UNIQUE INDEX "product_meta_product_id" ON product_meta ("product_id","namespace","key");
--- SELECT setval('product_meta_product_meta_id_seq', 0, true); -- last inserted id by sample data
diff --git a/install/sql/pgsql/schema/product/product_promotion.sql b/install/sql/pgsql/schema/product/product_promotion.sql
index c4d4701..b3c7d69 100755
--- a/install/sql/pgsql/schema/product/product_promotion.sql
+++ b/install/sql/pgsql/schema/product/product_promotion.sql
@@ -10,10 +10,11 @@ CREATE TABLE product_promotion (
"user_group_id" int check ("user_group_id" > 0) NOT NULL,
"priority" int NOT NULL DEFAULT 1,
"price" decimal(15,4) NOT NULL DEFAULT 0.0000,
- "from_date" date NOT NULL DEFAULT '1000-01-01',
- "to_date" date NOT NULL DEFAULT '1000-01-01'
+ "from_date" date,
+ "to_date" date
-- PRIMARY KEY("product_promotion_id")
);
CREATE INDEX "product_promotion_product_id" ON product_promotion ("product_id");
+CREATE INDEX "product_promotion_user_group_id" ON product_promotion ("user_group_id");
SELECT setval('product_promotion_product_promotion_id_seq', 1, true); -- last inserted id by sample data
\ No newline at end of file
diff --git a/install/sql/pgsql/schema/product/product_question.sql b/install/sql/pgsql/schema/product/product_question.sql
index 4290901..9fe2ea2 100755
--- a/install/sql/pgsql/schema/product/product_question.sql
+++ b/install/sql/pgsql/schema/product/product_question.sql
@@ -17,5 +17,6 @@ CREATE TABLE product_question (
-- PRIMARY KEY("product_question_id")
);
-CREATE INDEX "product_question_product_id" ON product_question ("product_id");
+CREATE INDEX "product_question_product_id" ON product_question ("product_id", "status");
+CREATE INDEX "product_question_user_id" ON product_question ("user_id");
SELECT setval('product_question_product_question_id_seq', 5, true); -- last inserted id by sample data
\ No newline at end of file
diff --git a/install/sql/pgsql/schema/product/product_related.sql b/install/sql/pgsql/schema/product/product_related.sql
index c2ff5fd..aea49fe 100755
--- a/install/sql/pgsql/schema/product/product_related.sql
+++ b/install/sql/pgsql/schema/product/product_related.sql
@@ -3,4 +3,6 @@ CREATE TABLE product_related (
"product_id" int check ("product_id" > 0) NOT NULL,
"product_related_id" int check ("product_related_id" > 0) NOT NULL,
PRIMARY KEY("product_id","product_related_id")
-);
\ No newline at end of file
+);
+
+CREATE INDEX IF NOT EXISTS "product_related_related" ON product_related ("product_related_id");
diff --git a/install/sql/pgsql/schema/product/product_review_media.sql b/install/sql/pgsql/schema/product/product_review_media.sql
index 15154eb..7f8eedd 100755
--- a/install/sql/pgsql/schema/product/product_review_media.sql
+++ b/install/sql/pgsql/schema/product/product_review_media.sql
@@ -6,7 +6,7 @@ DROP TABLE IF EXISTS product_review_media;
CREATE TABLE product_review_media (
"product_review_media_id" int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, -- SERIAL PRIMARY KEY
- "product_review_id" int check ("product_id" > 0) NOT NULL,
+ "product_review_id" int check ("product_review_id" > 0) NOT NULL,
"product_id" int check ("product_id" > 0) NOT NULL,
"user_id" int check ("user_id" > 0) NOT NULL,
"image" varchar(191) NOT NULL,
@@ -16,4 +16,5 @@ CREATE TABLE product_review_media (
CREATE INDEX "product_review_media_product_id" ON product_review_media ("product_id", "user_id");
CREATE INDEX "product_review_media_product_review_id" ON product_review_media ("product_review_id");
+CREATE INDEX "product_review_media_user_id" ON product_review_media ("user_id");
SELECT setval('product_review_media_product_review_media_id_seq', 14, true); -- last inserted id by sample data
diff --git a/install/sql/pgsql/schema/product/product_to_site.sql b/install/sql/pgsql/schema/product/product_to_site.sql
index 4439113..24b3e56 100755
--- a/install/sql/pgsql/schema/product/product_to_site.sql
+++ b/install/sql/pgsql/schema/product/product_to_site.sql
@@ -5,3 +5,5 @@ CREATE TABLE product_to_site (
"site_id" smallint NOT NULL DEFAULT 0,
PRIMARY KEY("product_id","site_id")
);
+
+CREATE INDEX IF NOT EXISTS "product_to_site_site" ON product_to_site ("site_id");
diff --git a/install/sql/pgsql/schema/product/product_variant.sql b/install/sql/pgsql/schema/product/product_variant.sql
old mode 100644
new mode 100755
index f09fc41..77a9501
--- a/install/sql/pgsql/schema/product/product_variant.sql
+++ b/install/sql/pgsql/schema/product/product_variant.sql
@@ -17,4 +17,5 @@ CREATE TABLE product_variant (
-- PRIMARY KEY("product_variant_id")
);
-CREATE INDEX "product_variant_product_id_product_option" ON "product_variant" ("product_id","product_variant_id", "options");
+CREATE INDEX "product_variant_product_id" ON product_variant ("product_id","stock_quantity","options");
+CREATE INDEX "product_variant_options" ON product_variant ("options");
diff --git a/install/sql/pgsql/schema/product/vendor.sql b/install/sql/pgsql/schema/product/vendor.sql
index 2e5d395..c290d8c 100755
--- a/install/sql/pgsql/schema/product/vendor.sql
+++ b/install/sql/pgsql/schema/product/vendor.sql
@@ -9,7 +9,7 @@ CREATE TABLE vendor (
"admin_id" int check ("admin_id" >= 0) NOT NULL DEFAULT 0,
"name" varchar(191) NOT NULL DEFAULT '',
"slug" varchar(191) NOT NULL DEFAULT '',
- "image" varchar(191) NOT NULL,
+ "image" varchar(191) NOT NULL DEFAULT '',
"sort_order" int NOT NULL DEFAULT 0
-- PRIMARY KEY("vendor_id")
);
diff --git a/install/sql/pgsql/schema/product/vendor_to_site.sql b/install/sql/pgsql/schema/product/vendor_to_site.sql
index 24f2a62..64ec236 100755
--- a/install/sql/pgsql/schema/product/vendor_to_site.sql
+++ b/install/sql/pgsql/schema/product/vendor_to_site.sql
@@ -2,6 +2,8 @@ DROP TABLE IF EXISTS vendor_to_site;
CREATE TABLE vendor_to_site (
"vendor_id" int check ("vendor_id" > 0) NOT NULL,
- "site_id" smallint NOT NULL,
+ "site_id" smallint NOT NULL DEFAULT 0,
PRIMARY KEY("vendor_id","site_id")
);
+
+CREATE INDEX IF NOT EXISTS "vendor_to_site_site" ON vendor_to_site ("site_id");
diff --git a/install/sql/pgsql/schema/queue/queue.sql b/install/sql/pgsql/schema/queue/queue.sql
new file mode 100755
index 0000000..77155d4
--- /dev/null
+++ b/install/sql/pgsql/schema/queue/queue.sql
@@ -0,0 +1,33 @@
+DROP TABLE IF EXISTS queue_jobs;
+
+CREATE TABLE queue_jobs (
+ "id" bigserial PRIMARY KEY,
+ "job_id" varchar(36) NOT NULL,
+ "queue" varchar(128) NOT NULL DEFAULT 'default',
+ "job" varchar(255) NOT NULL,
+ "payload" text,
+ "attempts" integer NOT NULL DEFAULT 0,
+ "max_attempts" integer NOT NULL DEFAULT 3,
+ "available_at" bigint NOT NULL DEFAULT 0,
+ "reserved_at" bigint DEFAULT NULL,
+ "created_at" bigint NOT NULL DEFAULT 0
+);
+
+CREATE UNIQUE INDEX u_queue_jobs_job_id ON queue_jobs ("job_id");
+CREATE INDEX idx_queue_jobs_queue_available ON queue_jobs ("queue", "available_at");
+CREATE INDEX idx_queue_jobs_reserved ON queue_jobs ("reserved_at");
+
+DROP TABLE IF EXISTS failed_jobs;
+
+CREATE TABLE failed_jobs (
+ "job_id" varchar(36) NOT NULL PRIMARY KEY,
+ "queue" varchar(128) NOT NULL DEFAULT 'default',
+ "job" varchar(255) NOT NULL,
+ "payload" text,
+ "error" text,
+ "attempts" integer NOT NULL DEFAULT 0,
+ "max_attempts" integer NOT NULL DEFAULT 3,
+ "failed_at" bigint NOT NULL DEFAULT 0
+);
+
+CREATE INDEX idx_failed_jobs_queue_failed ON failed_jobs ("queue", "failed_at");
diff --git a/install/sql/pgsql/schema/site/site.sql b/install/sql/pgsql/schema/site/site.sql
old mode 100644
new mode 100755
diff --git a/install/sql/pgsql/schema/subscription/order_subscription.sql b/install/sql/pgsql/schema/subscription/order_subscription.sql
index 4c27768..891b659 100755
--- a/install/sql/pgsql/schema/subscription/order_subscription.sql
+++ b/install/sql/pgsql/schema/subscription/order_subscription.sql
@@ -21,9 +21,9 @@ CREATE TABLE "order_subscription" (
"period" TEXT CHECK( period IN ('day','week','month','year') ) NOT NULL DEFAULT 'month',
"cycle" smallint NOT NULL,
"length" smallint NOT NULL
- -- PRIMARY KEY ("order_subscription_id")
--- KEY "order_id" ("order_id")
);
--- CREATE INDEX "order_subscription_order_id" ON "order_subscription" ("order_id");
+CREATE INDEX "order_subscription_order_id" ON "order_subscription" ("order_id");
+CREATE INDEX "order_subscription_product_id" ON "order_subscription" ("product_id");
+CREATE INDEX "order_subscription_subscription_plan_id" ON "order_subscription" ("subscription_plan_id");
-- SELECT setval('order_subscription_order_subscription_id_seq', 0, true); -- last inserted id by sample data
diff --git a/install/sql/pgsql/schema/subscription/subscription.sql b/install/sql/pgsql/schema/subscription/subscription.sql
old mode 100644
new mode 100755
index 79199f6..ad229ca
--- a/install/sql/pgsql/schema/subscription/subscription.sql
+++ b/install/sql/pgsql/schema/subscription/subscription.sql
@@ -1,11 +1,11 @@
DROP TABLE IF EXISTS subscription;
-DROP SEQUENCE IF EXISTS subscription_seq;
-CREATE SEQUENCE subscription_seq;
+-- DROP SEQUENCE IF EXISTS subscription_subscription_id_seq;
+-- CREATE SEQUENCE subscription_subscription_id_seq;
-- SELECT setval('subscription_seq', 0, true); -- last inserted id by sample data
CREATE TABLE "subscription" (
- "subscription_id" int check ("subscription_status_id" > 0) NOT NULL DEFAULT NEXTVAL ('subscription_seq'),
+ "subscription_id" int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, -- SERIAL PRIMARY KEY
"order_id" INT NOT NULL,
"order_product_id" INT NOT NULL,
"site_id" INT NOT NULL,
@@ -28,17 +28,16 @@ CREATE TABLE "subscription" (
"trial_length" smallint NOT NULL,
"trial_left" smallint NOT NULL,
"trial_status" smallint NOT NULL,
- "date_next" timestamp(0) NOT NULL DEFAULT now(),
- "note" text NOT NULL,
+ "date_next" timestamp(0) NOT NULL,
"subscription_status_id" INT NOT NULL,
- "language_id" INT NOT NULL,
- "currency_id" INT NOT NULL,
- "ip" TEXT NOT NULL,
- "forwarded_ip" TEXT NOT NULL,
- "user_agent" TEXT NOT NULL,
+ "notes" text NOT NULL,
"created_at" timestamp(0) NOT NULL DEFAULT now(),
- "updated_at" timestamp(0) NOT NULL DEFAULT now(),
-PRIMARY KEY ("subscription_id")
+ "updated_at" timestamp(0) NOT NULL DEFAULT now()
);
CREATE INDEX "subscription_order_id" ON "subscription" ("order_id");
+CREATE INDEX "subscription_user_id" ON "subscription" ("user_id");
+CREATE INDEX "subscription_product_id" ON "subscription" ("product_id");
+CREATE INDEX "subscription_subscription_plan_id" ON "subscription" ("subscription_plan_id");
+CREATE INDEX "subscription_subscription_status_id" ON "subscription" ("subscription_status_id");
+-- SELECT setval('subscription_subscription_id_seq', 0, true); -- last inserted id by sample data
diff --git a/install/sql/pgsql/schema/subscription/subscription_log.sql b/install/sql/pgsql/schema/subscription/subscription_log.sql
index 2a47bd3..637bdeb 100755
--- a/install/sql/pgsql/schema/subscription/subscription_log.sql
+++ b/install/sql/pgsql/schema/subscription/subscription_log.sql
@@ -13,4 +13,5 @@ CREATE TABLE "subscription_log" (
-- PRIMARY KEY ("subscription_log_id")
);
+CREATE INDEX "subscription_log_subscription_id" ON "subscription_log" ("subscription_id");
-- SELECT setval('subscription_log_subscription_log_id_seq', 0, true); -- last inserted id by sample data
\ No newline at end of file
diff --git a/install/sql/pgsql/schema/subscription/subscription_plan.sql b/install/sql/pgsql/schema/subscription/subscription_plan.sql
index 30e88e9..79faaa8 100755
--- a/install/sql/pgsql/schema/subscription/subscription_plan.sql
+++ b/install/sql/pgsql/schema/subscription/subscription_plan.sql
@@ -13,7 +13,7 @@ CREATE TABLE "subscription_plan" (
"trial_length" INT NOT NULL,
"trial_cycle" INT NOT NULL,
"trial_status" smallint NOT NULL,
- "status" smallint NOT NULL DEFAULT 0,
+ "status" smallint NOT NULL,
"sort_order" INT NOT NULL DEFAULT 0
-- PRIMARY KEY ("subscription_plan_id")
);
diff --git a/install/sql/pgsql/schema/subscription/subscription_plan_content.sql b/install/sql/pgsql/schema/subscription/subscription_plan_content.sql
old mode 100644
new mode 100755
index 8ddf841..07bde35
--- a/install/sql/pgsql/schema/subscription/subscription_plan_content.sql
+++ b/install/sql/pgsql/schema/subscription/subscription_plan_content.sql
@@ -3,7 +3,7 @@ DROP TABLE IF EXISTS "subscription_plan_content";
CREATE TABLE "subscription_plan_content" (
"subscription_plan_id" INT NOT NULL,
"language_id" INT NOT NULL,
- "name" varchar(191) NOT NULL DEFAULT '',
+ "name" varchar(191) NOT NULL,
"content" text DEFAULT NULL,
PRIMARY KEY("subscription_plan_id","language_id")
);
diff --git a/install/sql/pgsql/schema/tax/tax_rate.sql b/install/sql/pgsql/schema/tax/tax_rate.sql
index ab0833f..d7a3983 100755
--- a/install/sql/pgsql/schema/tax/tax_rate.sql
+++ b/install/sql/pgsql/schema/tax/tax_rate.sql
@@ -16,4 +16,5 @@ CREATE TABLE tax_rate (
-- PRIMARY KEY("tax_rate_id")
);
+CREATE INDEX "tax_rate_region_group_id" ON tax_rate ("region_group_id");
SELECT setval('tax_rate_tax_rate_id_seq', 3, true); -- last inserted id by sample data
\ No newline at end of file
diff --git a/install/sql/pgsql/schema/tax/tax_rule.sql b/install/sql/pgsql/schema/tax/tax_rule.sql
index cf14a8e..dc48527 100755
--- a/install/sql/pgsql/schema/tax/tax_rule.sql
+++ b/install/sql/pgsql/schema/tax/tax_rule.sql
@@ -13,4 +13,5 @@ CREATE TABLE tax_rule (
-- PRIMARY KEY("tax_rule_id")
);
+CREATE INDEX "tax_rule" ON tax_rule ("tax_type_id","tax_rate_id");
SELECT setval('tax_rule_tax_rule_id_seq', 2, true); -- last inserted id by sample data
\ No newline at end of file
diff --git a/install/sql/pgsql/schema/post_category/post_to_taxonomy_item.sql b/install/sql/pgsql/schema/taxonomy/post_to_taxonomy_item.sql
old mode 100755
new mode 100644
similarity index 100%
rename from install/sql/pgsql/schema/post_category/post_to_taxonomy_item.sql
rename to install/sql/pgsql/schema/taxonomy/post_to_taxonomy_item.sql
diff --git a/install/sql/pgsql/schema/post_category/taxonomy.sql b/install/sql/pgsql/schema/taxonomy/taxonomy.sql
old mode 100755
new mode 100644
similarity index 90%
rename from install/sql/pgsql/schema/post_category/taxonomy.sql
rename to install/sql/pgsql/schema/taxonomy/taxonomy.sql
index 59ee288..8ba29c9
--- a/install/sql/pgsql/schema/post_category/taxonomy.sql
+++ b/install/sql/pgsql/schema/taxonomy/taxonomy.sql
@@ -13,5 +13,4 @@ CREATE TABLE taxonomy (
-- PRIMARY KEY("taxonomy_id")
);
-CREATE INDEX "taxonomy_id" ON taxonomy ("taxonomy_id");
SELECT setval('taxonomy_taxonomy_id_seq', 5, true); -- last inserted id by sample data
diff --git a/install/sql/pgsql/schema/post_category/taxonomy_content.sql b/install/sql/pgsql/schema/taxonomy/taxonomy_content.sql
old mode 100755
new mode 100644
similarity index 100%
rename from install/sql/pgsql/schema/post_category/taxonomy_content.sql
rename to install/sql/pgsql/schema/taxonomy/taxonomy_content.sql
diff --git a/install/sql/pgsql/schema/post_category/taxonomy_item.sql b/install/sql/pgsql/schema/taxonomy/taxonomy_item.sql
old mode 100755
new mode 100644
similarity index 100%
rename from install/sql/pgsql/schema/post_category/taxonomy_item.sql
rename to install/sql/pgsql/schema/taxonomy/taxonomy_item.sql
diff --git a/install/sql/pgsql/schema/post_category/taxonomy_item_content.sql b/install/sql/pgsql/schema/taxonomy/taxonomy_item_content.sql
old mode 100755
new mode 100644
similarity index 100%
rename from install/sql/pgsql/schema/post_category/taxonomy_item_content.sql
rename to install/sql/pgsql/schema/taxonomy/taxonomy_item_content.sql
diff --git a/install/sql/pgsql/schema/post_category/taxonomy_item_meta.sql b/install/sql/pgsql/schema/taxonomy/taxonomy_item_meta.sql
old mode 100755
new mode 100644
similarity index 100%
rename from install/sql/pgsql/schema/post_category/taxonomy_item_meta.sql
rename to install/sql/pgsql/schema/taxonomy/taxonomy_item_meta.sql
diff --git a/install/sql/pgsql/schema/post_category/taxonomy_to_site.sql b/install/sql/pgsql/schema/taxonomy/taxonomy_to_site.sql
old mode 100755
new mode 100644
similarity index 70%
rename from install/sql/pgsql/schema/post_category/taxonomy_to_site.sql
rename to install/sql/pgsql/schema/taxonomy/taxonomy_to_site.sql
index 0447a17..e1d6dc2
--- a/install/sql/pgsql/schema/post_category/taxonomy_to_site.sql
+++ b/install/sql/pgsql/schema/taxonomy/taxonomy_to_site.sql
@@ -3,4 +3,6 @@ CREATE TABLE taxonomy_to_site (
"taxonomy_item_id" int check ("taxonomy_item_id" > 0) NOT NULL,
"site_id" smallint NOT NULL,
PRIMARY KEY("taxonomy_item_id","site_id")
-);
\ No newline at end of file
+);
+
+CREATE INDEX IF NOT EXISTS "taxonomy_to_site_site" ON taxonomy_to_site ("site_id");
diff --git a/install/sql/pgsql/schema/user/digital_asset.sql b/install/sql/pgsql/schema/user/digital_asset.sql
index 6e5133d..9be34fa 100755
--- a/install/sql/pgsql/schema/user/digital_asset.sql
+++ b/install/sql/pgsql/schema/user/digital_asset.sql
@@ -15,4 +15,4 @@ CREATE TABLE digital_asset (
CREATE INDEX "digital_asset_admin" ON digital_asset ("admin_id");
-SELECT setval('digital_asset_digital_asset_id_seq', 1, true); -- last inserted id by sample data
+SELECT setval('digital_asset_digital_asset_id_seq', 1, true); -- last inserted id by sample data
\ No newline at end of file
diff --git a/install/sql/pgsql/schema/user/password_resets.sql b/install/sql/pgsql/schema/user/password_resets.sql
index 58804fd..69db337 100755
--- a/install/sql/pgsql/schema/user/password_resets.sql
+++ b/install/sql/pgsql/schema/user/password_resets.sql
@@ -1,6 +1,10 @@
-DROP TABLE IF EXISTS password_resets;
-CREATE TABLE password_resets (
+DROP TABLE IF EXISTS "password_resets";
+
+CREATE TABLE "password_resets" (
"email" varchar(191) NOT NULL,
"token" varchar(191) NOT NULL,
- "created_at" timestamp(0) NULL DEFAULT now()
-);
\ No newline at end of file
+ "created_at" timestamp(0) NULL DEFAULT NULL,
+ PRIMARY KEY ("email","token")
+);
+
+CREATE INDEX "password_resets_email" ON "password_resets" ("email");
diff --git a/install/sql/pgsql/schema/user/user.sql b/install/sql/pgsql/schema/user/user.sql
index 10972b6..8ca39aa 100755
--- a/install/sql/pgsql/schema/user/user.sql
+++ b/install/sql/pgsql/schema/user/user.sql
@@ -19,10 +19,10 @@ CREATE TABLE "user" (
"display_name" varchar(250) NOT NULL DEFAULT '',
"avatar" varchar(250) NOT NULL DEFAULT '',
"cover" varchar(250) NOT NULL DEFAULT '',
- "bio" varchar(250) NOT NULL DEFAULT '',
+ "bio" varchar(250) DEFAULT NULL,
"token" varchar(32) NOT NULL DEFAULT '',
"secret" varchar(32) NOT NULL DEFAULT '',
- "subscribe" smallint check ("status" >= 0) NOT NULL DEFAULT '0',
+ "subscribe" smallint check ("subscribe" >= 0) NOT NULL DEFAULT 0,
"last_ip" varchar(40) NOT NULL DEFAULT '',
"created_at" timestamp(0) NOT NULL DEFAULT now(),
"updated_at" timestamp(0) NOT NULL DEFAULT now()
diff --git a/install/sql/pgsql/schema/user/user_address.sql b/install/sql/pgsql/schema/user/user_address.sql
index 9d6f29f..cbc2d63 100755
--- a/install/sql/pgsql/schema/user/user_address.sql
+++ b/install/sql/pgsql/schema/user/user_address.sql
@@ -15,8 +15,8 @@ CREATE TABLE user_address (
"post_code" varchar(10) NOT NULL,
"country_id" int check ("country_id" > 0) NOT NULL DEFAULT 0,
"region_id" int check ("region_id" > 0) NOT NULL DEFAULT 0,
- "default_address" smallint check ("default_address" > 0) NOT NULL DEFAULT 0,
- "fields" text NOT NULL
+ "default_address" smallint check ("default_address" >= 0) NOT NULL DEFAULT 0,
+ "fields" text DEFAULT NULL
-- PRIMARY KEY("user_address_id")
);
diff --git a/install/sql/pgsql/schema/user/user_failed_login.sql b/install/sql/pgsql/schema/user/user_failed_login.sql
old mode 100644
new mode 100755
index 21a66ed..8f1e314
--- a/install/sql/pgsql/schema/user/user_failed_login.sql
+++ b/install/sql/pgsql/schema/user/user_failed_login.sql
@@ -2,8 +2,8 @@ DROP TABLE IF EXISTS "user_failed_login";
CREATE TABLE "user_failed_login" (
"user_id" int check ("user_id" > 0) NOT NULL,
- "count" int check ("count" > 0) NOT NULL DEFAULT 1,
- "last_ip" varchar(16) NOT NULL DEFAULT '',
+ "count" int check ("count" >= 0) DEFAULT 0,
+ "last_ip" varchar(45) NOT NULL DEFAULT '',
"updated_at" timestamp(0) NOT NULL DEFAULT now(),
PRIMARY KEY("user_id", "updated_at")
);
\ No newline at end of file
diff --git a/install/sql/pgsql/schema/user/user_points.sql b/install/sql/pgsql/schema/user/user_points.sql
index b015b04..ecb4eef 100755
--- a/install/sql/pgsql/schema/user/user_points.sql
+++ b/install/sql/pgsql/schema/user/user_points.sql
@@ -14,5 +14,7 @@ CREATE TABLE user_points (
-- PRIMARY KEY("user_points_id")
);
+CREATE INDEX "user_points_user_id" ON user_points ("user_id");
+CREATE INDEX "user_points_order_id" ON user_points ("order_id");
-- SELECT setval('user_points_user_points_id_seq', 0, true); -- last inserted id by sample data
\ No newline at end of file
diff --git a/install/sql/pgsql/schema/user/user_wishlist.sql b/install/sql/pgsql/schema/user/user_wishlist.sql
index cd77dce..8c07a7a 100755
--- a/install/sql/pgsql/schema/user/user_wishlist.sql
+++ b/install/sql/pgsql/schema/user/user_wishlist.sql
@@ -6,3 +6,5 @@ CREATE TABLE user_wishlist (
"created_at" timestamp(0) NOT NULL DEFAULT now(),
PRIMARY KEY("user_id","product_id")
);
+
+CREATE INDEX IF NOT EXISTS "user_wishlist_product" ON user_wishlist ("product_id");
diff --git a/install/sql/sqlite/menu.sql b/install/sql/sqlite/menu.sql
old mode 100644
new mode 100755
diff --git a/install/sql/sqlite/schema/admin/admin.sql b/install/sql/sqlite/schema/admin/admin.sql
index ca742b8..19d8510 100755
--- a/install/sql/sqlite/schema/admin/admin.sql
+++ b/install/sql/sqlite/schema/admin/admin.sql
@@ -15,7 +15,7 @@ CREATE TABLE `admin` (
`cover` TEXT NOT NULL DEFAULT '',
`bio` TEXT NOT NULL DEFAULT '',
`role_id` INT DEFAULT NULL,
-`site_access` INT NOT NULL DEFAULT '[]',
+`site_access` TEXT NOT NULL,
`status` INT NOT NULL DEFAULT '0',
`secret` TEXT NOT NULL DEFAULT '',
`token` TEXT NOT NULL DEFAULT '',
diff --git a/install/sql/sqlite/schema/admin/admin_auth_token.sql b/install/sql/sqlite/schema/admin/admin_auth_token.sql
old mode 100644
new mode 100755
index 2116b92..ce387d3
--- a/install/sql/sqlite/schema/admin/admin_auth_token.sql
+++ b/install/sql/sqlite/schema/admin/admin_auth_token.sql
@@ -9,4 +9,4 @@ CREATE TABLE `admin_auth_token` (
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
);
-CREATE INDEX `admin_auth_token_token` ON `admin` (`token`,`admin_id`);
\ No newline at end of file
+CREATE INDEX `admin_auth_token_token` ON `admin_auth_token` (`token`,`admin_id`);
\ No newline at end of file
diff --git a/install/sql/sqlite/schema/admin/admin_failed_login.sql b/install/sql/sqlite/schema/admin/admin_failed_login.sql
old mode 100644
new mode 100755
diff --git a/install/sql/sqlite/schema/admin/admin_password_resets.sql b/install/sql/sqlite/schema/admin/admin_password_resets.sql
index bb9d6ef..f2669e0 100755
--- a/install/sql/sqlite/schema/admin/admin_password_resets.sql
+++ b/install/sql/sqlite/schema/admin/admin_password_resets.sql
@@ -3,5 +3,7 @@ DROP TABLE IF EXISTS `admin_password_resets`;
CREATE TABLE `admin_password_resets` (
`email` TEXT NOT NULL,
`token` TEXT NOT NULL,
-`created_at` timestamp NULL DEFAULT NULL
+`created_at` timestamp NULL DEFAULT NULL,
+PRIMARY KEY (`email`,`token`)
);
+
diff --git a/install/sql/sqlite/schema/attribute/attribute_content.sql b/install/sql/sqlite/schema/attribute/attribute_content.sql
index 2ce0e57..918521e 100755
--- a/install/sql/sqlite/schema/attribute/attribute_content.sql
+++ b/install/sql/sqlite/schema/attribute/attribute_content.sql
@@ -1,7 +1,7 @@
DROP TABLE IF EXISTS `attribute_content`;
CREATE TABLE `attribute_content` (
- `attribute_id` INTEGER,
+ `attribute_id` INTEGER NOT NULL,
`language_id` INT NOT NULL,
`name` TEXT NOT NULL,
PRIMARY KEY (`attribute_id`,`language_id`)
diff --git a/install/sql/sqlite/schema/cart/cart.sql b/install/sql/sqlite/schema/cart/cart.sql
old mode 100644
new mode 100755
index 1531759..1789349
--- a/install/sql/sqlite/schema/cart/cart.sql
+++ b/install/sql/sqlite/schema/cart/cart.sql
@@ -11,3 +11,4 @@ CREATE TABLE `cart` (
);
CREATE INDEX `cart_user_id` ON `cart` (`user_id`);
+CREATE INDEX `cart_session_id` ON `cart` (`session_id`);
diff --git a/install/sql/sqlite/schema/cart/coupon.sql b/install/sql/sqlite/schema/cart/coupon.sql
index 7260ad8..b2f40d4 100755
--- a/install/sql/sqlite/schema/cart/coupon.sql
+++ b/install/sql/sqlite/schema/cart/coupon.sql
@@ -12,8 +12,8 @@ CREATE TABLE `coupon` (
`logged_in` TINYINT NOT NULL,
`free_shipping` TINYINT NOT NULL,
`status` TINYINT NOT NULL,
-`from_date` date NOT NULL DEFAULT '1000-01-01',
-`to_date` date NOT NULL DEFAULT '1000-01-01',
+`from_date` date,
+`to_date` date,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
-- PRIMARY KEY (`coupon_id`)
diff --git a/install/sql/sqlite/schema/cart/coupon_log.sql b/install/sql/sqlite/schema/cart/coupon_log.sql
index 43145c1..1b8c5a4 100755
--- a/install/sql/sqlite/schema/cart/coupon_log.sql
+++ b/install/sql/sqlite/schema/cart/coupon_log.sql
@@ -9,3 +9,7 @@ CREATE TABLE `coupon_log` (
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
--PRIMARY KEY (`coupon_log_id`)
);
+
+CREATE INDEX `coupon_log_coupon_id` ON `coupon_log` (`coupon_id`);
+CREATE INDEX `coupon_log_order_id` ON `coupon_log` (`order_id`);
+CREATE INDEX `coupon_log_user_id` ON `coupon_log` (`user_id`);
diff --git a/install/sql/sqlite/schema/cart/coupon_product.sql b/install/sql/sqlite/schema/cart/coupon_product.sql
index c400b83..0d3ed2b 100755
--- a/install/sql/sqlite/schema/cart/coupon_product.sql
+++ b/install/sql/sqlite/schema/cart/coupon_product.sql
@@ -7,6 +7,9 @@ CREATE TABLE `coupon_product` (
-- PRIMARY KEY (`coupon_product_id`)
);
+CREATE INDEX `coupon_product_coupon_id` ON `coupon_product` (`coupon_id`);
+CREATE INDEX `coupon_product_product_id` ON `coupon_product` (`product_id`);
+
diff --git a/install/sql/sqlite/schema/checkout/voucher.sql b/install/sql/sqlite/schema/checkout/voucher.sql
index 4c140f0..3e0ee20 100755
--- a/install/sql/sqlite/schema/checkout/voucher.sql
+++ b/install/sql/sqlite/schema/checkout/voucher.sql
@@ -13,4 +13,6 @@ CREATE TABLE `voucher` (
`status` TINYINT NOT NULL,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
-- PRIMARY KEY (`voucher_id`)
-);
\ No newline at end of file
+);
+
+CREATE INDEX `voucher_order_id` ON `voucher` (`order_id`);
\ No newline at end of file
diff --git a/install/sql/sqlite/schema/checkout/voucher_log.sql b/install/sql/sqlite/schema/checkout/voucher_log.sql
index c644e42..5cef5ae 100755
--- a/install/sql/sqlite/schema/checkout/voucher_log.sql
+++ b/install/sql/sqlite/schema/checkout/voucher_log.sql
@@ -8,3 +8,6 @@ CREATE TABLE `voucher_log` (
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
-- PRIMARY KEY (`voucher_log_id`)
);
+
+CREATE INDEX `voucher_log_voucher_id` ON `voucher_log` (`voucher_id`);
+CREATE INDEX `voucher_log_order_id` ON `voucher_log` (`order_id`);
diff --git a/install/sql/sqlite/schema/fields/field.sql b/install/sql/sqlite/schema/fields/field.sql
index f3dc15d..110e499 100755
--- a/install/sql/sqlite/schema/fields/field.sql
+++ b/install/sql/sqlite/schema/fields/field.sql
@@ -4,7 +4,7 @@ CREATE TABLE `field` (
`field_id` INTEGER PRIMARY KEY AUTOINCREMENT,
`field_group_id` INT NOT NULL,
`type` TEXT NOT NULL,
-`default` TEXT NOT NULL,
+`default` TEXT NOT NULL DEFAULT '',
`settings` TEXT NOT NULL,
`validation` TEXT NOT NULL,
`presentation` TEXT NOT NULL,
diff --git a/install/sql/sqlite/schema/fields/field_content.sql b/install/sql/sqlite/schema/fields/field_content.sql
index 912e4ce..cdff93e 100755
--- a/install/sql/sqlite/schema/fields/field_content.sql
+++ b/install/sql/sqlite/schema/fields/field_content.sql
@@ -3,7 +3,8 @@ DROP TABLE IF EXISTS `field_content`;
CREATE TABLE `field_content` (
`field_id` int NOT NULL,
`language_id` int NOT NULL,
-`name` TEXT NOT NULL
+`name` TEXT NOT NULL,
+`label` TEXT NOT NULL
-- PRIMARY KEY (`field_id`,`language_id`)
);
diff --git a/install/sql/sqlite/schema/fields/field_group.sql b/install/sql/sqlite/schema/fields/field_group.sql
index db47db4..f5e8dc4 100755
--- a/install/sql/sqlite/schema/fields/field_group.sql
+++ b/install/sql/sqlite/schema/fields/field_group.sql
@@ -3,8 +3,9 @@ DROP TABLE IF EXISTS `field_group`;
CREATE TABLE `field_group` (
`field_group_id` INTEGER PRIMARY KEY AUTOINCREMENT,
`type` TEXT NOT NULL DEFAULT 'post',
-`subtype` TEXT NOT NULL DEFAULT 'post',
+`subtype` TEXT NOT NULL DEFAULT 'page',
+`conditions` TEXT,
`status` INT NOT NULL DEFAULT 0,
-`sort_order` INT NOT NULL NOT NULL DEFAULT 0
+`sort_order` INT NOT NULL DEFAULT 0
--PRIMARY KEY (`field_group_id`)
);
diff --git a/install/sql/sqlite/schema/fields/field_value.sql b/install/sql/sqlite/schema/fields/field_value.sql
index 38473f2..416cb5e 100755
--- a/install/sql/sqlite/schema/fields/field_value.sql
+++ b/install/sql/sqlite/schema/fields/field_value.sql
@@ -1,10 +1,9 @@
DROP TABLE IF EXISTS `field_value`;
CREATE TABLE `field_value` (
+`field_value_id` INTEGER PRIMARY KEY AUTOINCREMENT,
`field_id` INTEGER NOT NULL,
-`value` TEXT NOT NULL,
`sort_order` INTEGER NOT NULL DEFAULT 0
--- PRIMARY KEY (`field_value_id`)
);
CREATE INDEX `field_value_field_id` ON `field_value` (`field_id`);
diff --git a/install/sql/sqlite/schema/fields/order_field_value.sql b/install/sql/sqlite/schema/fields/order_field_value.sql
old mode 100644
new mode 100755
index b7d6339..9678a10
--- a/install/sql/sqlite/schema/fields/order_field_value.sql
+++ b/install/sql/sqlite/schema/fields/order_field_value.sql
@@ -1,11 +1,13 @@
DROP TABLE IF EXISTS `order_field_value`;
CREATE TABLE `order_field_value` (
+`order_field_value_id` INTEGER PRIMARY KEY AUTOINCREMENT,
+`language_id` INT NOT NULL,
`order_id` INTEGER NOT NULL,
`field_id` INTEGER NOT NULL,
-`language_id` INT NOT NULL,
-`value` TEXT NOT NULL
--- PRIMARY KEY (`field_value_id`)
+`sort_order` INTEGER NOT NULL DEFAULT 0
);
-CREATE INDEX `order_field_valuefield_id_language_id` ON `order_field_value` (`order_id`,`field_id`,`language_id`);
+CREATE INDEX `order_field_value_field_id_language_id` ON `order_field_value` (`order_id`,`field_id`,`language_id`);
+
+CREATE INDEX IF NOT EXISTS `order_field_value_field` ON `order_field_value` (`field_id`);
diff --git a/install/sql/sqlite/schema/fields/post_field_value.sql b/install/sql/sqlite/schema/fields/post_field_value.sql
old mode 100644
new mode 100755
index 3f71747..93b709e
--- a/install/sql/sqlite/schema/fields/post_field_value.sql
+++ b/install/sql/sqlite/schema/fields/post_field_value.sql
@@ -4,8 +4,8 @@ CREATE TABLE `post_field_value` (
`post_id` INTEGER NOT NULL,
`field_id` INTEGER NOT NULL,
`language_id` INT NOT NULL,
-`value` TEXT NOT NULL
--- PRIMARY KEY (`field_value_id`)
+`value` TEXT NOT NULL,
+PRIMARY KEY (`post_id`,`field_id`,`language_id`)
);
-CREATE INDEX `post_field_valuefield_id_language_id` ON `post_field_value` (`post_id`,`field_id`,`language_id`);
+CREATE INDEX IF NOT EXISTS `post_field_value_field` ON `post_field_value` (`field_id`);
diff --git a/install/sql/sqlite/schema/fields/product_field_value.sql b/install/sql/sqlite/schema/fields/product_field_value.sql
old mode 100644
new mode 100755
index 56d040e..7725d34
--- a/install/sql/sqlite/schema/fields/product_field_value.sql
+++ b/install/sql/sqlite/schema/fields/product_field_value.sql
@@ -6,7 +6,8 @@ CREATE TABLE `product_field_value` (
`product_id` INTEGER NOT NULL,
`language_id` INT NOT NULL,
`value` TEXT NOT NULL
--- PRIMARY KEY (`field_value_id`)
);
CREATE INDEX `product_field_valuefield_id_language_id` ON `product_field_value` (`product_id`,`field_id`,`language_id`);
+
+CREATE INDEX IF NOT EXISTS `product_field_value_field` ON `product_field_value` (`field_id`);
diff --git a/install/sql/sqlite/schema/fields/taxonomy_item_field_value.sql b/install/sql/sqlite/schema/fields/taxonomy_item_field_value.sql
old mode 100644
new mode 100755
index e77a03e..19a875e
--- a/install/sql/sqlite/schema/fields/taxonomy_item_field_value.sql
+++ b/install/sql/sqlite/schema/fields/taxonomy_item_field_value.sql
@@ -1,11 +1,13 @@
DROP TABLE IF EXISTS `taxonomy_item_field_value`;
CREATE TABLE `taxonomy_item_field_value` (
+`taxonomy_item_field_value_id` INTEGER PRIMARY KEY AUTOINCREMENT,
+`language_id` INT NOT NULL,
`taxonomy_item_id` INTEGER NOT NULL,
`field_id` INTEGER NOT NULL,
-`language_id` INT NOT NULL,
-`value` TEXT NOT NULL
--- PRIMARY KEY (`field_value_id`)
+`sort_order` INTEGER NOT NULL DEFAULT 0
);
-CREATE INDEX `taxonomy_item_field_valuefield_id_language_id` ON `taxonomy_item_field_value` (`taxonomy_item_id`,`field_id`,`language_id`);
+CREATE INDEX `taxonomy_item_field_value_field_id_language_id` ON `taxonomy_item_field_value` (`taxonomy_item_id`,`field_id`,`language_id`);
+
+CREATE INDEX IF NOT EXISTS `taxonomy_item_field_value_field` ON `taxonomy_item_field_value` (`field_id`);
diff --git a/install/sql/sqlite/schema/fields/user_field_value.sql b/install/sql/sqlite/schema/fields/user_field_value.sql
old mode 100644
new mode 100755
index c13a9e8..30ad548
--- a/install/sql/sqlite/schema/fields/user_field_value.sql
+++ b/install/sql/sqlite/schema/fields/user_field_value.sql
@@ -1,11 +1,13 @@
DROP TABLE IF EXISTS `user_field_value`;
CREATE TABLE `user_field_value` (
+`user_field_value_id` INTEGER PRIMARY KEY AUTOINCREMENT,
+`language_id` INT NOT NULL,
`user_id` INTEGER NOT NULL,
`field_id` INTEGER NOT NULL,
-`language_id` INT NOT NULL,
-`value` TEXT NOT NULL
--- PRIMARY KEY (`field_value_id`)
+`sort_order` INTEGER NOT NULL DEFAULT 0
);
-CREATE INDEX `user_field_valuefield_id_language_id` ON `user_field_value` (`user_id`,`field_id`,`language_id`);
+CREATE INDEX `user_field_value_field_id_language_id` ON `user_field_value` (`user_id`,`field_id`,`language_id`);
+
+CREATE INDEX IF NOT EXISTS `user_field_value_field` ON `user_field_value` (`field_id`);
diff --git a/install/sql/sqlite/schema/geoip/country.sql b/install/sql/sqlite/schema/geoip/country.sql
index 768b357..e981eff 100755
--- a/install/sql/sqlite/schema/geoip/country.sql
+++ b/install/sql/sqlite/schema/geoip/country.sql
@@ -4,8 +4,8 @@ CREATE TABLE `country` (
`country_id` INTEGER PRIMARY KEY AUTOINCREMENT,
`name` TEXT NOT NULL,
`iso_code_2` TEXT NOT NULL,
-`iso_code_3` TEXT NOT NULL,
-`status` TINYINT NOT NULL DEFAULT '1'
+`iso_code_3` VARCHAR(10) NOT NULL,
+`status` TINYINT NOT NULL DEFAULT 0
-- PRIMARY KEY (`country_id`)
);
diff --git a/install/sql/sqlite/schema/geoip/region.sql b/install/sql/sqlite/schema/geoip/region.sql
index f8c624c..4babef0 100755
--- a/install/sql/sqlite/schema/geoip/region.sql
+++ b/install/sql/sqlite/schema/geoip/region.sql
@@ -8,3 +8,5 @@ CREATE TABLE `region` (
`status` TINYINT NOT NULL DEFAULT '1'
-- PRIMARY KEY (`region_id`)
);
+
+CREATE INDEX `region_country_id` ON `region` (`country_id`);
diff --git a/install/sql/sqlite/schema/geoip/region_group.sql b/install/sql/sqlite/schema/geoip/region_group.sql
index 64093f0..c071078 100755
--- a/install/sql/sqlite/schema/geoip/region_group.sql
+++ b/install/sql/sqlite/schema/geoip/region_group.sql
@@ -3,7 +3,7 @@ DROP TABLE IF EXISTS `region_group`;
CREATE TABLE `region_group` (
`region_group_id` INTEGER PRIMARY KEY AUTOINCREMENT,
`name` TEXT NOT NULL,
-`content` TEXT NOT NULL,
-`created_at` datetime NOT NULL
+`content` TEXT NOT NULL DEFAULT '',
+`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
-- PRIMARY KEY (`region_group_id`)
);
diff --git a/install/sql/sqlite/schema/geoip/region_to_region_group.sql b/install/sql/sqlite/schema/geoip/region_to_region_group.sql
index b5bb5ef..cd7dda5 100755
--- a/install/sql/sqlite/schema/geoip/region_to_region_group.sql
+++ b/install/sql/sqlite/schema/geoip/region_to_region_group.sql
@@ -7,4 +7,8 @@ CREATE TABLE `region_to_region_group` (
`region_group_id` INT UNSIGNED NOT NULL,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
-- PRIMARY KEY (`region_to_region_group_id`)
-);
\ No newline at end of file
+);
+
+CREATE INDEX `region_to_region_group_country_id` ON `region_to_region_group` (`country_id`);
+CREATE INDEX `region_to_region_group_region_id` ON `region_to_region_group` (`region_id`);
+CREATE INDEX `region_to_region_group_region_group_id` ON `region_to_region_group` (`region_group_id`);
\ No newline at end of file
diff --git a/install/sql/sqlite/schema/localisation/currency.sql b/install/sql/sqlite/schema/localisation/currency.sql
index 33cb56d..17a1cea 100755
--- a/install/sql/sqlite/schema/localisation/currency.sql
+++ b/install/sql/sqlite/schema/localisation/currency.sql
@@ -4,11 +4,11 @@ CREATE TABLE `currency` (
`currency_id` INTEGER PRIMARY KEY AUTOINCREMENT,
`name` TEXT NOT NULL,
`code` TEXT NOT NULL,
-`value` double(15,8) NOT NULL,
-`sign_start` TEXT NOT NULL,
-`sign_end` TEXT NOT NULL,
-`decimal_place` char(1) NOT NULL,
-`status` TINYINT NOT NULL,
+`value` double(15,8) NOT NULL DEFAULT 1,
+`sign_start` TEXT NOT NULL DEFAULT '',
+`sign_end` TEXT NOT NULL DEFAULT '',
+`decimal_place` INTEGER NOT NULL DEFAULT 2,
+`status` TINYINT NOT NULL DEFAULT 0,
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
-- PRIMARY KEY (`currency_id`)
);
diff --git a/install/sql/sqlite/schema/localisation/language.sql b/install/sql/sqlite/schema/localisation/language.sql
index 3b54de4..99f3d47 100755
--- a/install/sql/sqlite/schema/localisation/language.sql
+++ b/install/sql/sqlite/schema/localisation/language.sql
@@ -8,7 +8,7 @@ CREATE TABLE `language` (
`slug` TEXT NOT NULL,
`rtl` TINYINT NOT NULL DEFAULT 0,
`sort_order` INTEGER NOT NULL DEFAULT 0,
-`status` TINYINT NOT NULL,
+`status` TINYINT NOT NULL DEFAULT 0,
`default` TINYINT NOT NULL DEFAULT 0
-- PRIMARY KEY (`language_id`)
);
diff --git a/install/sql/sqlite/schema/media/media.sql b/install/sql/sqlite/schema/media/media.sql
old mode 100644
new mode 100755
diff --git a/install/sql/sqlite/schema/media/media_content.sql b/install/sql/sqlite/schema/media/media_content.sql
old mode 100644
new mode 100755
diff --git a/install/sql/sqlite/schema/menu/menu.sql b/install/sql/sqlite/schema/menu/menu.sql
index 938ee63..ef1b6d2 100755
--- a/install/sql/sqlite/schema/menu/menu.sql
+++ b/install/sql/sqlite/schema/menu/menu.sql
@@ -7,4 +7,3 @@ CREATE TABLE `menu` (
-- PRIMARY KEY (`menu_id`)
);
-CREATE INDEX `menu_menu_id` ON `menu` (`menu_id`);
diff --git a/install/sql/sqlite/schema/menu/menu_item.sql b/install/sql/sqlite/schema/menu/menu_item.sql
index 2228ab5..25347a8 100755
--- a/install/sql/sqlite/schema/menu/menu_item.sql
+++ b/install/sql/sqlite/schema/menu/menu_item.sql
@@ -14,3 +14,4 @@ CREATE TABLE `menu_item` (
);
CREATE INDEX `menu_item_parent_id` ON `menu_item` (`parent_id`);
+CREATE INDEX `menu_item_menu_id` ON `menu_item` (`menu_id`);
diff --git a/install/sql/sqlite/schema/menu/menu_item_content.sql b/install/sql/sqlite/schema/menu/menu_item_content.sql
index 8365a7f..a813678 100755
--- a/install/sql/sqlite/schema/menu/menu_item_content.sql
+++ b/install/sql/sqlite/schema/menu/menu_item_content.sql
@@ -4,7 +4,7 @@ CREATE TABLE `menu_item_content` (
`menu_item_id` INT NOT NULL,
`language_id` INT NOT NULL,
`name` TEXT NOT NULL DEFAULT '',
-`slug` TEXT DEFAULT '',
+`slug` TEXT NOT NULL DEFAULT '',
`content` text NOT NULL,
PRIMARY KEY (`menu_item_id`,`language_id`)
);
diff --git a/install/sql/sqlite/schema/menu/menu_to_site.sql b/install/sql/sqlite/schema/menu/menu_to_site.sql
index 9af30ad..e219783 100755
--- a/install/sql/sqlite/schema/menu/menu_to_site.sql
+++ b/install/sql/sqlite/schema/menu/menu_to_site.sql
@@ -5,3 +5,5 @@ CREATE TABLE `menu_to_site` (
`site_id` TINYINT NOT NULL,
PRIMARY KEY (`menu_id`,`site_id`)
);
+
+CREATE INDEX IF NOT EXISTS `menu_to_site_site` ON `menu_to_site` (`site_id`);
diff --git a/install/sql/sqlite/schema/message.sql b/install/sql/sqlite/schema/message.sql
deleted file mode 100755
index bb16b62..0000000
--- a/install/sql/sqlite/schema/message.sql
+++ /dev/null
@@ -1,14 +0,0 @@
-DROP TABLE IF EXISTS `message`;
-
-CREATE TABLE IF NOT EXISTS `message` (
-`message_id` INTEGER PRIMARY KEY AUTOINCREMENT,
-`type` TEXT NOT NULL DEFAULT 'publish',
-`data` TEXT NOT NULL DEFAULT '',
-`meta` TEXT NOT NULL DEFAULT '',
-`status` TINYINT NOT NULL DEFAULT '0', -- unread = 0, read = 1
-`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
-`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
--- KEY `type_status_date` (`status`, `type`,`created_at`,`message_id`)
-);
-
-CREATE INDEX `message_status_type_date` ON `message` (`status`, `type`,`created_at`,`message_id`);
diff --git a/install/sql/sqlite/schema/option/option_value_content.sql b/install/sql/sqlite/schema/option/option_value_content.sql
index 3fdc1f2..31d05c7 100755
--- a/install/sql/sqlite/schema/option/option_value_content.sql
+++ b/install/sql/sqlite/schema/option/option_value_content.sql
@@ -6,4 +6,6 @@ CREATE TABLE `option_value_content` (
`option_id` INT NOT NULL,
`name` TEXT NOT NULL,
PRIMARY KEY (`option_value_id`,`language_id`)
-);
\ No newline at end of file
+);
+
+CREATE INDEX `option_value_content_option_id_language_id` ON `option_value_content` (`option_id`, `language_id`);
\ No newline at end of file
diff --git a/install/sql/sqlite/schema/option/product_option.sql b/install/sql/sqlite/schema/option/product_option.sql
index 15724b1..9b8b455 100755
--- a/install/sql/sqlite/schema/option/product_option.sql
+++ b/install/sql/sqlite/schema/option/product_option.sql
@@ -5,6 +5,10 @@ CREATE TABLE `product_option` (
`product_id` INT UNSIGNED NOT NULL,
`option_id` INT UNSIGNED NOT NULL,
`value` TEXT NOT NULL,
+ `sort_order` INT NOT NULL DEFAULT 0,
`required` INT NOT NULL DEFAULT 0
-- PRIMARY KEY (`product_option_id`)
);
+
+CREATE INDEX `product_option_product_id` ON `product_option` (`product_id`);
+CREATE INDEX `product_option_option_id` ON `product_option` (`option_id`);
diff --git a/install/sql/sqlite/schema/option/product_option_value.sql b/install/sql/sqlite/schema/option/product_option_value.sql
index 83506f2..950f2ae 100755
--- a/install/sql/sqlite/schema/option/product_option_value.sql
+++ b/install/sql/sqlite/schema/option/product_option_value.sql
@@ -13,6 +13,12 @@ CREATE TABLE `product_option_value` (
`points_operator` TEXT NOT NULL DEFAULT '+',
`points` INT NOT NULL DEFAULT 0,
`weight_operator` TEXT NOT NULL DEFAULT '+',
-`weight` decimal(15,8) NOT NULL DEFAULT 0
+`weight` decimal(15,8) NOT NULL DEFAULT 0,
+`width_operator` TEXT NOT NULL DEFAULT '+',
+`width` decimal(15,8) NOT NULL DEFAULT 0,
+`height_operator` TEXT NOT NULL DEFAULT '+',
+`height` decimal(15,8) NOT NULL DEFAULT 0,
+`length_operator` TEXT NOT NULL DEFAULT '+',
+`length` decimal(15,8) NOT NULL DEFAULT 0
-- PRIMARY KEY (`product_option_value_id`)
);
diff --git a/install/sql/sqlite/schema/order/order.sql b/install/sql/sqlite/schema/order/order.sql
index 8afc78e..46dc8b4 100755
--- a/install/sql/sqlite/schema/order/order.sql
+++ b/install/sql/sqlite/schema/order/order.sql
@@ -19,14 +19,12 @@ CREATE TABLE `order` (
`billing_company` TEXT NOT NULL DEFAULT '',
`billing_address_1` TEXT NOT NULL,
`billing_address_2` TEXT NOT NULL DEFAULT '',
---`billing_city` TEXT NOT NULL NULL DEFAULT '',,
-`billing_post_code` TEXT NOT NULL NOT NULL DEFAULT '',
+`billing_city` TEXT NOT NULL DEFAULT '',
+`billing_post_code` TEXT NOT NULL DEFAULT '',
`billing_country` TEXT NOT NULL DEFAULT '',
`billing_country_id` INT NOT NULL,
---`billing_region` TEXT NOT NULL,
+`billing_region` TEXT NOT NULL DEFAULT '',
`billing_region_id` INT NOT NULL,
-`billing_address_format` text NOT NULL DEFAULT '',
-`billing_fields` text NOT NULL DEFAULT '',
`payment_method` text NOT NULL DEFAULT '',
`payment_data` text,
`payment_status_id` INT NOT NULL DEFAULT '1',
@@ -37,25 +35,23 @@ CREATE TABLE `order` (
`shipping_address_2` TEXT NOT NULL DEFAULT '',
`shipping_city` TEXT NOT NULL DEFAULT '',
`shipping_post_code` TEXT NOT NULL DEFAULT '',
-`shipping_country` TEXT NOT NULL NULL DEFAULT '',
+`shipping_country` TEXT NOT NULL DEFAULT '',
`shipping_country_id` INT NOT NULL DEFAULT 0,
-`shipping_region` TEXT NOT NULL NULL DEFAULT '',
+`shipping_region` TEXT NOT NULL DEFAULT '',
`shipping_region_id` INT NOT NULL DEFAULT 0,
-`shipping_address_format` text NOT NULL NULL DEFAULT '',
-`shipping_fields` text NOT NULL NULL DEFAULT '',
`shipping_method` TEXT NOT NULL DEFAULT '',
-`shipping_data` TEXT NOT NULL NULL DEFAULT '',
+`shipping_data` TEXT NOT NULL DEFAULT '',
`shipping_status_id` INT NOT NULL DEFAULT '1',
`total` decimal(15,4) NOT NULL DEFAULT '0.0000',
`order_status_id` INT NOT NULL DEFAULT '0',
`language_id` INT NOT NULL,
`currency_id` INT NOT NULL,
-`currency` TEXT NOT NULL NULL DEFAULT '',
+`currency` TEXT NOT NULL DEFAULT '',
`currency_value` decimal(15,8) NOT NULL DEFAULT '1.00000000',
-`notes` text NOT NULL NULL DEFAULT '',
+`notes` text NOT NULL DEFAULT '',
`remote_ip` TEXT NOT NULL DEFAULT '',
-`forwarded_for_ip` TEXT NOT NULL NULL DEFAULT '',
-`accept_language` TEXT NOT NULL NULL DEFAULT '',
+`forwarded_for_ip` TEXT NOT NULL DEFAULT '',
+`user_agent` TEXT NOT NULL DEFAULT '',
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
-- PRIMARY KEY (`order_id`)
diff --git a/install/sql/sqlite/schema/order/order_log.sql b/install/sql/sqlite/schema/order/order_log.sql
index 3349caf..df4bf9a 100755
--- a/install/sql/sqlite/schema/order/order_log.sql
+++ b/install/sql/sqlite/schema/order/order_log.sql
@@ -10,3 +10,5 @@ CREATE TABLE `order_log` (
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
-- PRIMARY KEY (`order_log_id`)
);
+
+CREATE INDEX `order_log_order_id` ON `order_log` (`order_id`);
diff --git a/install/sql/sqlite/schema/order/order_meta.sql b/install/sql/sqlite/schema/order/order_meta.sql
index 2062010..0904596 100755
--- a/install/sql/sqlite/schema/order/order_meta.sql
+++ b/install/sql/sqlite/schema/order/order_meta.sql
@@ -4,8 +4,6 @@ CREATE TABLE `order_meta` (
`order_id` INT NOT NULL,
`namespace` TEXT NOT NULL DEFAULT '',
`key` TEXT NOT NULL,
- `value` TEXT
- -- PRIMARY KEY (`meta_id`)
+ `value` TEXT,
+ PRIMARY KEY (`order_id`,`namespace`,`key`)
);
-
-CREATE UNIQUE INDEX `order_meta_order_id` ON `order_meta` (`order_id`, `namespace`, `key`);
diff --git a/install/sql/sqlite/schema/order/order_product.sql b/install/sql/sqlite/schema/order/order_product.sql
index 082758e..5c0a39a 100755
--- a/install/sql/sqlite/schema/order/order_product.sql
+++ b/install/sql/sqlite/schema/order/order_product.sql
@@ -15,3 +15,4 @@ CREATE TABLE `order_product` (
);
CREATE INDEX `order_product_order_id` ON `order_product` (`order_id`);
+CREATE INDEX `order_product_product_id` ON `order_product` (`product_id`);
diff --git a/install/sql/sqlite/schema/order/order_product_option.sql b/install/sql/sqlite/schema/order/order_product_option.sql
index 48555e1..5ae418e 100755
--- a/install/sql/sqlite/schema/order/order_product_option.sql
+++ b/install/sql/sqlite/schema/order/order_product_option.sql
@@ -11,4 +11,7 @@ CREATE TABLE `order_product_option` (
`price` decimal(15,4) NOT NULL DEFAULT '0.0000',
`type` TEXT NOT NULL DEFAULT ''
-- PRIMARY KEY (`order_product_option_id`)
-);
\ No newline at end of file
+);
+
+CREATE INDEX `order_product_option_order_id` ON `order_product_option` (`order_id`);
+CREATE INDEX `order_product_option_order_product_id` ON `order_product_option` (`order_product_id`);
\ No newline at end of file
diff --git a/install/sql/sqlite/schema/order/order_shipment.sql b/install/sql/sqlite/schema/order/order_shipment.sql
index 9656382..e02cdef 100755
--- a/install/sql/sqlite/schema/order/order_shipment.sql
+++ b/install/sql/sqlite/schema/order/order_shipment.sql
@@ -8,3 +8,5 @@ CREATE TABLE `order_shipment` (
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
-- PRIMARY KEY (`order_shipment_id`)
);
+
+CREATE INDEX `order_shipment_order_id` ON `order_shipment` (`order_id`);
diff --git a/install/sql/sqlite/schema/order/order_total.sql b/install/sql/sqlite/schema/order/order_total.sql
index 7a1e93f..0830f53 100755
--- a/install/sql/sqlite/schema/order/order_total.sql
+++ b/install/sql/sqlite/schema/order/order_total.sql
@@ -1,7 +1,7 @@
DROP TABLE IF EXISTS `order_total`;
CREATE TABLE `order_total` (
-`order_total_id`INTEGER PRIMARY KEY AUTOINCREMENT,
+`order_total_id` INTEGER PRIMARY KEY AUTOINCREMENT,
`order_id` INT NOT NULL,
`key` TEXT NOT NULL DEFAULT '',
`title` TEXT NOT NULL,
diff --git a/install/sql/sqlite/schema/order/order_transaction.sql b/install/sql/sqlite/schema/order/order_transaction.sql
new file mode 100755
index 0000000..380739d
--- /dev/null
+++ b/install/sql/sqlite/schema/order/order_transaction.sql
@@ -0,0 +1,18 @@
+DROP TABLE IF EXISTS `order_transaction`;
+
+CREATE TABLE `order_transaction` (
+`order_transaction_id` INTEGER PRIMARY KEY AUTOINCREMENT,
+`order_id` INT NOT NULL,
+`kind` TEXT NOT NULL DEFAULT '',
+`gateway` TEXT NOT NULL DEFAULT '',
+`reference` TEXT NOT NULL DEFAULT '',
+`amount` decimal(15,4) NOT NULL DEFAULT '0.0000',
+`tax_amount` decimal(15,4) NOT NULL DEFAULT '0.0000',
+`currency` TEXT NOT NULL DEFAULT '',
+`status` TEXT NOT NULL DEFAULT '',
+`note` TEXT,
+`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
+-- PRIMARY KEY (`order_transaction_id`)
+);
+
+CREATE INDEX `order_transaction_order_id` ON `order_transaction` (`order_id`);
diff --git a/install/sql/sqlite/schema/order/order_voucher.sql b/install/sql/sqlite/schema/order/order_voucher.sql
index af2213e..4cd0719 100755
--- a/install/sql/sqlite/schema/order/order_voucher.sql
+++ b/install/sql/sqlite/schema/order/order_voucher.sql
@@ -14,3 +14,6 @@ CREATE TABLE `order_voucher` (
`amount` decimal(15,4) NOT NULL
-- PRIMARY KEY (`order_voucher_id`)
);
+
+CREATE INDEX `order_voucher_order_id` ON `order_voucher` (`order_id`);
+CREATE INDEX `order_voucher_voucher_id` ON `order_voucher` (`voucher_id`);
diff --git a/install/sql/sqlite/schema/order/payment_status.sql b/install/sql/sqlite/schema/order/payment_status.sql
old mode 100644
new mode 100755
diff --git a/install/sql/sqlite/schema/order/return.sql b/install/sql/sqlite/schema/order/return.sql
index 419488a..8cc00fb 100755
--- a/install/sql/sqlite/schema/order/return.sql
+++ b/install/sql/sqlite/schema/order/return.sql
@@ -14,7 +14,7 @@ CREATE TABLE `return` (
`model` TEXT NOT NULL,
`quantity` INTEGER NOT NULL,
`opened` TINYINT NOT NULL,
-`return_reason_id` INT NOT NULL,
+`return_reason_id` INT NOT NULL DEFAULT 0,
`return_resolution_id` INT NOT NULL DEFAULT 0,
`return_status_id` INT NOT NULL DEFAULT 0,
`note` text NOT NULL,
@@ -24,3 +24,7 @@ CREATE TABLE `return` (
-- PRIMARY KEY (`return_id`)
);
+CREATE INDEX `return_order_id` ON `return` (`order_id`);
+CREATE INDEX `return_product_id` ON `return` (`product_id`);
+CREATE INDEX `return_user_id` ON `return` (`user_id`);
+
diff --git a/install/sql/sqlite/schema/order/return_log.sql b/install/sql/sqlite/schema/order/return_log.sql
index 37a68f3..30f63a6 100755
--- a/install/sql/sqlite/schema/order/return_log.sql
+++ b/install/sql/sqlite/schema/order/return_log.sql
@@ -9,3 +9,5 @@ CREATE TABLE `return_log` (
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
-- PRIMARY KEY (`return_log_id`)
);
+
+CREATE INDEX `return_log_return_id` ON `return_log` (`return_id`);
diff --git a/install/sql/sqlite/schema/order/shipping_status.sql b/install/sql/sqlite/schema/order/shipping_status.sql
old mode 100644
new mode 100755
diff --git a/install/sql/sqlite/schema/order/warehouse.sql b/install/sql/sqlite/schema/order/warehouse.sql
new file mode 100755
index 0000000..6ee38bf
--- /dev/null
+++ b/install/sql/sqlite/schema/order/warehouse.sql
@@ -0,0 +1,21 @@
+DROP TABLE IF EXISTS `warehouse`;
+
+CREATE TABLE `warehouse` (
+ `warehouse_id` INTEGER PRIMARY KEY AUTOINCREMENT,
+ `name` TEXT NOT NULL DEFAULT '',
+ `country_id` INT NOT NULL DEFAULT 0,
+ `region_id` INT NOT NULL DEFAULT 0,
+ `city` TEXT NOT NULL DEFAULT '',
+ `postal_code` TEXT NOT NULL DEFAULT '',
+ `address_1` TEXT NOT NULL DEFAULT '',
+ `status` tinyint NOT NULL DEFAULT 1,
+ `sort_order` int(3) NOT NULL DEFAULT 0
+-- PRIMARY KEY (`warehouse_id`)
+);
+DROP TABLE IF EXISTS `product_warehouse`;
+
+CREATE TABLE `product_warehouse` (
+ `product_id` INT NOT NULL,
+ `warehouse_id` INT NOT NULL,
+ PRIMARY KEY (`product_id`,`warehouse_id`)
+);
diff --git a/install/sql/sqlite/schema/plugin/message.sql b/install/sql/sqlite/schema/plugin/message.sql
index bb16b62..919b12f 100755
--- a/install/sql/sqlite/schema/plugin/message.sql
+++ b/install/sql/sqlite/schema/plugin/message.sql
@@ -11,4 +11,4 @@ CREATE TABLE IF NOT EXISTS `message` (
-- KEY `type_status_date` (`status`, `type`,`created_at`,`message_id`)
);
-CREATE INDEX `message_status_type_date` ON `message` (`status`, `type`,`created_at`,`message_id`);
+CREATE INDEX `message_status_type_date` ON `message` (`type`, `status`,`created_at`,`message_id`);
diff --git a/install/sql/sqlite/schema/plugin/newsletter_list.sql b/install/sql/sqlite/schema/plugin/newsletter_list.sql
old mode 100644
new mode 100755
index f3783a4..6acc59b
--- a/install/sql/sqlite/schema/plugin/newsletter_list.sql
+++ b/install/sql/sqlite/schema/plugin/newsletter_list.sql
@@ -1,4 +1,4 @@
--- DROP TABLE IF EXISTS `newsletter_list`;
+DROP TABLE IF EXISTS `newsletter_list`;
CREATE TABLE IF NOT EXISTS `newsletter_list` (
`newsletter_list_id` INTEGER PRIMARY KEY AUTOINCREMENT,
diff --git a/install/sql/sqlite/schema/plugin/newsletter_mail.sql b/install/sql/sqlite/schema/plugin/newsletter_mail.sql
old mode 100644
new mode 100755
index b252ad4..9992a65
--- a/install/sql/sqlite/schema/plugin/newsletter_mail.sql
+++ b/install/sql/sqlite/schema/plugin/newsletter_mail.sql
@@ -1,7 +1,7 @@
--- DROP TABLE IF EXISTS `newsletter_mail`;
+DROP TABLE IF EXISTS `newsletter_mail`;
CREATE TABLE IF NOT EXISTS `newsletter_mail` (
- `newsletter_list_id` INT UNSIGNED,
+ `newsletter_list_id` INT UNSIGNED NOT NULL,
`email` varchar(254) NOT NULL,
`first_name` varchar(254) NOT NULL DEFAULT '',
`last_name` varchar(254) NOT NULL DEFAULT '',
@@ -10,5 +10,6 @@ CREATE TABLE IF NOT EXISTS `newsletter_mail` (
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`email`, `newsletter_list_id`)
--- KEY `newsletter_list` (`newsletter_list_id`)
);
+
+CREATE INDEX `newsletter_mail_newsletter_list` ON `newsletter_mail` (`newsletter_list_id`);
diff --git a/install/sql/sqlite/schema/plugin/newsletter_post.sql b/install/sql/sqlite/schema/plugin/newsletter_post.sql
old mode 100644
new mode 100755
index e4a4369..60648b3
--- a/install/sql/sqlite/schema/plugin/newsletter_post.sql
+++ b/install/sql/sqlite/schema/plugin/newsletter_post.sql
@@ -1,4 +1,4 @@
--- DROP TABLE IF EXISTS `newsletter_post`;
+DROP TABLE IF EXISTS `newsletter_post`;
CREATE TABLE IF NOT EXISTS `newsletter_post` (
`newsletter_post_id` INTEGER PRIMARY KEY AUTOINCREMENT,
diff --git a/install/sql/sqlite/schema/post/comment.sql b/install/sql/sqlite/schema/post/comment.sql
index 5456fc8..598ca92 100755
--- a/install/sql/sqlite/schema/post/comment.sql
+++ b/install/sql/sqlite/schema/post/comment.sql
@@ -19,7 +19,7 @@ PRIMARY KEY (`comment_id`)
);
-CREATE INDEX `comment_post_id` ON `comment` (`post_id`);
+CREATE INDEX `comment_post_id` ON `comment` (`post_id`, `status`);
CREATE INDEX `comment_parent` ON `comment` (`parent_id`);
CREATE INDEX `comment_email` ON `comment` (`email`);
diff --git a/install/sql/sqlite/schema/post/post.sql b/install/sql/sqlite/schema/post/post.sql
index bb5b7bb..355a0d9 100755
--- a/install/sql/sqlite/schema/post/post.sql
+++ b/install/sql/sqlite/schema/post/post.sql
@@ -19,7 +19,7 @@ CREATE TABLE `post` (
);
-CREATE INDEX `post_type_status_date` ON `post` (`type`);
+CREATE INDEX `post_type_status_date_post_id` ON `post` (`type`,`status`,`sort_order`,`created_at`,`post_id`);
CREATE INDEX `post_parent` ON `post` (`parent`);
CREATE INDEX `post_author` ON `post` (`admin_id`);
CREATE INDEX `post_updated_at` ON `post` (`updated_at`);
diff --git a/install/sql/sqlite/schema/post/post_to_site.sql b/install/sql/sqlite/schema/post/post_to_site.sql
index 480afcb..5c95633 100755
--- a/install/sql/sqlite/schema/post/post_to_site.sql
+++ b/install/sql/sqlite/schema/post/post_to_site.sql
@@ -5,3 +5,5 @@ CREATE TABLE `post_to_site` (
`site_id` TINYINT NOT NULL DEFAULT '0',
PRIMARY KEY (`post_id`,`site_id`)
);
+
+CREATE INDEX IF NOT EXISTS `post_to_site_site` ON `post_to_site` (`site_id`);
diff --git a/install/sql/sqlite/schema/product/manufacturer.sql b/install/sql/sqlite/schema/product/manufacturer.sql
index cf444db..6a2375a 100755
--- a/install/sql/sqlite/schema/product/manufacturer.sql
+++ b/install/sql/sqlite/schema/product/manufacturer.sql
@@ -2,9 +2,9 @@ DROP TABLE IF EXISTS `manufacturer`;
CREATE TABLE `manufacturer` (
`manufacturer_id` INTEGER PRIMARY KEY AUTOINCREMENT,
-`name` TEXT NOT NULL DEFAULT "",
-`slug` TEXT NOT NULL DEFAULT "",
-`image` TEXT NOT NULL,
+`name` TEXT NOT NULL DEFAULT '',
+`slug` TEXT NOT NULL DEFAULT '',
+`image` TEXT NOT NULL DEFAULT '',
`sort_order` INTEGER NOT NULL DEFAULT 0
-- PRIMARY KEY (`manufacturer_id`)
);
diff --git a/install/sql/sqlite/schema/product/manufacturer_to_site.sql b/install/sql/sqlite/schema/product/manufacturer_to_site.sql
index c1ffce8..b417c61 100755
--- a/install/sql/sqlite/schema/product/manufacturer_to_site.sql
+++ b/install/sql/sqlite/schema/product/manufacturer_to_site.sql
@@ -2,6 +2,8 @@ DROP TABLE IF EXISTS `manufacturer_to_site`;
CREATE TABLE `manufacturer_to_site` (
`manufacturer_id` INT NOT NULL,
-`site_id` TINYINT NOT NULL,
+`site_id` TINYINT NOT NULL DEFAULT 0,
PRIMARY KEY (`manufacturer_id`,`site_id`)
);
+
+CREATE INDEX IF NOT EXISTS `manufacturer_to_site_site` ON `manufacturer_to_site` (`site_id`);
diff --git a/install/sql/sqlite/schema/product/product.sql b/install/sql/sqlite/schema/product/product.sql
index 67b7c90..854b90b 100755
--- a/install/sql/sqlite/schema/product/product.sql
+++ b/install/sql/sqlite/schema/product/product.sql
@@ -32,7 +32,7 @@ CREATE TABLE `product` (
`width` decimal(15,8) NOT NULL DEFAULT '0.00000000',
`height` decimal(15,8) NOT NULL DEFAULT '0.00000000',
`length_type_id` INT NOT NULL DEFAULT 0,
-`date_available` date NOT NULL DEFAULT '1000-01-01',
+`date_available` date,
`template` TEXT NOT NULL DEFAULT '',
`views` INTEGER NOT NULL DEFAULT 0,
`subtract_stock` TINYINT NOT NULL DEFAULT 1,
@@ -48,5 +48,10 @@ CREATE TABLE `product` (
-CREATE INDEX `product_type_status_date` ON `product` (`type`);
+CREATE INDEX `product_type_status_date` ON `product` (`type`,`status`,`created_at`);
+CREATE INDEX `product_stock_status_id` ON `product` (`stock_status_id`);
+CREATE INDEX `product_vendor_id` ON `product` (`vendor_id`);
+CREATE INDEX `product_manufacturer_id` ON `product` (`manufacturer_id`);
+CREATE INDEX `product_barcode` ON `product` (`barcode`);
+CREATE INDEX `product_sku` ON `product` (`sku`);
diff --git a/install/sql/sqlite/schema/product/product_attribute.sql b/install/sql/sqlite/schema/product/product_attribute.sql
old mode 100644
new mode 100755
diff --git a/install/sql/sqlite/schema/product/product_content_meta.sql b/install/sql/sqlite/schema/product/product_content_meta.sql
old mode 100644
new mode 100755
diff --git a/install/sql/sqlite/schema/product/product_discount.sql b/install/sql/sqlite/schema/product/product_discount.sql
index cdab03d..8923cde 100755
--- a/install/sql/sqlite/schema/product/product_discount.sql
+++ b/install/sql/sqlite/schema/product/product_discount.sql
@@ -7,9 +7,10 @@ CREATE TABLE `product_discount` (
`quantity` INTEGER NOT NULL DEFAULT '0',
`priority` INTEGER NOT NULL DEFAULT '1',
`price` decimal(15,4) NOT NULL DEFAULT '0.0000',
-`from_date` date NOT NULL DEFAULT '1000-01-01',
-`to_date` date NOT NULL DEFAULT '1000-01-01'
+`from_date` date,
+`to_date` date
-- PRIMARY KEY (`product_discount_id`)
);
CREATE INDEX `product_discount_product_id` ON `product_discount` (`product_id`);
+CREATE INDEX `product_discount_user_group_id` ON `product_discount` (`user_group_id`);
diff --git a/install/sql/sqlite/schema/product/product_meta.sql b/install/sql/sqlite/schema/product/product_meta.sql
old mode 100644
new mode 100755
index 641a2f4..0784192
--- a/install/sql/sqlite/schema/product/product_meta.sql
+++ b/install/sql/sqlite/schema/product/product_meta.sql
@@ -3,7 +3,7 @@ DROP TABLE IF EXISTS `product_meta`;
CREATE TABLE `product_meta` (
`product_id` INT NOT NULL,
`namespace` TEXT NOT NULL DEFAULT '',
- `key` TEXT NOT NULL,
+ `key` TEXT NOT NULL DEFAULT '',
`value` TEXT
-- PRIMARY KEY (`product_id`, `namespace`, `key`)
);
diff --git a/install/sql/sqlite/schema/product/product_promotion.sql b/install/sql/sqlite/schema/product/product_promotion.sql
index d0a5ebc..10b2dc4 100755
--- a/install/sql/sqlite/schema/product/product_promotion.sql
+++ b/install/sql/sqlite/schema/product/product_promotion.sql
@@ -6,9 +6,10 @@ CREATE TABLE `product_promotion` (
`user_group_id` INT NOT NULL,
`priority` INTEGER NOT NULL DEFAULT '1',
`price` decimal(15,4) NOT NULL DEFAULT '0.0000',
-`from_date` date NOT NULL DEFAULT '1000-01-01',
-`to_date` date NOT NULL DEFAULT '1000-01-01'
+`from_date` date,
+`to_date` date
-- PRIMARY KEY (`product_promotion_id`)
);
CREATE INDEX `product_promotion_product_id` ON `product_promotion` (`product_id`);
+CREATE INDEX `product_promotion_user_group_id` ON `product_promotion` (`user_group_id`);
diff --git a/install/sql/sqlite/schema/product/product_question.sql b/install/sql/sqlite/schema/product/product_question.sql
index 7a2d42c..d018c90 100755
--- a/install/sql/sqlite/schema/product/product_question.sql
+++ b/install/sql/sqlite/schema/product/product_question.sql
@@ -16,3 +16,4 @@ CREATE TABLE `product_question` (
CREATE INDEX `product_question_product_id` ON `product_question` (`product_id`, `user_id`, `status`);
+CREATE INDEX `product_question_user_id` ON `product_question` (`user_id`);
diff --git a/install/sql/sqlite/schema/product/product_related.sql b/install/sql/sqlite/schema/product/product_related.sql
index 1ff3090..be85ecc 100755
--- a/install/sql/sqlite/schema/product/product_related.sql
+++ b/install/sql/sqlite/schema/product/product_related.sql
@@ -5,3 +5,5 @@ CREATE TABLE `product_related` (
`product_related_id` INT NOT NULL,
PRIMARY KEY (`product_id`,`product_related_id`)
);
+
+CREATE INDEX IF NOT EXISTS `product_related_related` ON `product_related` (`product_related_id`);
diff --git a/install/sql/sqlite/schema/product/product_review.sql b/install/sql/sqlite/schema/product/product_review.sql
index 170d640..a4752b0 100755
--- a/install/sql/sqlite/schema/product/product_review.sql
+++ b/install/sql/sqlite/schema/product/product_review.sql
@@ -16,3 +16,4 @@ CREATE TABLE `product_review` (
CREATE INDEX `product_review_product_id` ON `product_review` (`product_id`, `user_id`, `status`);
+CREATE INDEX `product_review_user_id` ON `product_review` (`user_id`);
diff --git a/install/sql/sqlite/schema/product/product_review_media.sql b/install/sql/sqlite/schema/product/product_review_media.sql
old mode 100644
new mode 100755
index 7d2c243..ead791d
--- a/install/sql/sqlite/schema/product/product_review_media.sql
+++ b/install/sql/sqlite/schema/product/product_review_media.sql
@@ -13,3 +13,4 @@ CREATE TABLE `product_review_media` (
CREATE INDEX `product_review_media_product_id_image` ON `product_review_media` (`product_id`, `user_id`);
CREATE INDEX `product_review_media_product_review_id_image` ON `product_review_media` (`product_review_id`);
+CREATE INDEX `product_review_media_user_id` ON `product_review_media` (`user_id`);
diff --git a/install/sql/sqlite/schema/product/product_to_site.sql b/install/sql/sqlite/schema/product/product_to_site.sql
index 39e7b0b..fe25994 100755
--- a/install/sql/sqlite/schema/product/product_to_site.sql
+++ b/install/sql/sqlite/schema/product/product_to_site.sql
@@ -5,3 +5,5 @@ CREATE TABLE `product_to_site` (
`site_id` TINYINT NOT NULL DEFAULT '0',
PRIMARY KEY (`product_id`,`site_id`)
);
+
+CREATE INDEX IF NOT EXISTS `product_to_site_site` ON `product_to_site` (`site_id`);
diff --git a/install/sql/sqlite/schema/product/product_variant.sql b/install/sql/sqlite/schema/product/product_variant.sql
index 96cd51a..e14a8ca 100755
--- a/install/sql/sqlite/schema/product/product_variant.sql
+++ b/install/sql/sqlite/schema/product/product_variant.sql
@@ -3,7 +3,7 @@ DROP TABLE IF EXISTS `product_variant`;
CREATE TABLE `product_variant` (
`product_variant_id` INTEGER PRIMARY KEY AUTOINCREMENT,
`product_id` INT UNSIGNED NOT NULL,
- `options`TEXT NOT NULL DEFAULT '',
+ `options` TEXT NOT NULL DEFAULT '',
`image` TEXT NOT NULL DEFAULT '',
`price` decimal(15,4) NOT NULL DEFAULT 0.0000,
`old_price` decimal(15,4) NOT NULL DEFAULT 0.0000,
@@ -15,4 +15,5 @@ CREATE TABLE `product_variant` (
-- KEY (`product_id`,`product_variant_id`, `product_option`)
);
-CREATE INDEX `product_variant_product_id_product_option` ON `product_variant` (`product_id`,`product_variant_id`, `options`);
\ No newline at end of file
+CREATE INDEX `product_variant_product_id_product_option` ON `product_variant` (`product_id`,`product_variant_id`, `options`);
+CREATE INDEX `product_variant_options` ON `product_variant` (`options`);
\ No newline at end of file
diff --git a/install/sql/sqlite/schema/product/vendor.sql b/install/sql/sqlite/schema/product/vendor.sql
index a2929e5..d41081f 100755
--- a/install/sql/sqlite/schema/product/vendor.sql
+++ b/install/sql/sqlite/schema/product/vendor.sql
@@ -3,9 +3,9 @@ DROP TABLE IF EXISTS `vendor`;
CREATE TABLE `vendor` (
`vendor_id` INTEGER PRIMARY KEY AUTOINCREMENT,
`admin_id` INT NOT NULL DEFAULT 0,
-`name` TEXT NOT NULL DEFAULT "",
-`slug` TEXT NOT NULL DEFAULT "",
-`image` TEXT NOT NULL,
+`name` TEXT NOT NULL DEFAULT '',
+`slug` TEXT NOT NULL DEFAULT '',
+`image` TEXT NOT NULL DEFAULT '',
`sort_order` INTEGER NOT NULL DEFAULT 0
-- PRIMARY KEY (`vendor_id`)
);
diff --git a/install/sql/sqlite/schema/product/vendor_to_site.sql b/install/sql/sqlite/schema/product/vendor_to_site.sql
index a472a0f..8c8dedb 100755
--- a/install/sql/sqlite/schema/product/vendor_to_site.sql
+++ b/install/sql/sqlite/schema/product/vendor_to_site.sql
@@ -2,6 +2,8 @@ DROP TABLE IF EXISTS `vendor_to_site`;
CREATE TABLE `vendor_to_site` (
`vendor_id` INT NOT NULL,
-`site_id` TINYINT NOT NULL,
+`site_id` TINYINT NOT NULL DEFAULT 0,
PRIMARY KEY (`vendor_id`,`site_id`)
);
+
+CREATE INDEX IF NOT EXISTS `vendor_to_site_site` ON `vendor_to_site` (`site_id`);
diff --git a/install/sql/sqlite/schema/queue/queue.sql b/install/sql/sqlite/schema/queue/queue.sql
new file mode 100755
index 0000000..f02d6ee
--- /dev/null
+++ b/install/sql/sqlite/schema/queue/queue.sql
@@ -0,0 +1,32 @@
+DROP TABLE IF EXISTS `queue_jobs`;
+
+CREATE TABLE `queue_jobs` (
+ `id` INTEGER PRIMARY KEY AUTOINCREMENT,
+ `job_id` TEXT NOT NULL UNIQUE,
+ `queue` TEXT NOT NULL DEFAULT 'default',
+ `job` TEXT NOT NULL,
+ `payload` TEXT,
+ `attempts` INTEGER NOT NULL DEFAULT 0,
+ `max_attempts` INTEGER NOT NULL DEFAULT 3,
+ `available_at` INTEGER NOT NULL DEFAULT 0,
+ `reserved_at` INTEGER DEFAULT NULL,
+ `created_at` INTEGER NOT NULL DEFAULT 0
+);
+
+CREATE INDEX IF NOT EXISTS idx_queue_jobs_queue_available ON `queue_jobs` (`queue`, `available_at`);
+CREATE INDEX IF NOT EXISTS idx_queue_jobs_reserved ON `queue_jobs` (`reserved_at`);
+
+DROP TABLE IF EXISTS `failed_jobs`;
+
+CREATE TABLE `failed_jobs` (
+ `job_id` TEXT NOT NULL PRIMARY KEY,
+ `queue` TEXT NOT NULL DEFAULT 'default',
+ `job` TEXT NOT NULL,
+ `payload` TEXT,
+ `error` TEXT,
+ `attempts` INTEGER NOT NULL DEFAULT 0,
+ `max_attempts` INTEGER NOT NULL DEFAULT 3,
+ `failed_at` INTEGER NOT NULL DEFAULT 0
+);
+
+CREATE INDEX IF NOT EXISTS idx_failed_jobs_queue_failed ON `failed_jobs` (`queue`, `failed_at`);
diff --git a/install/sql/sqlite/schema/site/setting.sql b/install/sql/sqlite/schema/site/setting.sql
index 3e3701d..c8daea8 100755
--- a/install/sql/sqlite/schema/site/setting.sql
+++ b/install/sql/sqlite/schema/site/setting.sql
@@ -1,7 +1,7 @@
DROP TABLE IF EXISTS `setting`;
CREATE TABLE `setting` (
-`site_id` INTEGER,
+`site_id` INTEGER NOT NULL DEFAULT 0,
`namespace` TEXT NOT NULL,
`key` TEXT NOT NULL,
`value` text NOT NULL,
diff --git a/install/sql/sqlite/schema/site/setting_content.sql b/install/sql/sqlite/schema/site/setting_content.sql
index 1599096..ff95c03 100755
--- a/install/sql/sqlite/schema/site/setting_content.sql
+++ b/install/sql/sqlite/schema/site/setting_content.sql
@@ -1,8 +1,8 @@
DROP TABLE IF EXISTS `setting_content`;
CREATE TABLE `setting_content` (
-`site_id` INTEGER,
-`language_id` INTEGER,
+`site_id` INTEGER NOT NULL DEFAULT 0,
+`language_id` INTEGER NOT NULL DEFAULT 0,
`namespace` TEXT NOT NULL,
`key` TEXT NOT NULL,
`value` text NOT NULL,
diff --git a/install/sql/sqlite/schema/site/site.sql b/install/sql/sqlite/schema/site/site.sql
old mode 100644
new mode 100755
diff --git a/install/sql/sqlite/schema/subscription/order_subscription.sql b/install/sql/sqlite/schema/subscription/order_subscription.sql
old mode 100644
new mode 100755
index b3910c9..9a1a57b
--- a/install/sql/sqlite/schema/subscription/order_subscription.sql
+++ b/install/sql/sqlite/schema/subscription/order_subscription.sql
@@ -23,3 +23,5 @@ CREATE TABLE `order_subscription` (
);
CREATE INDEX `order_subscription_order_id` ON `order_subscription` (`order_id`);
+CREATE INDEX `order_subscription_product_id` ON `order_subscription` (`product_id`);
+CREATE INDEX `order_subscription_subscription_plan_id` ON `order_subscription` (`subscription_plan_id`);
diff --git a/install/sql/sqlite/schema/subscription/product_subscription.sql b/install/sql/sqlite/schema/subscription/product_subscription.sql
index 5fc8893..ccab637 100755
--- a/install/sql/sqlite/schema/subscription/product_subscription.sql
+++ b/install/sql/sqlite/schema/subscription/product_subscription.sql
@@ -4,11 +4,11 @@ CREATE TABLE `product_subscription` (
`product_id` INT NOT NULL,
`subscription_plan_id` INT NOT NULL,
`user_group_id` INT NOT NULL,
-`type` char(1) NOT NULL DEFAULT '',
+`type` char(1) NOT NULL DEFAULT '', -- empty = original price, p = percentage discount, f = fixed discount, n = flat price
`discount` decimal(15,4) NOT NULL DEFAULT 0,
`price` decimal(15,4) NOT NULL DEFAULT 0.0000,
`trial_price` decimal(15,4) NOT NULL DEFAULT 0.0000
-- PRIMARY KEY (`product_id`,`subscription_plan_id`,`user_group_id`)
);
-CREATE INDEX `order_id` ON `product_subscription` (`product_id`,`subscription_plan_id`,`user_group_id`);
+CREATE INDEX `order_id` ON `product_subscription` (`product_id`,`subscription_plan_id`,`user_group_id`);
\ No newline at end of file
diff --git a/install/sql/sqlite/schema/subscription/subscription.sql b/install/sql/sqlite/schema/subscription/subscription.sql
old mode 100644
new mode 100755
index 3321381..c87fbd0
--- a/install/sql/sqlite/schema/subscription/subscription.sql
+++ b/install/sql/sqlite/schema/subscription/subscription.sql
@@ -25,17 +25,14 @@ CREATE TABLE `subscription` (
`trial_left` smallint(6) NOT NULL,
`trial_status` tinyint NOT NULL,
`date_next` datetime NOT NULL,
- `note` text NOT NULL,
+ `notes` text NOT NULL,
`subscription_status_id` INT NOT NULL,
- `tracking` TEXT NOT NULL,
- `language_id` INT NOT NULL,
- `currency_id` INT NOT NULL,
- `ip` TEXT NOT NULL,
- `forwarded_ip` TEXT NOT NULL,
- `user_agent` TEXT NOT NULL,
- `created_at` datetime NOT NULL,
- `updated_at` datetime NOT NULL
--- PRIMARY KEY (`subscription_id`),
+ `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX `subscription_order_id` ON `subscription` (`order_id`);
+CREATE INDEX `subscription_user_id` ON `subscription` (`user_id`);
+CREATE INDEX `subscription_product_id` ON `subscription` (`product_id`);
+CREATE INDEX `subscription_subscription_plan_id` ON `subscription` (`subscription_plan_id`);
+CREATE INDEX `subscription_subscription_status_id` ON `subscription` (`subscription_status_id`);
diff --git a/install/sql/sqlite/schema/subscription/subscription_log.sql b/install/sql/sqlite/schema/subscription/subscription_log.sql
old mode 100644
new mode 100755
index 41496c6..0ad3657
--- a/install/sql/sqlite/schema/subscription/subscription_log.sql
+++ b/install/sql/sqlite/schema/subscription/subscription_log.sql
@@ -9,3 +9,5 @@ CREATE TABLE `subscription_log` (
`created_at` datetime NOT NULL
-- PRIMARY KEY (`subscription_log_id`)
);
+
+CREATE INDEX `subscription_log_subscription_id` ON `subscription_log` (`subscription_id`);
diff --git a/install/sql/sqlite/schema/subscription/subscription_plan.sql b/install/sql/sqlite/schema/subscription/subscription_plan.sql
old mode 100644
new mode 100755
diff --git a/install/sql/sqlite/schema/subscription/subscription_plan_content.sql b/install/sql/sqlite/schema/subscription/subscription_plan_content.sql
old mode 100644
new mode 100755
index ba75e7d..9589fc9
--- a/install/sql/sqlite/schema/subscription/subscription_plan_content.sql
+++ b/install/sql/sqlite/schema/subscription/subscription_plan_content.sql
@@ -4,6 +4,6 @@ CREATE TABLE `subscription_plan_content` (
`subscription_plan_id` INT NOT NULL,
`language_id` INT NOT NULL,
`name` TEXT NOT NULL,
- `content` TEXT NOT NULL DEFAULT '',
+ `content` text,
PRIMARY KEY (`subscription_plan_id`,`language_id`)
);
diff --git a/install/sql/sqlite/schema/tax/tax_rate.sql b/install/sql/sqlite/schema/tax/tax_rate.sql
index 445f247..ca1e416 100755
--- a/install/sql/sqlite/schema/tax/tax_rate.sql
+++ b/install/sql/sqlite/schema/tax/tax_rate.sql
@@ -10,3 +10,5 @@ CREATE TABLE `tax_rate` (
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
-- PRIMARY KEY (`tax_rate_id`)
);
+
+CREATE INDEX `tax_rate_region_group_id` ON `tax_rate` (`region_group_id`);
diff --git a/install/sql/sqlite/schema/post_category/post_to_taxonomy_item.sql b/install/sql/sqlite/schema/taxonomy/post_to_taxonomy_item.sql
similarity index 100%
rename from install/sql/sqlite/schema/post_category/post_to_taxonomy_item.sql
rename to install/sql/sqlite/schema/taxonomy/post_to_taxonomy_item.sql
diff --git a/install/sql/sqlite/schema/post_category/taxonomy.sql b/install/sql/sqlite/schema/taxonomy/taxonomy.sql
old mode 100755
new mode 100644
similarity index 81%
rename from install/sql/sqlite/schema/post_category/taxonomy.sql
rename to install/sql/sqlite/schema/taxonomy/taxonomy.sql
index 53d4d35..5335cb2
--- a/install/sql/sqlite/schema/post_category/taxonomy.sql
+++ b/install/sql/sqlite/schema/taxonomy/taxonomy.sql
@@ -8,7 +8,3 @@ CREATE TABLE `taxonomy` (
`site_id` INT UNSIGNED NOT NULL DEFAULT 0
-- PRIMARY KEY (`taxonomy_id`)
);
-
-
-
-CREATE INDEX `taxonomy_taxonomy_id` ON `taxonomy` (`taxonomy_id`);
diff --git a/install/sql/sqlite/schema/post_category/taxonomy_content.sql b/install/sql/sqlite/schema/taxonomy/taxonomy_content.sql
old mode 100755
new mode 100644
similarity index 100%
rename from install/sql/sqlite/schema/post_category/taxonomy_content.sql
rename to install/sql/sqlite/schema/taxonomy/taxonomy_content.sql
diff --git a/install/sql/sqlite/schema/post_category/taxonomy_item.sql b/install/sql/sqlite/schema/taxonomy/taxonomy_item.sql
old mode 100755
new mode 100644
similarity index 100%
rename from install/sql/sqlite/schema/post_category/taxonomy_item.sql
rename to install/sql/sqlite/schema/taxonomy/taxonomy_item.sql
diff --git a/install/sql/sqlite/schema/post_category/taxonomy_item_content.sql b/install/sql/sqlite/schema/taxonomy/taxonomy_item_content.sql
old mode 100755
new mode 100644
similarity index 100%
rename from install/sql/sqlite/schema/post_category/taxonomy_item_content.sql
rename to install/sql/sqlite/schema/taxonomy/taxonomy_item_content.sql
diff --git a/install/sql/sqlite/schema/post_category/taxonomy_item_meta.sql b/install/sql/sqlite/schema/taxonomy/taxonomy_item_meta.sql
old mode 100755
new mode 100644
similarity index 100%
rename from install/sql/sqlite/schema/post_category/taxonomy_item_meta.sql
rename to install/sql/sqlite/schema/taxonomy/taxonomy_item_meta.sql
diff --git a/install/sql/sqlite/schema/post_category/taxonomy_to_site.sql b/install/sql/sqlite/schema/taxonomy/taxonomy_to_site.sql
old mode 100755
new mode 100644
similarity index 67%
rename from install/sql/sqlite/schema/post_category/taxonomy_to_site.sql
rename to install/sql/sqlite/schema/taxonomy/taxonomy_to_site.sql
index 26c4b82..d3ba7e7
--- a/install/sql/sqlite/schema/post_category/taxonomy_to_site.sql
+++ b/install/sql/sqlite/schema/taxonomy/taxonomy_to_site.sql
@@ -5,3 +5,5 @@ CREATE TABLE `taxonomy_to_site` (
`site_id` TINYINT NOT NULL,
PRIMARY KEY (`taxonomy_item_id`,`site_id`)
);
+
+CREATE INDEX IF NOT EXISTS `taxonomy_to_site_site` ON `taxonomy_to_site` (`site_id`);
diff --git a/install/sql/sqlite/schema/user/digital_asset.sql b/install/sql/sqlite/schema/user/digital_asset.sql
old mode 100644
new mode 100755
index 21be475..1cef707
--- a/install/sql/sqlite/schema/user/digital_asset.sql
+++ b/install/sql/sqlite/schema/user/digital_asset.sql
@@ -5,8 +5,8 @@ CREATE TABLE `digital_asset` (
`admin_id` INT NOT NULL,
`file` TEXT NOT NULL,
`public` TEXT NOT NULL,
-`created_at` datetime NOT NULL
+`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
-- PRIMARY KEY (`digital_asset_id`)
);
-CREATE INDEX `digital_asset_admin` ON `post` (`admin_id`);
\ No newline at end of file
+CREATE INDEX `digital_asset_admin` ON `digital_asset` (`admin_id`);
\ No newline at end of file
diff --git a/install/sql/sqlite/schema/user/digital_asset_log.sql b/install/sql/sqlite/schema/user/digital_asset_log.sql
index f9e38e1..63f212d 100755
--- a/install/sql/sqlite/schema/user/digital_asset_log.sql
+++ b/install/sql/sqlite/schema/user/digital_asset_log.sql
@@ -1,14 +1,13 @@
DROP TABLE IF EXISTS `digital_asset_log`;
CREATE TABLE `digital_asset_log` (
-`digital_asset_stats_id` INTEGER PRIMARY KEY AUTOINCREMENT,
+`digital_asset_log_id` INTEGER PRIMARY KEY AUTOINCREMENT,
`digital_asset_id` INT NOT NULL,
`user_id` INT NOT NULL,
`site_id` TINYINT NOT NULL,
`ip` TEXT NOT NULL,
`country` TEXT,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
--- PRIMARY KEY (`digital_asset_stats_id`)
);
CREATE INDEX `digital_asset_log_user_id` ON `digital_asset_log` (`user_id`);
diff --git a/install/sql/sqlite/schema/user/password_resets.sql b/install/sql/sqlite/schema/user/password_resets.sql
index f36e9ca..e27e76a 100755
--- a/install/sql/sqlite/schema/user/password_resets.sql
+++ b/install/sql/sqlite/schema/user/password_resets.sql
@@ -3,5 +3,6 @@ DROP TABLE IF EXISTS `password_resets`;
CREATE TABLE `password_resets` (
`email` TEXT NOT NULL,
`token` TEXT NOT NULL,
-`created_at` timestamp NULL DEFAULT NULL
+`created_at` timestamp NULL DEFAULT NULL,
+PRIMARY KEY (`email`,`token`)
);
diff --git a/install/sql/sqlite/schema/user/user_failed_login.sql b/install/sql/sqlite/schema/user/user_failed_login.sql
old mode 100644
new mode 100755
diff --git a/install/sql/sqlite/schema/user/user_points.sql b/install/sql/sqlite/schema/user/user_points.sql
index 69173d4..4342063 100755
--- a/install/sql/sqlite/schema/user/user_points.sql
+++ b/install/sql/sqlite/schema/user/user_points.sql
@@ -9,3 +9,6 @@ CREATE TABLE `user_points` (
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
-- PRIMARY KEY (`user_points_id`)
);
+
+CREATE INDEX `user_points_user_id` ON `user_points` (`user_id`);
+CREATE INDEX `user_points_order_id` ON `user_points` (`order_id`);
diff --git a/install/sql/sqlite/schema/user/user_wishlist.sql b/install/sql/sqlite/schema/user/user_wishlist.sql
index 7a2f3ec..ff03c3d 100755
--- a/install/sql/sqlite/schema/user/user_wishlist.sql
+++ b/install/sql/sqlite/schema/user/user_wishlist.sql
@@ -5,4 +5,6 @@ CREATE TABLE `user_wishlist` (
`product_id` INT NOT NULL,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`user_id`,`product_id`)
-);
\ No newline at end of file
+);
+
+CREATE INDEX IF NOT EXISTS `user_wishlist_product` ON `user_wishlist` (`product_id`);
diff --git a/install/template/common.tpl b/install/template/common.tpl
index 53fd590..6441a3e 100755
--- a/install/template/common.tpl
+++ b/install/template/common.tpl
@@ -113,4 +113,4 @@ html|addNewAttribute = <?php if (isset($_COOKIE['theme'])) {
echo 'data-bs-theme="';
if ($_COOKIE['theme'] == 'dark') echo 'dark'; else if ($_COOKIE['theme'] == 'light') echo 'light';else echo 'auto';
echo '"';
-} ?>
\ No newline at end of file
+} ?>
diff --git a/public/install/default/index.html b/public/install/default/index.html
index e6ee205..f75666a 100755
--- a/public/install/default/index.html
+++ b/public/install/default/index.html
@@ -29,6 +29,7 @@
</a>
<form method="post" class="m-2">
+ <input type="hidden" name="csrf" data-v-csrf>
<select name="language" class="form-select py-2" onchange="this.form.submit()" data-v-language-list>
<option value="en">English</option>
<option value="ro">Romanian</option>
@@ -112,6 +113,7 @@
<div class="card-body">
<p class="card-text text-muted">Please fill the form, contact your hosting provider for details</p>
<form method="post">
+ <input type="hidden" name="csrf" data-v-csrf>
<div class="mb-3 row">
<label for="engine" class="col-sm-4 col-form-label">Database engine</label>
<div class="col-sm-8">
diff --git a/public/install/default/install.html b/public/install/default/install.html
index d15c687..29a7892 100644
--- a/public/install/default/install.html
+++ b/public/install/default/install.html
@@ -99,6 +99,7 @@
<p class="card-text" style="color:#777">These can be later changed from admin.</p>
<form method="post">
+ <input type="hidden" name="csrf" data-v-csrf>
<div class="mb-3 row">
<label for="title" class="col-sm-3 col-form-label">Primary language</label>
<div class="col-sm-9">
@@ -142,7 +143,7 @@
<div class="mb-3 row">
<label for="username" class="col-sm-3 col-form-label">User name</label>
<div class="col-sm-9">
- <input type="text" class="form-control" id="username" placeholder="User" name="admin[username]" value="admin" required>
+ <input type="text" class="form-control" id="username" placeholder="User" name="admin[username]" value="admin" pattern="[A-Za-z0-9_-]{3,60}" required>
</div>
</div>
<!--
@@ -157,7 +158,7 @@
<label for="password" class="col-sm-3 col-form-label">Password</label>
<div class="col-sm-9">
<div class="input-group">
- <input type="text" class="form-control" id="password" placeholder="User password" name="admin[password]" value="" aria-label="User password" autocomplete="new-password">
+ <input type="text" class="form-control" id="password" placeholder="User password" name="admin[password]" value="" aria-label="User password" autocomplete="new-password" minlength="8" required>
<button class="btn btn-sm py-0 btn-toggle fs-5" type="button" onclick="randomizePassword(this, 'password')">
<i class="icon-shuffle-outline"></i>
<!-- &#x1F3B2; -->
@@ -173,7 +174,7 @@
<label for="display_name" class="col-sm-3 col-form-label">Admin login path</label>
<div class="col-sm-9">
<div class="input-group">
- <input type="text" class="form-control" id="admin-path" placeholder="Username" name="admin-path" value="admin" required>
+ <input type="text" class="form-control" id="admin-path" placeholder="Username" name="admin-path" value="admin" pattern="[A-Za-z0-9_-]{1,64}" required>
<button class="btn btn-sm py-0 btn-toggle fs-5" id="rand-path-btn" type="button" onclick="randomizeAdminPath()">
<i class="icon-shuffle-outline"></i>
<!-- &#x1F3B2; -->
@@ -302,7 +303,7 @@ function randomizePassword() {
}
function randomizeAdminPath() {
- document.getElementById("admin-path").value = 'vadmin-' + randomPassword(32, "abcdefghijklmnopqrstuvwxyz!@<>ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890");
+ document.getElementById("admin-path").value = 'vadmin-' + randomPassword(32, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_");
};
randomizePassword();