Which version of OroCRM is working for oro:migration:load? - mysql-8.0

I'm trying a clean instalation in Ubuntu 20.04 with PHP 7.4.3 and mysql Ver 8.0.20-0ubuntu0.20.04.1 for Linux on x86_64 ((Ubuntu))
$ composer info | grep 'oro/'
oro/calendar-bundle 4.1.3 Calendar bundle for OroPlatform-based applications.
oro/commerce 4.1.4 OroCommerce - an open-source Business to Business Commerce application. \nThis package contains bundles and needs to be added as a dependency in an ...
oro/commerce-crm 4.1.2 OroCRM integration for OroCommerce
oro/crm 4.1.4 OroCRM
oro/crm-call-bundle 4.1.3 Oro Call Bundle
oro/crm-dotmailer 4.1.4 Oro Dotmailer integration
oro/crm-hangouts-call-bundle 4.1.1 Oro Google Hangouts integration
oro/crm-magento-embedded-contact-us 4.1.1 OroCRM Magento Embedded Contact Us package
oro/crm-task-bundle 4.1.3 Oro Task Bundle
oro/crm-zendesk 4.1.2 OroCRM Zendesk Integration
oro/customer-portal 4.1.4
oro/doctrine-extensions 1.2.2 Doctrine Extensions for MySQL and PostgreSQL.
oro/marketing 4.1.3 Oro Marketing Bundles
oro/oauth2-server 4.1.3 Oro OAuth 2.0 authorization and resource server for BAP
oro/platform 4.1.4 Business Application Platform (BAP)
oro/platform-serialised-fields 4.1.1 OroPlatform Serialized Fields
oro/redis-config 4.1.2 OroRedisConfigBundle
oro/twig-inspector 1.0.3 Oro Twig Inspector adds the possibility to find twig templates and blocks used for rendering HTML pages faster during development
But, When I run php bin/console oro:migration:load --force --show-queries
CREATE TABLE oro_workflow_definition (name VARCHAR(255) NOT NULL, start_step_id INT DEFAULT NULL, label VARCHAR(255) NOT NULL, related_entity VARCHAR(255) NOT NULL, entity_attribute_name VARCHAR(255) NOT NULL, steps_display_ordered TINYINT(1) NOT NULL, system TINYINT(1) NOT NULL, active TINYINT(1) DEFAULT '0' NOT NULL, priority INT DEFAULT 0 NOT NULL, configuration LONGTEXT NOT NULL COMMENT '(DC2Type:array)(DC2Type:array)', exclusive_active_groups LONGTEXT DEFAULT NULL COMMENT '(DC2Type:simple_array)(DC2Type:simple_array)', exclusive_record_groups LONGTEXT DEFAULT NULL COMMENT '(DC2Type:simple_array)(DC2Type:simple_array)', created_at DATETIME NOT NULL COMMENT '(DC2Type:datetime)', updated_at DATETIME NOT NULL COMMENT '(DC2Type:datetime)', applications LONGTEXT NOT NULL COMMENT '(DC2Type:simple_array)(DC2Type:simple_array)', INDEX idx_6f737c368377424f (start_step_id), PRIMARY KEY(name)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB
ERROR: An exception occurred while executing 'CREATE TABLE oro_workflow_definition (name VARCHAR(255) NOT NULL, start_step_id INT DEFAULT NULL, label VARCHAR(255) NOT NULL, related_entity VARCHAR(255) NOT NULL, entity_attribute_name VARCHAR(255) NOT NULL, steps_display_ordered TINYINT(1) NOT NULL, system TINYINT(1) NOT NULL, active TINYINT(1) DEFAULT '0' NOT NULL, priority INT DEFAULT 0 NOT NULL, configuration LONGTEXT NOT NULL COMMENT '(DC2Type:array)(DC2Type:array)', exclusive_active_groups LONGTEXT DEFAULT NULL COMMENT '(DC2Type:simple_array)(DC2Type:simple_array)', exclusive_record_groups LONGTEXT DEFAULT NULL COMMENT '(DC2Type:simple_array)(DC2Type:simple_array)', created_at DATETIME NOT NULL COMMENT '(DC2Type:datetime)', updated_at DATETIME NOT NULL COMMENT '(DC2Type:datetime)', applications LONGTEXT NOT NULL COMMENT '(DC2Type:simple_array)(DC2Type:simple_array)', INDEX idx_6f737c368377424f (start_step_id), PRIMARY KEY(name)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB':
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'system TINYINT(1) NOT NULL, active TINYINT(1) DEFAULT '0' NOT NULL, priority INT' at line 1
In MigrationExecutor.php line 116:
Failed migrations:
Oro\Bundle\WorkflowBundle\Migrations\Schema\OroWorkflowBundleInstaller.

You should use Mysql 5.7. OroCommerce 4.1.4 is not compatible with Mysql 8.

Related

Laravel Voyager create user fails to prompt and aborts

I am trying to create a Voyager user. I enter php artisan voyager:admin user#email.com --create in a Windows command window. It aborts because the enter user prompt did not wait for my input.
What do I need to do to make it wait for an answer? I am using Laravel 8.
This is a bug in PHP 7.4.0 on Windows so you either update to 7.4.1 or downgrade to 7.3.
I don't want to downgrade or upgrade the PHP version. So I simply solved the problem by executing these queries on the Database directly.
Password is: "password"
CREATE TABLE IF NOT EXISTS `admins` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`role_id` bigint(20) UNSIGNED DEFAULT NULL,
`name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`avatar` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT 'users/default.png',
`password` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`remember_token` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`settings` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `admins_email_unique` (`email`),
KEY `admins_role_id_foreign` (`role_id`)
)
INSERT INTO `admins` (`id`, `role_id`, `name`, `email`, `avatar`, `password`,
`remember_token`, `settings`, `created_at`, `updated_at`) VALUES
(1, 1, 'Admin', 'admin#admin.com', 'users/default.png',
'$2y$10$QndDoDX9ccomsjWXvWu1.uRFA5iGMEBiq1A5NcdrtvxgBDW4IIsAq', NULL, NULL,
'2023-01-09 21:40:59', '2023-01-09 21:40:59');
Admin has the role_id 1 and granted all permission by default. But If you face the permission problem, sort it out by visiting the permission_role table.

Error on SQLite migrations after upgrade Laravel 5.8 to 6.2

I need some help!
I have an API built in laravel 5.8, i am upgrading the platform to 6.2.
After all changes in configuration files and some scripts php, all my tests witch run the migrations on SQLite is broken.
The following error is displayed:
SQLSTATE[HY000]: General error: 1 no such collation sequence: utf8_general_ci (SQL: CREATE TABLE events (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, event VARCHAR(255) NOT NULL COLLATE BINARY, description CLOB DEFAULT NULL COLLATE BINARY, invitation CLOB DEFAULT NULL COLLATE BINARY, sale CLOB DEFAULT NULL COLLATE BINARY, information CLOB DEFAULT NULL COLLATE BINARY, city VARCHAR(255) NOT NULL COLLATE BINARY,
location VARCHAR(255) NOT NULL COLLATE BINARY, date_start DATE NOT NULL, time_start TIME NOT NULL, date_end DATE DEFAULT NULL, flyer CLOB DEFAULT NULL COLLATE BINARY, atv BOOLEAN DEFAULT '1', created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, location_map VARCHAR(255) DEFAULT NULL COLLATE utf8_general_ci --IFRAME com a localização do evento.
My intention is update to 7.x after resolve all issues on 6.2.
In the migrations, was enough to remove the collation option from the fields. Example:
Initially this way:
$table->string('field', 255)->charset('utf8')->collation('utf8_general_ci')->change();
The solution was as follows:
$table->string('field', 255)->charset('utf8')->change();
Removing this option will not force a collation not accepted by SQLite.

Why I am getting error for using jsonb keyword in Laravel?

I'm trying to learn Laravel Authorization using following mentioned tutorial:
Tutorial Link.
I'm using mysql database and default collation of the database is utf8mb4_unicode_ci. In Role's Database Migration permissions table data type was jsonb. That statement was:
$table->jsonb('permissions')->default('{}'); // you can check the tutorial link
After giving php artisan migrate --seed command, I am getting following error:
Illuminate\Database\QueryException : SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your S
QL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'json not null
default '{}', `created_at` timestamp null, `updated_at` timestamp ' at line 1 (SQL: create table `roles` (`id` int unsigned
not null auto_increment primary key, `name` varchar(191) not null, `slug` varchar(191) not null, `permissions` json not null
default '{}', `created_at` timestamp null, `updated_at` timestamp null) default character set utf8mb4 collate 'utf8mb4_unic
ode_ci')
I want to go through similarly like the mentioned tutorial but stuck here. How can I solve this?

Missing fields in a joomla sql schema

I exported my joomla.sql file through phpMyAdmin and one of the sql statement below is not complete.
CREATE TABLE XXXX_postinstall_messages (
postinstall_message_id bigint(20) UNSIGNED NOT NULL,
extension_id bigint(20) NOT NULL DEFAULT '700' COMMENT 'FK to #__extensions',
title_key varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ''COMMENT
) ;
Can someone assist to provide the full schema for this particular table?
here you'll find all joomla tables https://github.com/joomla/joomla-cms/blob/staging/installation/sql/mysql/joomla.sql

Automatic Casting of Default Values on Insert

This may be a feature instead of a bug, so I thought to include it on SO instead of MariaDB's Jira.
Yesterday I updated my MariaDB install on Homebrew from 10.1.23 to 10.2.6. All my selects are still working correctly, but now in my legacy app, I get a bunch of errors on inserts where the code is "assuming" MariaDB will set a default value. For example...
INSERT INTO table SET
email = 'some#email.com', -- varchar
phone_number = '', -- bigint
ts = '2017-05-30 23:51:23', -- datetime
some_val = '689728' -- varchar
This code was working fine before, but since I've upgraded I now get the following couple of errors...
Error 1 (is_some_toggle is a tinyint and is not defined in the query above, it is assumed that MariaDB would just insert a 0)
Field 'is_some_toggle' doesn't have a default value
Error 2 (after I set the default value to is_some_toggle)
Incorrect integer value: '' for column 'phone_number' at row 1
I'm guessing this is a feature, not a bug. I've looked through their changelogs for 10.2 series and I'm not seeing anything jump out, but there's a lot so I could have missed it. I saw a server config for OLD_SQL but that didn't seem to be what I was looking for. Any thoughts?
macOS Sierra 10.12.5 btw
CREATE TABLE `table` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`email` varchar(200) NOT NULL,
`phone_number` bigint(20) NOT NULL,
`some_val` varchar(6) NOT NULL,
`ts` datetime DEFAULT NULL,
`is_some_toggle` tinyint(1) NOT NULL,
PRIMARY KEY (`id`),
KEY `email_code` (`email`(15),`some_val`),
KEY `phone_number_code` (`phone_number`,`some_val`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
Looks like going through the changelog VERY slowly worked for me.
sql_mode was updated as was outlined in this article.
Option | Old default value | New default value
sql_mode | NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION | STRICT_TRANS_TABLES, ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION
I changed it back to the default and I'm good as gold.

Resources