How to create boolean column in Magento2 using db_schema.xml
In your db_schema.xml file which should be inside Magesan/Extension/etc/db_schema.xml
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
<table name="tableName" resource="default" engine="innodb" comment="Table Comment">
<column xsi:type="boolean" name="columnName" nullable="false" comment="column comment" />
</table>
</schema>
Save the file.
You just only need to fire php bin/magento setup:upgrade command and you will see the column will added to table.
Happy Coding…