UltimateModuleCreator / umc

Magento 2 Ultimate Module Creator
MIT License
58 stars 10 forks source link

SQL Error in setup:upgrade #31

Closed swaibar closed 4 years ago

swaibar commented 4 years ago

If the names of the modules and entities are not single words there are errors in the table names and fails to setup:upgrade making a table name that is used unquoted

use the entity name like "entity name" for the entity and a table name like "company_module_entity _name" is created... then in... Magento\Framework\Setup\Declaration\Schema\Db\MySQL\DbSchemaReader::readIndexes

there is where it is used unquoted...

$sql = sprintf('SHOW INDEXES FROM %s WHERE %s', $tableName, $condition);

UltimateModuleCreator commented 4 years ago

Some validation was added. Honestly I don't want to make this bullet proof. It's a tool intended for developers not for general public use. If you don't use spaces in the entity name it should work as expected.