Starting database setup
Checking table: links
Checking table: perm_group_to_resource
Checking table: perm_resources
Checking table: perm_roles_to_resource
Checking table: perm_roles
Checking table: perm_user_to_resource
Checking table: perm_user_to_role
Checking table: tbl_AbuseReport
Checking table: tbl_AptCancel
Table (tbl_AptCancel) column MemberIDs have different types(varchar(5000) NULL != varchar(MAX) NULL)
Table (tbl_AptCancel) column Notes have different types(varchar(-1) NULL != varchar(MAX) NULL)
Table tbl_AptCancel contains more fields than its model.(MemberID)
Checking table: tbl_CareTeamRole
Checking table: tbl_CheckIn
Table (tbl_CheckIn) column Room have different types(nvarchar(5) NULL != nvarchar(15) NULL)
Table (tbl_CheckIn) column Notes have different types(varchar(-1) NULL != varchar(MAX) NULL)
Table (tbl_CheckIn) column InNotes have different types(varchar(-1) NULL != varchar(MAX) NULL)
Checking table: tbl_CheckInStatus
Checking table: tbl_Client
Table tbl_Client contains more fields than its model.(ChildName)
Checking table: tbl_ClientChild
Checking table: tbl_ClientMember
Table tbl_ClientMember contains more fields than its model.(RoleID,StartDate,EndDate)
Checking table: tbl_ClientPickup
Table (tbl_ClientPickup) column CompanyID have different types(int NULL != int)
Checking table: tbl_Company
Checking table: tbl_CompanyCalendar
Checking table: tbl_CompanyCalendarDuration
Checking table: tbl_CompanyCalendarType
Checking table: tbl_CompanyWorkingHours
Table (tbl_CompanyWorkingHours) column DayName have different types(nvarchar(12) NULL != nvarchar(30) NULL)
Checking table: tbl_Contact
Table (tbl_Contact) column CompanyID have different types(int NULL != int)
Table (tbl_Contact) column FirebaseToken have different types(nvarchar(2000) NULL != nvarchar(2000))
Checking table: tbl_ContactGroups
Checking table: tbl_ContactInGroup
Checking table: tbl_Country
Checking table: tbl_Department
Table (tbl_Department) column CompanyID have different types(int NULL != int)
Checking table: tbl_DirectMessage
Checking table: tbl_Documentation
Table (tbl_Documentation) column IsPublic have different types(bit NULL != bit)
Table tbl_Documentation contains more fields than its model.(DocumentTypeID)
Checking table: tbl_DocumentationCategory
Table (tbl_DocumentationCategory) column CompanyID have different types(int NULL != int)
Table tbl_DocumentationCategory contains more fields than its model.(IsEnabled,ParentCategoryID)
Checking table: tbl_Group
Checking table: tbl_GroupMember
Checking table: tbl_GroupMessage
Table (tbl_GroupMessage) column GroupID have different types(int NULL != int)
Checking table: tbl_GroupMessageLike
Checking table: tbl_Member
Checking table: tbl_Role
Checking table: tbl_ScheduleItem
Table (tbl_ScheduleItem) column ScheduleItemStatus have different types(int NULL != int)
Table (tbl_ScheduleItem) column IsParentScheduled have different types(int NULL != int)
Table tbl_ScheduleItem contains more fields than its model.(Date)
Checking table: tbl_ScheduleLocation
Checking table: tbl_ScheduleReports
Checking table: tbl_ScheduleType
Checking table: tbl_State
Checking table: tbl_Subscription
Checking table: tbl_SupportAdding constraints...
Constraint errorSQLSTATE[HY000]: General error: 20018 Could not drop constraint. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_AbuseReport DROP CONSTRAINT FK_CompanyID]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not create constraint or index. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_AbuseReport ADD CONSTRAINT FK_CompanyID FOREIGN KEY (CompanyID) REFERENCES tbl_Company(CompanyID)]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not drop constraint. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_AbuseReport DROP CONSTRAINT FK_ContactID]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not create constraint or index. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_AbuseReport ADD CONSTRAINT FK_ContactID FOREIGN KEY (ContactID) REFERENCES tbl_Contact(ContactID)]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not drop constraint. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_AptCancel DROP CONSTRAINT FK_CompanyID]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not create constraint or index. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_AptCancel ADD CONSTRAINT FK_CompanyID FOREIGN KEY (CompanyID) REFERENCES tbl_Company(CompanyID)]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not drop constraint. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_AptCancel DROP CONSTRAINT FK_ClientChildID]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not create constraint or index. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_AptCancel ADD CONSTRAINT FK_ClientChildID FOREIGN KEY (ClientChildID) REFERENCES tbl_ClientChild(ClientChildID)]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not drop constraint. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_AptCancel DROP CONSTRAINT FK_MemberID]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not create constraint or index. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_AptCancel ADD CONSTRAINT FK_MemberID FOREIGN KEY (MemberID) REFERENCES tbl_Member(MemberID)]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not drop constraint. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_CheckIn DROP CONSTRAINT FK_ChildID]Constraint errorSQLSTATE[HY000]: General error: 20018 The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "FK_ChildID". The conflict occurred in database "KpCommDB", table "dbo.tbl_ClientChild", column 'ClientChildID'. [20018] (severity 16) [ALTER TABLE tbl_CheckIn ADD CONSTRAINT FK_ChildID FOREIGN KEY (ChildID) REFERENCES tbl_ClientChild(ClientChildID)]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not drop constraint. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_Client DROP CONSTRAINT FK_CompanyID]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not create constraint or index. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_Client ADD CONSTRAINT FK_CompanyID FOREIGN KEY (CompanyID) REFERENCES tbl_Company(CompanyID)]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not drop constraint. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_ClientChild DROP CONSTRAINT FK_ClientID]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not create constraint or index. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_ClientChild ADD CONSTRAINT FK_ClientID FOREIGN KEY (ClientID) REFERENCES tbl_Client(ClientID)]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not drop constraint. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_CompanyCalendar DROP CONSTRAINT FK_CompanyID]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not create constraint or index. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_CompanyCalendar ADD CONSTRAINT FK_CompanyID FOREIGN KEY (CompanyID) REFERENCES tbl_Company(CompanyID)]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not drop constraint. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_CompanyCalendar DROP CONSTRAINT FK_ClientID]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not create constraint or index. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_CompanyCalendar ADD CONSTRAINT FK_ClientID FOREIGN KEY (ClientID) REFERENCES tbl_Client(ClientID)]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not drop constraint. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_CompanyCalendar DROP CONSTRAINT FK_MemberID]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not create constraint or index. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_CompanyCalendar ADD CONSTRAINT FK_MemberID FOREIGN KEY (MemberID) REFERENCES tbl_Member(MemberID)]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not drop constraint. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_CompanyWorkingHours DROP CONSTRAINT FK_CompanyID]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not create constraint or index. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_CompanyWorkingHours ADD CONSTRAINT FK_CompanyID FOREIGN KEY (CompanyID) REFERENCES tbl_Company(CompanyID)]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not drop constraint. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_Contact DROP CONSTRAINT FK_CompanyID]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not create constraint or index. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_Contact ADD CONSTRAINT FK_CompanyID FOREIGN KEY (CompanyID) REFERENCES tbl_Company(CompanyID)]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not drop constraint. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_ContactInGroup DROP CONSTRAINT FK_ContactID]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not create constraint or index. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_ContactInGroup ADD CONSTRAINT FK_ContactID FOREIGN KEY (ContactID) REFERENCES tbl_Contact(ContactID)]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not drop constraint. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_Department DROP CONSTRAINT FK_CompanyID]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not create constraint or index. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_Department ADD CONSTRAINT FK_CompanyID FOREIGN KEY (CompanyID) REFERENCES tbl_Company(CompanyID)]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not drop constraint. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_Group DROP CONSTRAINT FK_CompanyID]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not create constraint or index. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_Group ADD CONSTRAINT FK_CompanyID FOREIGN KEY (CompanyID) REFERENCES tbl_Company(CompanyID)]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not drop constraint. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_GroupMember DROP CONSTRAINT FK_CompanyID]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not create constraint or index. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_GroupMember ADD CONSTRAINT FK_CompanyID FOREIGN KEY (CompanyID) REFERENCES tbl_Company(CompanyID)]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not drop constraint. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_GroupMember DROP CONSTRAINT FK_GroupID]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not create constraint or index. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_GroupMember ADD CONSTRAINT FK_GroupID FOREIGN KEY (GroupID) REFERENCES tbl_Group(GroupID)]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not drop constraint. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_GroupMember DROP CONSTRAINT FK_ContactID]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not create constraint or index. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_GroupMember ADD CONSTRAINT FK_ContactID FOREIGN KEY (ContactID) REFERENCES tbl_Contact(ContactID)]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not drop constraint. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_GroupMessage DROP CONSTRAINT FK_CompanyID]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not create constraint or index. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_GroupMessage ADD CONSTRAINT FK_CompanyID FOREIGN KEY (CompanyID) REFERENCES tbl_Company(CompanyID)]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not drop constraint. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_GroupMessageLike DROP CONSTRAINT FK_GroupMessageID]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not create constraint or index. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_GroupMessageLike ADD CONSTRAINT FK_GroupMessageID FOREIGN KEY (GroupMessageID) REFERENCES tbl_GroupMessage(GroupMessageID)]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not drop constraint. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_Member DROP CONSTRAINT FK_CompanyID]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not create constraint or index. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_Member ADD CONSTRAINT FK_CompanyID FOREIGN KEY (CompanyID) REFERENCES tbl_Company(CompanyID)]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not drop constraint. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_ScheduleItem DROP CONSTRAINT FK_CompanyID]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not create constraint or index. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_ScheduleItem ADD CONSTRAINT FK_CompanyID FOREIGN KEY (CompanyID) REFERENCES tbl_Company(CompanyID)]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not drop constraint. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_ScheduleItem DROP CONSTRAINT FK_ClientID]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not create constraint or index. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_ScheduleItem ADD CONSTRAINT FK_ClientID FOREIGN KEY (ClientID) REFERENCES tbl_Client(ClientID)]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not drop constraint. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_ScheduleItem DROP CONSTRAINT FK_MemberID]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not create constraint or index. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_ScheduleItem ADD CONSTRAINT FK_MemberID FOREIGN KEY (MemberID) REFERENCES tbl_Member(MemberID)]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not drop constraint. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_ScheduleLocation DROP CONSTRAINT FK_CompanyID]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not create constraint or index. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_ScheduleLocation ADD CONSTRAINT FK_CompanyID FOREIGN KEY (CompanyID) REFERENCES tbl_Company(CompanyID)]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not drop constraint. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_ScheduleReports DROP CONSTRAINT FK_CompanyID]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not create constraint or index. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_ScheduleReports ADD CONSTRAINT FK_CompanyID FOREIGN KEY (CompanyID) REFERENCES tbl_Company(CompanyID)]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not drop constraint. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_ScheduleType DROP CONSTRAINT FK_CompanyID]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not create constraint or index. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_ScheduleType ADD CONSTRAINT FK_CompanyID FOREIGN KEY (CompanyID) REFERENCES tbl_Company(CompanyID)]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not drop constraint. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_Subscription DROP CONSTRAINT FK_CompanyID]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not create constraint or index. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_Subscription ADD CONSTRAINT FK_CompanyID FOREIGN KEY (CompanyID) REFERENCES tbl_Company(CompanyID)]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not drop constraint. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_Support DROP CONSTRAINT FK_CompanyID]Constraint errorSQLSTATE[HY000]: General error: 20018 Could not create constraint or index. See previous errors. [20018] (severity 16) [ALTER TABLE tbl_Support ADD CONSTRAINT FK_CompanyID FOREIGN KEY (CompanyID) REFERENCES tbl_Company(CompanyID)]Constraint errorSQLSTATE[HY000]: General error: 20018 Cannot find the object "tbl_Contacts" because it does not exist or you do not have permissions. [20018] (severity 16) [ALTER TABLE tbl_Contacts DROP CONSTRAINT FK_UserID]Constraint errorSQLSTATE[HY000]: General error: 20018 Cannot find the object "tbl_Contacts" because it does not exist or you do not have permissions. [20018] (severity 16) [ALTER TABLE tbl_Contacts ADD CONSTRAINT FK_UserID FOREIGN KEY (UserID) REFERENCES oauth_users(user_id)]