CREATE TABLE IF NOT EXISTS GradeObjects (
    GradeObjectId INT NOT NULL,
    OrgUnitId INT NOT NULL,
    ParentGradeObjectId INT COMMENT 'Category ID if applicable',
    Name VARCHAR(128),
    TypeName VARCHAR(50),
    StartDate DATETIME,
    EndDate DATETIME,
    IsAutoPointed TINYINT(1),
    IsFormula TINYINT(1),
    IsBonus TINYINT(1),
    MaxPoints DECIMAL(19, 9),
    CanExceedMaxGrade TINYINT(1),
    ExcludeFromFinalGradeCalc TINYINT(1),
    GradeSchemeId BIGINT,
    Weight DECIMAL(19, 9),
    NumLowestGradesToDrop INT,
    NumHighestGradesToDrop INT,
    WeightDistributionType VARCHAR(8),
    CreatedDate DATETIME,
    ToolName VARCHAR(50),
    AssociatedToolItemId BIGINT,
    LastModified DATETIME,
    ShortName VARCHAR(128),
    GradeObjectTypeId INT COMMENT '1=Numeric, 2=P/F, 3=SelectBox, 4=Text, 5=Calc, 6=Formula, 7=Final Calc, 8=Final Adj, 9=Category',
    SortOrder INT,
    IsDeleted TINYINT(1),
    DeletedDate DATETIME,
    DeletedByUserId INT,
    ResultId INT,
    ToolId INT,
    Version INT,
    PRIMARY KEY (GradeObjectId)
) CHARACTER SET utf8mb4;