Starting 2.3, Magento decided to deprecate InstallSchema/UpgradeSchema, InstallData/UpgradeData scripts to using a db_schema.xml file and call it declarative schema.
If any of our customers are using a version older than 2.3.4, they can't upgrade M2 extensions to post 3.0.5, so we decided to go ahead with implementing this approach to add new tables.
Magento suggests creating Models for each table to carry out CRUD operations on table. So each of the three tables have their own Model,ResourceModel and Collection classes.
The structure of such Models should be as follows:
Starting 2.3, Magento decided to deprecate InstallSchema/UpgradeSchema, InstallData/UpgradeData scripts to using a db_schema.xml file and call it declarative schema. If any of our customers are using a version older than 2.3.4, they can't upgrade M2 extensions to post 3.0.5, so we decided to go ahead with implementing this approach to add new tables.
Magento suggests creating Models for each table to carry out CRUD operations on table. So each of the three tables have their own Model,ResourceModel and Collection classes.
The structure of such Models should be as follows: