ALTER TABLE `tblstaff_app_usage_data` CHANGE `mobile_type` `mobile_type` ENUM('android','ios','web') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL;

CREATE TABLE `tblstaff_invites` (
    `id` BIGINT(20) NOT NULL AUTO_INCREMENT,
    `tenant_id` BIGINT(20) UNSIGNED NOT NULL,
    `staff_id` BIGINT(20) UNSIGNED NOT NULL,
    `email` VARCHAR(500) NOT NULL,
    `code` VARCHAR(500) NOT NULL,
    `added_on` DATETIME NOT NULL,
    PRIMARY KEY (`id`),
    FOREIGN KEY (tenant_id) REFERENCES tbltenants(id) ON DELETE CASCADE ON UPDATE CASCADE,
    FOREIGN KEY (staff_id) REFERENCES tblstaff(staffid) ON DELETE CASCADE ON UPDATE CASCADE,
    INDEX (`email`),
    INDEX (`code`)
) engine = innodb;

INSERT INTO tblapad_emailtemplates (type, slug, language, name, subject, message, active, fromname, `order`)
VALUES('staff', 'invite-team-member', 'english', 'Invite Team Member', '{staff_first_name} has invited you to work with them in Contractor+', '<h3>Join your team on Contractor+</h3><span style="font-size: 12pt;">{staff_name} ({staff_email}) has invited you to use Contractor+ with them, in a company called <b>{company_name}.</b></span><br/><br/><div class="o_col_i" style="vertical-align: top;"><div class="o_px-xs" style="padding-left: 8px;padding-right: 8px;"><table align="center" cellspacing="0" cellpadding="0" border="0" role="presentation"><tbody><tr><td class="o_btn o_bg-primary o_br o_heading o_text" align="center" style="font-family: Helvetica, Arial, sans-serif;font-weight: bold;margin-top: 0px;margin-bottom: 0px;font-size: 16px;line-height: 24px;mso-padding-alt: 12px 24px;background-color: #C81E1E;border-radius: 4px;"><a class="o_text-white" href="{invite_url}" style="color: #ffffff !important;text-decoration: none;outline: none;color: #ffffff;display: block;padding: 12px 24px;mso-text-raise: 3px;">JOIN NOW</a></td></tr></tbody></table></div></div><br/><span style="font-size: 12pt;"><b>What is Contractor+?</b></span><br/><span style="font-size: 12pt;">Contractor+ is a complete field service management app Solution that helps you manage your client relationships and work productively as a team. All your estimates, invoices, client contracts, post-inspections, and everything else you need to run your business is accessible in one dashboard like it should be. <a href="{cp_website}">Learn More About Contractor+.</a></span>', 1, '', 0);