None #10158
closedNew Feature #10155: Apple Volume purchasing program - VPP
CRUDs for the the VPP syncing tables
100%
Description
Using the following table structure, write the DAO layer
-- -----------------------------------------------------
-- Table `VPP`.`VPP_USER`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `VPP_USER` (
`ID` INT NOT NULL AUTO_INCREMENT,
`CLIENT_USER_ID` VARCHAR NULL,
`DM_USERNAME` VARCHAR NOT NULL,
`TENANT_ID` VARCHAR NOT NULL,
`EMAIL` VARCHAR NULL,
`INVITE_CODE` VARCHAR NULL,
`STATUS` VARCHAR NULL,
`CREATED_TIME` BIGINT NULL,
`LAST_UPDATED_TIME` BIGINT NULL,
`MANAGED_ID` VARCHAR NULL,
`TEMP_PASSWORD` VARCHAR NULL,
PRIMARY KEY (`ID`));
-- -----------------------------------------------------
-- Table `VPP`.`ASSETS`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `ASSETS` (
`ID` INT NOT NULL AUTO_INCREMENT,
`ADAM_ID` VARCHAR NULL,
`APP_ID` INT NULL,
`ASSIGNED_COUNT` INT NULL,
`DEVICE_ASSIGNABLE` TINYINT NULL,
`PRICING_PARAMS` VARCHAR NULL,
`PRODUCT_TYPE` VARCHAR NULL,
`RETIRED_COUNT` INT NULL,
`REVOCABLE` TINYINT NULL,
`TENANT_ID` VARCHAR NOT NULL,
`SUPPORTED_PLATFORMS` VARCHAR NULL,
PRIMARY KEY (`ID`));
-- -----------------------------------------------------
-- Table `VPP`.`VPP_ASSOCIATION`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `VPP_ASSOCIATION` (
`ID` INT NOT NULL AUTO_INCREMENT,
`ASSET_ID` INT,
`USER_ID` INT,
`TENANT_ID` VARCHAR NOT NULL,
`ASSOCIATION_TYPE` VARCHAR NOT NULL,
`PRICING_PARAMS` VARCHAR NULL,
PRIMARY KEY (`ID`),
CONSTRAINT AP_VPP_ASSETS_fk FOREIGN KEY (ASSET_ID) REFERENCES ASSETS (ID) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT AP_VPP_VPP_USER_fk FOREIGN KEY (USER_ID) REFERENCES VPP_USER (ID) ON DELETE CASCADE ON UPDATE CASCADE
);