Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shopware 6: Can't migrate database

I've followed the following tutorial for creating a custom entity on my own in shopware 6:

https://www.youtube.com/watch?v=mTHTyof4gPk

I created a migration by using

bin/console database:create-migration

and added the following code:

$sql = <<<SQL
CREATE TABLE IF NOT EXISTS  'applicationmanagement' (
    'id' BINARY(26) NOT NULL,
    'name' VARCHAR (255) COLLATE utf8mb4_unicode_ci,
    'created_at' DATETIME(3) NOT NULL,
    'update_at' DATETIME(3),
    PRIMARY KEY ('id')
)
    ENGINE = InnoDB
    DEFAULT CHARSET = utf8mb4
    COLLATE = utf8mb4_unicaode_ci;
SQL;

$connection->executeUpdate($sql);

When I try to execute the migration by using

bin/console database:migrate PluginName --all

I get the following note

Get collection for identifier: "PluginName"

 ! [NOTE] No collection found for identifier: "PluginName", continuing   

I tried reinstall and refresh the plugin but it didn't do anything.

Can someone help me fix this problem?

like image 767
NixH Avatar asked Jun 09 '26 19:06

NixH


2 Answers

I just had the same problem. What helped me was to clear the cache

bin/console cache:clear
like image 105
MilMike Avatar answered Jun 12 '26 12:06

MilMike


I solved it by uninstalling the plugin, refreshing the plugins and after that installing and activating my plugin

like image 21
NixH Avatar answered Jun 12 '26 12:06

NixH