I've switched from mysql 5.7 to 8 version and there is an error. While mysql 5.7 has no error.
I'm trying to migrate generated migration.
<?php
namespace Migration;
use Spiral\Migrations\Migration;
class OrmDefault3467f871b43924c6812739e5bf58a3d7 extends Migration
{
protected const DATABASE = 'default';
public function up(): void
{
$this->table('users')
->addColumn('id', 'bigPrimary', [
'nullable' => false,
'default' => null
])
->addColumn('name', 'string', [
'nullable' => false,
'default' => null,
'size' => 255
])
->addColumn('company_name', 'string', [
'nullable' => false,
'default' => null,
'size' => 255
])
->addColumn('email', 'string', [
'nullable' => false,
'default' => null,
'size' => 255
])
->addColumn('password', 'string', [
'nullable' => false,
'default' => null,
'size' => 255
])
->addColumn('backend', 'boolean', [
'nullable' => false,
'default' => false
])
->addColumn('super_user', 'boolean', [
'nullable' => false,
'default' => false
])
->addColumn('remember_token', 'string', [
'nullable' => true,
'default' => null,
'size' => 255
])
->addColumn('created_at', 'datetime', [
'nullable' => false,
'default' => null
])
->addColumn('updated_at', 'datetime', [
'nullable' => false,
'default' => null
])
->addColumn('phone', 'string', [
'nullable' => false,
'default' => null,
'size' => 255
])
->setPrimaryKeys(["id"])
->create();
$this->table('categories')
->addColumn('id', 'bigPrimary', [
'nullable' => false,
'default' => null
])
->addColumn('parent_id', 'bigInteger', [
'nullable' => true,
'default' => null
])
->addColumn('lft', 'integer', [
'nullable' => true,
'default' => null
])
->addColumn('rgt', 'integer', [
'nullable' => true,
'default' => null
])
->addColumn('depth', 'integer', [
'nullable' => true,
'default' => null
])
->addColumn('image_id', 'bigInteger', [
'nullable' => true,
'default' => null
])
->addColumn('created_at', 'datetime', [
'nullable' => false,
'default' => null
])
->addColumn('updated_at', 'datetime', [
'nullable' => false,
'default' => null
])
->addIndex(["parent_id"], [
'name' => 'categories_index_parent_id_6035f3284ee0c',
'unique' => false
])
->addForeignKey(["parent_id"], 'categories', ["id"], [
'name' => 'categories_foreign_parent_id_6035f3284ee12',
'delete' => 'CASCADE',
'update' => 'CASCADE'
])
->setPrimaryKeys(["id"])
->create();
$this->table('roots')
->addColumn('id', 'bigPrimary', [
'nullable' => false,
'default' => null
])
->addColumn('slug', 'string', [
'nullable' => false,
'default' => null,
'size' => 255
])
->addColumn('title', 'text', [
'nullable' => false,
'default' => null
])
->addColumn('config', 'text', [
'nullable' => true,
'default' => null
])
->addColumn('created_at', 'datetime', [
'nullable' => false,
'default' => null
])
->addColumn('updated_at', 'datetime', [
'nullable' => false,
'default' => null
])
->addIndex(["slug"], [
'name' => 'roots_index_slug_6035f3285030b',
'unique' => true
])
->setPrimaryKeys(["id"])
->create();
$this->table('posts')
->addColumn('id', 'bigPrimary', [
'nullable' => false,
'default' => null
])
->addColumn('user_id', 'bigInteger', [
'nullable' => true,
'default' => null
])
->addColumn('category_id', 'bigInteger', [
'nullable' => true,
'default' => null
])
->addColumn('root_id', 'bigInteger', [
'nullable' => false,
'default' => null
])
->addColumn('meta', 'text', [
'nullable' => true,
'default' => null
])
->addColumn('newsletter_enabled', 'boolean', [
'nullable' => false,
'default' => false
])
->addColumn('publish_from', 'datetime', [
'nullable' => true,
'default' => null
])
->addColumn('publish_till', 'datetime', [
'nullable' => true,
'default' => null
])
->addColumn('deleted_at', 'datetime', [
'nullable' => true,
'default' => null
])
->addColumn('display_date', 'datetime', [
'nullable' => true,
'default' => null
])
->addColumn('created_at', 'datetime', [
'nullable' => false,
'default' => null
])
->addColumn('updated_at', 'datetime', [
'nullable' => false,
'default' => null
])
->addIndex(["user_id"], [
'name' => 'posts_index_user_id_6035f3284e0e5',
'unique' => false
])
->addIndex(["category_id"], [
'name' => 'posts_index_category_id_6035f3284e24d',
'unique' => false
])
->addIndex(["root_id"], [
'name' => 'posts_index_root_id_6035f3284e276',
'unique' => false
])
->addForeignKey(["user_id"], 'users', ["id"], [
'name' => 'posts_foreign_user_id_6035f3284e0f6',
'delete' => 'CASCADE',
'update' => 'CASCADE'
])
->addForeignKey(["category_id"], 'categories', ["id"], [
'name' => 'posts_foreign_category_id_6035f3284e254',
'delete' => 'CASCADE',
'update' => 'CASCADE'
])
->addForeignKey(["root_id"], 'roots', ["id"], [
'name' => 'posts_foreign_root_id_6035f3284e27c',
'delete' => 'CASCADE',
'update' => 'CASCADE'
])
->setPrimaryKeys(["id"])
->create();
$this->table('product_categories')
->addColumn('id', 'bigPrimary', [
'nullable' => false,
'default' => null
])
->addColumn('parent_id', 'bigInteger', [
'nullable' => true,
'default' => null
])
->addColumn('lft', 'integer', [
'nullable' => true,
'default' => null
])
->addColumn('rgt', 'integer', [
'nullable' => true,
'default' => null
])
->addColumn('depth', 'integer', [
'nullable' => true,
'default' => null
])
->addColumn('slug', 'string', [
'nullable' => false,
'default' => null,
'size' => 255
])
->addColumn('typeshow', 'string', [
'nullable' => true,
'default' => null,
'size' => 255
])
->addColumn('yaml', 'boolean', [
'nullable' => false,
'default' => true
])
->addColumn('yml_pulscen', 'boolean', [
'nullable' => false,
'default' => false
])
->addColumn('feed', 'boolean', [
'nullable' => false,
'default' => false
])
->addColumn('created_at', 'datetime', [
'nullable' => false,
'default' => null
])
->addColumn('updated_at', 'datetime', [
'nullable' => false,
'default' => null
])
->addColumn('status', 'boolean', [
'nullable' => false,
'default' => true
])
->addColumn('yml_pulscen_sh', 'boolean', [
'nullable' => false,
'default' => false
])
->addIndex(["parent_id"], [
'name' => 'product_categories_index_parent_id_6035f3284ea1d',
'unique' => false
])
->addIndex(["slug"], [
'name' => 'product_categories_index_slug_6035f3285078b',
'unique' => true
])
->addIndex(["status"], [
'name' => 'product_categories_index_status_6035f32850792',
'unique' => false
])
->addForeignKey(["parent_id"], 'product_categories', ["id"], [
'name' => 'product_categories_foreign_parent_id_6035f3284ea22',
'delete' => 'CASCADE',
'update' => 'CASCADE'
])
->setPrimaryKeys(["id"])
->create();
$this->table('product_category_nodes')
->addColumn('id', 'bigPrimary', [
'nullable' => false,
'default' => null
])
->addColumn('product_category_id', 'bigInteger', [
'nullable' => false,
'default' => null
])
->addColumn('language_id', 'string', [
'nullable' => false,
'default' => null,
'size' => 255
])
->addColumn('title', 'string', [
'nullable' => false,
'default' => null,
'size' => 255
])
->addColumn('content', 'longText', [
'nullable' => false,
'default' => null
])
->addColumn('created_at', 'datetime', [
'nullable' => false,
'default' => null
])
->addColumn('updated_at', 'datetime', [
'nullable' => false,
'default' => null
])
->addColumn('seo_title', 'string', [
'nullable' => true,
'default' => null,
'size' => 255
])
->addColumn('seo_description', 'string', [
'nullable' => true,
'default' => null,
'size' => 255
])
->addColumn('seo_keywords', 'string', [
'nullable' => true,
'default' => null,
'size' => 255
])
->addIndex(["product_category_id"], [
'name' => 'product_category_nodes_index_product_category_id_6035f3284e2fc',
'unique' => false
])
->addIndex(["product_category_id", "language_id"], [
'name' => '8d0bc3ff7fb66e467d724726766e1215',
'unique' => true
])
->addForeignKey(["product_category_id"], 'product_categories', ["id"], [
'name' => 'product_category_nodes_foreign_product_category_id_6035f3284e301',
'delete' => 'CASCADE',
'update' => 'CASCADE'
])
->setPrimaryKeys(["id"])
->create();
$this->table('tags')
->addColumn('id', 'bigPrimary', [
'nullable' => false,
'default' => null
])
->addColumn('slug', 'string', [
'nullable' => false,
'default' => null,
'size' => 255
])
->addColumn('status', 'boolean', [
'nullable' => false,
'default' => true
])
->addColumn('created_at', 'datetime', [
'nullable' => false,
'default' => null
])
->addColumn('updated_at', 'datetime', [
'nullable' => false,
'default' => null
])
->addColumn('parent_id', 'bigInteger', [
'nullable' => true,
'default' => null
])
->addColumn('parent_role', 'string', [
'nullable' => true,
'default' => null,
'size' => 32
])
->addIndex(["parent_id", "parent_role"], [
'name' => 'tags_index_parent_id_parent_role_6035f3284e2ed',
'unique' => false
])
->addIndex(["status"], [
'name' => 'tags_index_status_6035f328509e9',
'unique' => false
])
->addIndex(["slug"], [
'name' => 'tags_index_slug_6035f328509ef',
'unique' => false
])
->setPrimaryKeys(["id"])
->create();
$this->table('tag_nodes')
->addColumn('id', 'bigPrimary', [
'nullable' => false,
'default' => null
])
->addColumn('tag_id', 'bigInteger', [
'nullable' => false,
'default' => null
])
->addColumn('language_id', 'string', [
'nullable' => false,
'default' => null,
'size' => 255
])
->addColumn('title', 'string', [
'nullable' => false,
'default' => null,
'size' => 255
])
->addColumn('content', 'longText', [
'nullable' => true,
'default' => null
])
->addColumn('created_at', 'datetime', [
'nullable' => false,
'default' => null
])
->addColumn('updated_at', 'datetime', [
'nullable' => false,
'default' => null
])
->addColumn('seo_title', 'string', [
'nullable' => true,
'default' => null,
'size' => 255
])
->addColumn('seo_description', 'string', [
'nullable' => true,
'default' => null,
'size' => 255
])
->addColumn('seo_keywords', 'string', [
'nullable' => true,
'default' => null,
'size' => 255
])
->addIndex(["tag_id"], [
'name' => 'tag_nodes_index_tag_id_6035f3284e321',
'unique' => false
])
->addIndex(["tag_id", "language_id"], [
'name' => 'tag_nodes_index_tag_id_language_id_6035f3284f526',
'unique' => true
])
->addForeignKey(["tag_id"], 'tags', ["id"], [
'name' => 'tag_nodes_foreign_tag_id_6035f3284e326',
'delete' => 'CASCADE',
'update' => 'CASCADE'
])
->setPrimaryKeys(["id"])
->create();
}
public function down(): void
{
$this->table('tag_nodes')->drop();
$this->table('tags')->drop();
$this->table('product_category_nodes')->drop();
$this->table('product_categories')->drop();
$this->table('posts')->drop();
$this->table('roots')->drop();
$this->table('categories')->drop();
$this->table('users')->drop();
}
}