klaviyo / magento2-klaviyo

37 stars 51 forks source link

Message queues db setup #140

Closed siddwarkhedkar closed 2 years ago

siddwarkhedkar commented 2 years ago

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:

extension_root
`-- Models
    |-- New_table.php
    `-- ResourceModel
        |-- New_table.php
        `-- New_table
            `-- Collection.php