Skip to content

can not create db_schema_whitelist.json file in magento 2.4.4

I have issue to create custom mysql table from xml schema.

i have create app/code/Vendor_Name/Module_Name/etc/db_schema.xml

db_schema.xml

<?xml version="1.0"?>

<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
    <table name="test_table" resource="default" engine="innodb" comment="Test blog table">
        <column xsi:type="int" name="entity_id" unsigned="true" nullable="false" identity="true"
                comment="Entity ID"/>
        <column xsi:type="varchar" name="title" length="70" nullable="false" comment="Title"/>
        <column xsi:type="timestamp" name="created_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
                comment="Creation Time"/>
        <column xsi:type="timestamp" name="updated_at" on_update="true" nullable="false" default="CURRENT_TIMESTAMP"
                comment="Update Time"/>
        <constraint xsi:type="primary" referenceId="PRIMARY">
            <column name="entity_id"/>
        </constraint>
   </table>
</schema>

After this i have execute CLI with no error but can’t create db_schema_whitelist.json in Vendor_Name/Module_name/etc folder

php bin/magento setup:db-declaration:generate-whitelist --module-name=VendorName_ModuleName

My vendor_Name/Module_Name is already enable

What i do please help!!!