Güncelleme Gerekiyor

Dikkat : Hızlı Başlangıç (Kurulum verileri yüklenmeyecek)

Ayrıntılar Dikkat! Veri kaybı yaşanmaması için veritabanı güncellemelerini dikkatli şekilde yapınız.

Update


Tenant


Güncellenecek Veritabanı Adı : mobilapp_sadikuygun
Data Source : .


SQLQUERY :
EXECUTE sp_rename @objname = N'dbo.OnlineLessons_Meeting', @newname = N'OnlineLessons_ZoomMeeting', @objtype = N'OBJECT'
IF object_id('[PK_dbo.OnlineLessons_Meeting]') IS NOT NULL BEGIN
EXECUTE sp_rename @objname = N'[PK_dbo.OnlineLessons_Meeting]', @newname = N'PK_dbo.OnlineLessons_ZoomMeeting', @objtype = N'OBJECT'
END
EXECUTE sp_rename @objname = N'dbo.OnlineLessons_MeetingUser', @newname = N'OnlineLessons_ZoomUser', @objtype = N'OBJECT'
IF object_id('[PK_dbo.OnlineLessons_MeetingUser]') IS NOT NULL BEGIN
EXECUTE sp_rename @objname = N'[PK_dbo.OnlineLessons_MeetingUser]', @newname = N'PK_dbo.OnlineLessons_ZoomUser', @objtype = N'OBJECT'
END
IF object_id(N'[dbo].[FK_dbo.Central_SystemMenuTenant_dbo.Central_SystemMenu_SystemMenuId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[Central_SystemMenuTenant] DROP CONSTRAINT [FK_dbo.Central_SystemMenuTenant_dbo.Central_SystemMenu_SystemMenuId]
IF object_id(N'[dbo].[FK_dbo.Central_School_dbo.Central_School_ParentId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[Central_School] DROP CONSTRAINT [FK_dbo.Central_School_dbo.Central_School_ParentId]
IF object_id(N'[dbo].[FK_dbo.ExamApply_ExamBook_dbo.ExamApply_ExamBranch_ExamBranchId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[ExamApply_ExamBook] DROP CONSTRAINT [FK_dbo.ExamApply_ExamBook_dbo.ExamApply_ExamBranch_ExamBranchId]
IF object_id(N'[dbo].[FK_dbo.MobileApp_Activity_dbo.MobileApp_Position_PositionId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[MobileApp_Activity] DROP CONSTRAINT [FK_dbo.MobileApp_Activity_dbo.MobileApp_Position_PositionId]
IF object_id(N'[dbo].[FK_dbo.MobileApp_Choice_dbo.MobileApp_Position_PositionId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[MobileApp_Choice] DROP CONSTRAINT [FK_dbo.MobileApp_Choice_dbo.MobileApp_Position_PositionId]
IF object_id(N'[dbo].[FK_dbo.MobileApp_Choice_dbo.Attachments_Attachment_SolutionAttachmentId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[MobileApp_Choice] DROP CONSTRAINT [FK_dbo.MobileApp_Choice_dbo.Attachments_Attachment_SolutionAttachmentId]
IF object_id(N'[dbo].[FK_dbo.MobileApp_ChoiceMap_dbo.MobileApp_Choice_SourceId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[MobileApp_ChoiceMap] DROP CONSTRAINT [FK_dbo.MobileApp_ChoiceMap_dbo.MobileApp_Choice_SourceId]
IF object_id(N'[dbo].[FK_dbo.MobileApp_ChoiceMap_dbo.MobileApp_Choice_TargetId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[MobileApp_ChoiceMap] DROP CONSTRAINT [FK_dbo.MobileApp_ChoiceMap_dbo.MobileApp_Choice_TargetId]
IF object_id(N'[dbo].[FK_dbo.MobileApp_QuestionFile_dbo.Attachments_Attachment_FileId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[MobileApp_QuestionFile] DROP CONSTRAINT [FK_dbo.MobileApp_QuestionFile_dbo.Attachments_Attachment_FileId]
IF object_id(N'[dbo].[FK_dbo.MobileApp_QuestionFile_dbo.MobileApp_Position_PositionId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[MobileApp_QuestionFile] DROP CONSTRAINT [FK_dbo.MobileApp_QuestionFile_dbo.MobileApp_Position_PositionId]
IF object_id(N'[dbo].[FK_dbo.MobileApp_QuestionFile_dbo.MobileApp_Question_QuestionId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[MobileApp_QuestionFile] DROP CONSTRAINT [FK_dbo.MobileApp_QuestionFile_dbo.MobileApp_Question_QuestionId]
IF object_id(N'[dbo].[FK_dbo.MobileApp_Question_dbo.MobileApp_Position_PositionId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[MobileApp_Question] DROP CONSTRAINT [FK_dbo.MobileApp_Question_dbo.MobileApp_Position_PositionId]
IF object_id(N'[dbo].[FK_dbo.MobileApp_Question_dbo.MobileApp_Position_RootPositionId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[MobileApp_Question] DROP CONSTRAINT [FK_dbo.MobileApp_Question_dbo.MobileApp_Position_RootPositionId]
IF object_id(N'[dbo].[FK_dbo.MobileApp_Question_dbo.MobileApp_QuestionSetting_SettingId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[MobileApp_Question] DROP CONSTRAINT [FK_dbo.MobileApp_Question_dbo.MobileApp_QuestionSetting_SettingId]
IF object_id(N'[dbo].[FK_dbo.MobileApp_Question_dbo.MobileApp_Solution_SolutionId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[MobileApp_Question] DROP CONSTRAINT [FK_dbo.MobileApp_Question_dbo.MobileApp_Solution_SolutionId]
IF object_id(N'[dbo].[FK_dbo.MobileApp_BookFile_dbo.MobileApp_AppBook_BookId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[MobileApp_BookFile] DROP CONSTRAINT [FK_dbo.MobileApp_BookFile_dbo.MobileApp_AppBook_BookId]
IF object_id(N'[dbo].[FK_dbo.MobileApp_BookFile_dbo.Attachments_Attachment_FileId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[MobileApp_BookFile] DROP CONSTRAINT [FK_dbo.MobileApp_BookFile_dbo.Attachments_Attachment_FileId]
IF object_id(N'[dbo].[FK_dbo.MobileApp_BookFileRole_dbo.MobileApp_BookFile_BookFileId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[MobileApp_BookFileRole] DROP CONSTRAINT [FK_dbo.MobileApp_BookFileRole_dbo.MobileApp_BookFile_BookFileId]
IF object_id(N'[dbo].[FK_dbo.MobileApp_BookFileRole_dbo.Central_Role_RoleId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[MobileApp_BookFileRole] DROP CONSTRAINT [FK_dbo.MobileApp_BookFileRole_dbo.Central_Role_RoleId]
IF object_id(N'[dbo].[FK_dbo.MobileApp_AppBook_dbo.MobileApp_BookKind_BookKindId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[MobileApp_AppBook] DROP CONSTRAINT [FK_dbo.MobileApp_AppBook_dbo.MobileApp_BookKind_BookKindId]
IF object_id(N'[dbo].[FK_dbo.MobileApp_TenantBook_dbo.MobileApp_AppBook_BookId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[MobileApp_TenantBook] DROP CONSTRAINT [FK_dbo.MobileApp_TenantBook_dbo.MobileApp_AppBook_BookId]
IF object_id(N'[dbo].[FK_dbo.MobileApp_TenantBook_dbo.Attachments_Attachment_CoverImageId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[MobileApp_TenantBook] DROP CONSTRAINT [FK_dbo.MobileApp_TenantBook_dbo.Attachments_Attachment_CoverImageId]
IF object_id(N'[dbo].[FK_dbo.MobileApp_TenantBook_dbo.Central_Tenant_TenantId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[MobileApp_TenantBook] DROP CONSTRAINT [FK_dbo.MobileApp_TenantBook_dbo.Central_Tenant_TenantId]
IF object_id(N'[dbo].[FK_dbo.MobileApp_BookTheme_dbo.MobileApp_AppBook_BookId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[MobileApp_BookTheme] DROP CONSTRAINT [FK_dbo.MobileApp_BookTheme_dbo.MobileApp_AppBook_BookId]
IF object_id(N'[dbo].[FK_dbo.MobileApp_BookTheme_dbo.MobileApp_Theme_ThemeId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[MobileApp_BookTheme] DROP CONSTRAINT [FK_dbo.MobileApp_BookTheme_dbo.MobileApp_Theme_ThemeId]
IF object_id(N'[dbo].[FK_dbo.MobileApp_TryingExamPlanClassRoom_dbo.MobileApp_TryingExamPlan_PlanId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[MobileApp_TryingExamPlanClassRoom] DROP CONSTRAINT [FK_dbo.MobileApp_TryingExamPlanClassRoom_dbo.MobileApp_TryingExamPlan_PlanId]
IF object_id(N'[dbo].[FK_dbo.SmartBook_LibraryApp_dbo.Attachments_Attachment_AppAttachmentId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[SmartBook_LibraryApp] DROP CONSTRAINT [FK_dbo.SmartBook_LibraryApp_dbo.Attachments_Attachment_AppAttachmentId]
IF object_id(N'[dbo].[FK_dbo.SmartBook_LibraryApp_dbo.Central_Tenant_TenantId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[SmartBook_LibraryApp] DROP CONSTRAINT [FK_dbo.SmartBook_LibraryApp_dbo.Central_Tenant_TenantId]
IF object_id(N'[dbo].[FK_dbo.Dealers_DealerSchool_dbo.Central_School_SchoolId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[Dealers_DealerSchool] DROP CONSTRAINT [FK_dbo.Dealers_DealerSchool_dbo.Central_School_SchoolId]
IF object_id(N'[dbo].[FK_dbo.Dealers_DealerSchool_dbo.Dealers_Dealer_DealerId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[Dealers_DealerSchool] DROP CONSTRAINT [FK_dbo.Dealers_DealerSchool_dbo.Dealers_Dealer_DealerId]
IF object_id(N'[dbo].[FK_dbo.Dealers_DealerUser_dbo.Central_User_UserId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[Dealers_DealerUser] DROP CONSTRAINT [FK_dbo.Dealers_DealerUser_dbo.Central_User_UserId]
IF object_id(N'[dbo].[FK_dbo.Dealers_DealerUser_dbo.Dealers_Dealer_DealerId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[Dealers_DealerUser] DROP CONSTRAINT [FK_dbo.Dealers_DealerUser_dbo.Dealers_Dealer_DealerId]
IF object_id(N'[dbo].[FK_dbo.Dealers_DealerFile_dbo.Dealers_Dealer_DealerId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[Dealers_DealerFile] DROP CONSTRAINT [FK_dbo.Dealers_DealerFile_dbo.Dealers_Dealer_DealerId]
IF object_id(N'[dbo].[FK_dbo.Dealers_DealerFile_dbo.Attachments_Attachment_FileId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[Dealers_DealerFile] DROP CONSTRAINT [FK_dbo.Dealers_DealerFile_dbo.Attachments_Attachment_FileId]
IF object_id(N'[dbo].[FK_dbo.QuestionPool_QuestionPoolCategoryClass_dbo.MobileApp_AppClass_ClassId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[QuestionPool_QuestionPoolCategoryClass] DROP CONSTRAINT [FK_dbo.QuestionPool_QuestionPoolCategoryClass_dbo.MobileApp_AppClass_ClassId]
IF object_id(N'[dbo].[FK_dbo.QuestionPool_QuestionPoolCategoryClass_dbo.QuestionPool_QuestionPoolCategory_QuestionPoolCategoryId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[QuestionPool_QuestionPoolCategoryClass] DROP CONSTRAINT [FK_dbo.QuestionPool_QuestionPoolCategoryClass_dbo.QuestionPool_QuestionPoolCategory_QuestionPoolCategoryId]
IF object_id(N'[dbo].[FK_dbo.Slider_MainSlider_dbo.Central_Tenant_TenantId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[Slider_MainSlider] DROP CONSTRAINT [FK_dbo.Slider_MainSlider_dbo.Central_Tenant_TenantId]
IF object_id(N'[dbo].[FK_dbo.ExamEvaluation_UserExam_dbo.ExamEvaluation_OpticalFormTemplate_OpticalFormTemplateId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[ExamEvaluation_UserExam] DROP CONSTRAINT [FK_dbo.ExamEvaluation_UserExam_dbo.ExamEvaluation_OpticalFormTemplate_OpticalFormTemplateId]
IF object_id(N'[dbo].[FK_dbo.ExamEvaluation_UserExam_dbo.MobileApp_TryingExamCategory_TryingExamCategoryId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[ExamEvaluation_UserExam] DROP CONSTRAINT [FK_dbo.ExamEvaluation_UserExam_dbo.MobileApp_TryingExamCategory_TryingExamCategoryId]
IF object_id(N'[dbo].[FK_dbo.ExamEvaluation_UserExam_dbo.Central_User_UserId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[ExamEvaluation_UserExam] DROP CONSTRAINT [FK_dbo.ExamEvaluation_UserExam_dbo.Central_User_UserId]
IF object_id(N'[dbo].[FK_dbo.ExamEvaluation_ExamQuestionGain_dbo.ExamEvaluation_ExamQuestion_ExamQuestionId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[ExamEvaluation_ExamQuestionGain] DROP CONSTRAINT [FK_dbo.ExamEvaluation_ExamQuestionGain_dbo.ExamEvaluation_ExamQuestion_ExamQuestionId]
IF object_id(N'[dbo].[FK_dbo.ExamEvaluation_ExamQuestionGain_dbo.Gains_MebGain_GainId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[ExamEvaluation_ExamQuestionGain] DROP CONSTRAINT [FK_dbo.ExamEvaluation_ExamQuestionGain_dbo.Gains_MebGain_GainId]
IF object_id(N'[dbo].[FK_dbo.ExamEvaluation_ExamQuestion_dbo.MobileApp_TryingExamCategorySectionLesson_SectionLessonId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[ExamEvaluation_ExamQuestion] DROP CONSTRAINT [FK_dbo.ExamEvaluation_ExamQuestion_dbo.MobileApp_TryingExamCategorySectionLesson_SectionLessonId]
IF object_id(N'[dbo].[FK_dbo.ExamEvaluation_ExamQuestion_dbo.ExamEvaluation_UserExam_UserExamId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[ExamEvaluation_ExamQuestion] DROP CONSTRAINT [FK_dbo.ExamEvaluation_ExamQuestion_dbo.ExamEvaluation_UserExam_UserExamId]
IF object_id(N'[dbo].[FK_dbo.ExamEvaluation_AreaInformation_dbo.ExamEvaluation_OpticalFormTemplate_OpticalFormTemplateId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[ExamEvaluation_AreaInformation] DROP CONSTRAINT [FK_dbo.ExamEvaluation_AreaInformation_dbo.ExamEvaluation_OpticalFormTemplate_OpticalFormTemplateId]
IF object_id(N'[dbo].[FK_dbo.ExamEvaluation_ExamUserAnswer_dbo.ExamEvaluation_ExamQuestion_ExamQuestionId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[ExamEvaluation_ExamUserAnswer] DROP CONSTRAINT [FK_dbo.ExamEvaluation_ExamUserAnswer_dbo.ExamEvaluation_ExamQuestion_ExamQuestionId]
IF object_id(N'[dbo].[FK_dbo.ExamEvaluation_ExamUserAnswer_dbo.ExamEvaluation_ExamResult_ExamResultId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[ExamEvaluation_ExamUserAnswer] DROP CONSTRAINT [FK_dbo.ExamEvaluation_ExamUserAnswer_dbo.ExamEvaluation_ExamResult_ExamResultId]
IF object_id(N'[dbo].[FK_dbo.ExamEvaluation_ExamUserLessonStats_dbo.MobileApp_AppLesson_AppLessonId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[ExamEvaluation_ExamUserLessonStats] DROP CONSTRAINT [FK_dbo.ExamEvaluation_ExamUserLessonStats_dbo.MobileApp_AppLesson_AppLessonId]
IF object_id(N'[dbo].[FK_dbo.ExamEvaluation_ExamUserLessonStats_dbo.ExamEvaluation_ExamResult_TryingExamResultId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[ExamEvaluation_ExamUserLessonStats] DROP CONSTRAINT [FK_dbo.ExamEvaluation_ExamUserLessonStats_dbo.ExamEvaluation_ExamResult_TryingExamResultId]
IF object_id(N'[dbo].[FK_dbo.ExamEvaluation_ExamUserAnswer_dbo.ExamEvaluation_ExamUserLessonStats_ExamUserLessonStats_Id]', N'F') IS NOT NULL
ALTER TABLE [dbo].[ExamEvaluation_ExamUserAnswer] DROP CONSTRAINT [FK_dbo.ExamEvaluation_ExamUserAnswer_dbo.ExamEvaluation_ExamUserLessonStats_ExamUserLessonStats_Id]
IF object_id(N'[dbo].[FK_dbo.ExamEvaluation_ExamResult_dbo.Central_School_SchoolId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[ExamEvaluation_ExamResult] DROP CONSTRAINT [FK_dbo.ExamEvaluation_ExamResult_dbo.Central_School_SchoolId]
IF object_id(N'[dbo].[FK_dbo.ExamEvaluation_ExamUserScores_dbo.MobileApp_ScoreType_ScoreTypeId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[ExamEvaluation_ExamUserScores] DROP CONSTRAINT [FK_dbo.ExamEvaluation_ExamUserScores_dbo.MobileApp_ScoreType_ScoreTypeId]
IF object_id(N'[dbo].[FK_dbo.ExamEvaluation_ExamUserScores_dbo.ExamEvaluation_ExamResult_TryingExamResultId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[ExamEvaluation_ExamUserScores] DROP CONSTRAINT [FK_dbo.ExamEvaluation_ExamUserScores_dbo.ExamEvaluation_ExamResult_TryingExamResultId]
IF object_id(N'[dbo].[FK_dbo.ExamEvaluation_ExamResult_dbo.Central_User_UserId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[ExamEvaluation_ExamResult] DROP CONSTRAINT [FK_dbo.ExamEvaluation_ExamResult_dbo.Central_User_UserId]
IF object_id(N'[dbo].[FK_dbo.ExamEvaluation_ExamResult_dbo.ExamEvaluation_UserExam_UserExamId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[ExamEvaluation_ExamResult] DROP CONSTRAINT [FK_dbo.ExamEvaluation_ExamResult_dbo.ExamEvaluation_UserExam_UserExamId]
IF object_id(N'[dbo].[FK_dbo.Examinations_ExamTopicPattern_dbo.Examinations_Examination_ExaminationId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[Examinations_ExamTopicPattern] DROP CONSTRAINT [FK_dbo.Examinations_ExamTopicPattern_dbo.Examinations_Examination_ExaminationId]
IF object_id(N'[dbo].[FK_dbo.Examinations_ExamTopicPattern_dbo.Gains_GainTopic_TopicId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[Examinations_ExamTopicPattern] DROP CONSTRAINT [FK_dbo.Examinations_ExamTopicPattern_dbo.Gains_GainTopic_TopicId]
IF object_id(N'[dbo].[FK_dbo.OnlineLessons_MeetingSchoolAccount_dbo.OnlineLessons_MeetingAccount_MeetingAccountId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[OnlineLessons_MeetingSchoolAccount] DROP CONSTRAINT [FK_dbo.OnlineLessons_MeetingSchoolAccount_dbo.OnlineLessons_MeetingAccount_MeetingAccountId]
IF object_id(N'[dbo].[FK_dbo.OnlineLessons_MeetingSchoolAccount_dbo.Central_School_SchoolId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[OnlineLessons_MeetingSchoolAccount] DROP CONSTRAINT [FK_dbo.OnlineLessons_MeetingSchoolAccount_dbo.Central_School_SchoolId]
IF object_id(N'[dbo].[FK_dbo.Assignments_AssignmentContent_dbo.Assignments_Assignment_AssignmentId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[Assignments_AssignmentContent] DROP CONSTRAINT [FK_dbo.Assignments_AssignmentContent_dbo.Assignments_Assignment_AssignmentId]
IF object_id(N'[dbo].[FK_dbo.PublicArea_Link_dbo.Attachments_Attachment_LinkImageId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[PublicArea_Link] DROP CONSTRAINT [FK_dbo.PublicArea_Link_dbo.Attachments_Attachment_LinkImageId]
IF object_id(N'[dbo].[FK_dbo.PublicArea_Catalog_dbo.Attachments_Attachment_CoverImageId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[PublicArea_Catalog] DROP CONSTRAINT [FK_dbo.PublicArea_Catalog_dbo.Attachments_Attachment_CoverImageId]
IF object_id(N'[dbo].[FK_dbo.PublicArea_Catalog_dbo.PublicArea_CatalogGroup_GroupId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[PublicArea_Catalog] DROP CONSTRAINT [FK_dbo.PublicArea_Catalog_dbo.PublicArea_CatalogGroup_GroupId]
IF object_id(N'[dbo].[FK_dbo.PublicArea_CatalogPage_dbo.PublicArea_Catalog_CatalogId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[PublicArea_CatalogPage] DROP CONSTRAINT [FK_dbo.PublicArea_CatalogPage_dbo.PublicArea_Catalog_CatalogId]
IF object_id(N'[dbo].[FK_dbo.PublicArea_CatalogPage_dbo.Attachments_Attachment_ImageId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[PublicArea_CatalogPage] DROP CONSTRAINT [FK_dbo.PublicArea_CatalogPage_dbo.Attachments_Attachment_ImageId]
IF object_id(N'[dbo].[FK_dbo.PublicArea_Catalog_dbo.Attachments_Attachment_PdfId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[PublicArea_Catalog] DROP CONSTRAINT [FK_dbo.PublicArea_Catalog_dbo.Attachments_Attachment_PdfId]
IF object_id(N'[dbo].[FK_dbo.MobileApp_SolutionVideo_dbo.Attachments_Attachment_VideoAttachmentId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[MobileApp_SolutionVideo] DROP CONSTRAINT [FK_dbo.MobileApp_SolutionVideo_dbo.Attachments_Attachment_VideoAttachmentId]
IF object_id(N'[dbo].[FK_dbo.Dealers_Dealer_dbo.Central_District_DistrictId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[Dealers_Dealer] DROP CONSTRAINT [FK_dbo.Dealers_Dealer_dbo.Central_District_DistrictId]
IF object_id(N'[dbo].[FK_dbo.Examinations_Examination_dbo.MobileApp_TryingExamCategory_TryingExamCategoryId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[Examinations_Examination] DROP CONSTRAINT [FK_dbo.Examinations_Examination_dbo.MobileApp_TryingExamCategory_TryingExamCategoryId]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_SystemMenuId' AND object_id = object_id(N'[dbo].[Central_SystemMenuTenant]', N'U'))
DROP INDEX [IX_SystemMenuId] ON [dbo].[Central_SystemMenuTenant]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_ParentId' AND object_id = object_id(N'[dbo].[Central_School]', N'U'))
DROP INDEX [IX_ParentId] ON [dbo].[Central_School]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_ExamBranchId' AND object_id = object_id(N'[dbo].[ExamApply_ExamBook]', N'U'))
DROP INDEX [IX_ExamBranchId] ON [dbo].[ExamApply_ExamBook]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_Guid' AND object_id = object_id(N'[dbo].[ExamApply_ExamBook]', N'U'))
DROP INDEX [IX_Guid] ON [dbo].[ExamApply_ExamBook]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_Guid' AND object_id = object_id(N'[dbo].[ExamApply_ExamBranch]', N'U'))
DROP INDEX [IX_Guid] ON [dbo].[ExamApply_ExamBranch]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_BookKindId' AND object_id = object_id(N'[dbo].[MobileApp_AppBook]', N'U'))
DROP INDEX [IX_BookKindId] ON [dbo].[MobileApp_AppBook]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_PositionId' AND object_id = object_id(N'[dbo].[MobileApp_Activity]', N'U'))
DROP INDEX [IX_PositionId] ON [dbo].[MobileApp_Activity]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_VideoAttachmentId' AND object_id = object_id(N'[dbo].[MobileApp_SolutionVideo]', N'U'))
DROP INDEX [IX_VideoAttachmentId] ON [dbo].[MobileApp_SolutionVideo]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_PositionId' AND object_id = object_id(N'[dbo].[MobileApp_Question]', N'U'))
DROP INDEX [IX_PositionId] ON [dbo].[MobileApp_Question]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_RootPositionId' AND object_id = object_id(N'[dbo].[MobileApp_Question]', N'U'))
DROP INDEX [IX_RootPositionId] ON [dbo].[MobileApp_Question]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_SolutionId' AND object_id = object_id(N'[dbo].[MobileApp_Question]', N'U'))
DROP INDEX [IX_SolutionId] ON [dbo].[MobileApp_Question]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_SettingId' AND object_id = object_id(N'[dbo].[MobileApp_Question]', N'U'))
DROP INDEX [IX_SettingId] ON [dbo].[MobileApp_Question]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_SolutionAttachmentId' AND object_id = object_id(N'[dbo].[MobileApp_Choice]', N'U'))
DROP INDEX [IX_SolutionAttachmentId] ON [dbo].[MobileApp_Choice]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_PositionId' AND object_id = object_id(N'[dbo].[MobileApp_Choice]', N'U'))
DROP INDEX [IX_PositionId] ON [dbo].[MobileApp_Choice]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_SourceId' AND object_id = object_id(N'[dbo].[MobileApp_ChoiceMap]', N'U'))
DROP INDEX [IX_SourceId] ON [dbo].[MobileApp_ChoiceMap]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_TargetId' AND object_id = object_id(N'[dbo].[MobileApp_ChoiceMap]', N'U'))
DROP INDEX [IX_TargetId] ON [dbo].[MobileApp_ChoiceMap]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_QuestionId' AND object_id = object_id(N'[dbo].[MobileApp_QuestionFile]', N'U'))
DROP INDEX [IX_QuestionId] ON [dbo].[MobileApp_QuestionFile]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_FileId' AND object_id = object_id(N'[dbo].[MobileApp_QuestionFile]', N'U'))
DROP INDEX [IX_FileId] ON [dbo].[MobileApp_QuestionFile]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_PositionId' AND object_id = object_id(N'[dbo].[MobileApp_QuestionFile]', N'U'))
DROP INDEX [IX_PositionId] ON [dbo].[MobileApp_QuestionFile]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_BookId' AND object_id = object_id(N'[dbo].[MobileApp_BookFile]', N'U'))
DROP INDEX [IX_BookId] ON [dbo].[MobileApp_BookFile]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_FileId' AND object_id = object_id(N'[dbo].[MobileApp_BookFile]', N'U'))
DROP INDEX [IX_FileId] ON [dbo].[MobileApp_BookFile]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_RoleId' AND object_id = object_id(N'[dbo].[MobileApp_BookFileRole]', N'U'))
DROP INDEX [IX_RoleId] ON [dbo].[MobileApp_BookFileRole]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_BookFileId' AND object_id = object_id(N'[dbo].[MobileApp_BookFileRole]', N'U'))
DROP INDEX [IX_BookFileId] ON [dbo].[MobileApp_BookFileRole]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_TenantId' AND object_id = object_id(N'[dbo].[MobileApp_TenantBook]', N'U'))
DROP INDEX [IX_TenantId] ON [dbo].[MobileApp_TenantBook]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_BookId' AND object_id = object_id(N'[dbo].[MobileApp_TenantBook]', N'U'))
DROP INDEX [IX_BookId] ON [dbo].[MobileApp_TenantBook]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_CoverImageId' AND object_id = object_id(N'[dbo].[MobileApp_TenantBook]', N'U'))
DROP INDEX [IX_CoverImageId] ON [dbo].[MobileApp_TenantBook]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_BookId' AND object_id = object_id(N'[dbo].[MobileApp_BookTheme]', N'U'))
DROP INDEX [IX_BookId] ON [dbo].[MobileApp_BookTheme]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_ThemeId' AND object_id = object_id(N'[dbo].[MobileApp_BookTheme]', N'U'))
DROP INDEX [IX_ThemeId] ON [dbo].[MobileApp_BookTheme]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_PlanId' AND object_id = object_id(N'[dbo].[MobileApp_TryingExamPlanClassRoom]', N'U'))
DROP INDEX [IX_PlanId] ON [dbo].[MobileApp_TryingExamPlanClassRoom]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_AppAttachmentId' AND object_id = object_id(N'[dbo].[SmartBook_LibraryApp]', N'U'))
DROP INDEX [IX_AppAttachmentId] ON [dbo].[SmartBook_LibraryApp]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_TenantId' AND object_id = object_id(N'[dbo].[SmartBook_LibraryApp]', N'U'))
DROP INDEX [IX_TenantId] ON [dbo].[SmartBook_LibraryApp]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_DistrictId' AND object_id = object_id(N'[dbo].[Dealers_Dealer]', N'U'))
DROP INDEX [IX_DistrictId] ON [dbo].[Dealers_Dealer]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_DealerId' AND object_id = object_id(N'[dbo].[Dealers_DealerSchool]', N'U'))
DROP INDEX [IX_DealerId] ON [dbo].[Dealers_DealerSchool]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_SchoolId' AND object_id = object_id(N'[dbo].[Dealers_DealerSchool]', N'U'))
DROP INDEX [IX_SchoolId] ON [dbo].[Dealers_DealerSchool]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_DealerId' AND object_id = object_id(N'[dbo].[Dealers_DealerUser]', N'U'))
DROP INDEX [IX_DealerId] ON [dbo].[Dealers_DealerUser]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_UserId' AND object_id = object_id(N'[dbo].[Dealers_DealerUser]', N'U'))
DROP INDEX [IX_UserId] ON [dbo].[Dealers_DealerUser]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_DealerId' AND object_id = object_id(N'[dbo].[Dealers_DealerFile]', N'U'))
DROP INDEX [IX_DealerId] ON [dbo].[Dealers_DealerFile]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_FileId' AND object_id = object_id(N'[dbo].[Dealers_DealerFile]', N'U'))
DROP INDEX [IX_FileId] ON [dbo].[Dealers_DealerFile]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_Guid' AND object_id = object_id(N'[dbo].[QuestionPool_QuestionPoolCategory]', N'U'))
DROP INDEX [IX_Guid] ON [dbo].[QuestionPool_QuestionPoolCategory]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_QuestionPoolCategoryId' AND object_id = object_id(N'[dbo].[QuestionPool_QuestionPoolCategoryClass]', N'U'))
DROP INDEX [IX_QuestionPoolCategoryId] ON [dbo].[QuestionPool_QuestionPoolCategoryClass]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_ClassId' AND object_id = object_id(N'[dbo].[QuestionPool_QuestionPoolCategoryClass]', N'U'))
DROP INDEX [IX_ClassId] ON [dbo].[QuestionPool_QuestionPoolCategoryClass]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_TenantId' AND object_id = object_id(N'[dbo].[Slider_MainSlider]', N'U'))
DROP INDEX [IX_TenantId] ON [dbo].[Slider_MainSlider]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_UserId' AND object_id = object_id(N'[dbo].[ExamEvaluation_UserExam]', N'U'))
DROP INDEX [IX_UserId] ON [dbo].[ExamEvaluation_UserExam]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_TryingExamCategoryId' AND object_id = object_id(N'[dbo].[ExamEvaluation_UserExam]', N'U'))
DROP INDEX [IX_TryingExamCategoryId] ON [dbo].[ExamEvaluation_UserExam]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_OpticalFormTemplateId' AND object_id = object_id(N'[dbo].[ExamEvaluation_UserExam]', N'U'))
DROP INDEX [IX_OpticalFormTemplateId] ON [dbo].[ExamEvaluation_UserExam]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_Guid' AND object_id = object_id(N'[dbo].[ExamEvaluation_UserExam]', N'U'))
DROP INDEX [IX_Guid] ON [dbo].[ExamEvaluation_UserExam]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_UserExamId' AND object_id = object_id(N'[dbo].[ExamEvaluation_ExamQuestion]', N'U'))
DROP INDEX [IX_UserExamId] ON [dbo].[ExamEvaluation_ExamQuestion]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_SectionLessonId' AND object_id = object_id(N'[dbo].[ExamEvaluation_ExamQuestion]', N'U'))
DROP INDEX [IX_SectionLessonId] ON [dbo].[ExamEvaluation_ExamQuestion]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_GainId' AND object_id = object_id(N'[dbo].[ExamEvaluation_ExamQuestionGain]', N'U'))
DROP INDEX [IX_GainId] ON [dbo].[ExamEvaluation_ExamQuestionGain]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_ExamQuestionId' AND object_id = object_id(N'[dbo].[ExamEvaluation_ExamQuestionGain]', N'U'))
DROP INDEX [IX_ExamQuestionId] ON [dbo].[ExamEvaluation_ExamQuestionGain]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_OpticalFormTemplateId' AND object_id = object_id(N'[dbo].[ExamEvaluation_AreaInformation]', N'U'))
DROP INDEX [IX_OpticalFormTemplateId] ON [dbo].[ExamEvaluation_AreaInformation]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_UserExamId' AND object_id = object_id(N'[dbo].[ExamEvaluation_ExamResult]', N'U'))
DROP INDEX [IX_UserExamId] ON [dbo].[ExamEvaluation_ExamResult]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_UserId' AND object_id = object_id(N'[dbo].[ExamEvaluation_ExamResult]', N'U'))
DROP INDEX [IX_UserId] ON [dbo].[ExamEvaluation_ExamResult]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_SchoolId' AND object_id = object_id(N'[dbo].[ExamEvaluation_ExamResult]', N'U'))
DROP INDEX [IX_SchoolId] ON [dbo].[ExamEvaluation_ExamResult]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_Guid' AND object_id = object_id(N'[dbo].[ExamEvaluation_ExamResult]', N'U'))
DROP INDEX [IX_Guid] ON [dbo].[ExamEvaluation_ExamResult]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_ExamResultId' AND object_id = object_id(N'[dbo].[ExamEvaluation_ExamUserAnswer]', N'U'))
DROP INDEX [IX_ExamResultId] ON [dbo].[ExamEvaluation_ExamUserAnswer]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_ExamQuestionId' AND object_id = object_id(N'[dbo].[ExamEvaluation_ExamUserAnswer]', N'U'))
DROP INDEX [IX_ExamQuestionId] ON [dbo].[ExamEvaluation_ExamUserAnswer]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_ExamUserLessonStats_Id' AND object_id = object_id(N'[dbo].[ExamEvaluation_ExamUserAnswer]', N'U'))
DROP INDEX [IX_ExamUserLessonStats_Id] ON [dbo].[ExamEvaluation_ExamUserAnswer]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_AppLessonId' AND object_id = object_id(N'[dbo].[ExamEvaluation_ExamUserLessonStats]', N'U'))
DROP INDEX [IX_AppLessonId] ON [dbo].[ExamEvaluation_ExamUserLessonStats]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_TryingExamResultId' AND object_id = object_id(N'[dbo].[ExamEvaluation_ExamUserLessonStats]', N'U'))
DROP INDEX [IX_TryingExamResultId] ON [dbo].[ExamEvaluation_ExamUserLessonStats]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_TryingExamResultId' AND object_id = object_id(N'[dbo].[ExamEvaluation_ExamUserScores]', N'U'))
DROP INDEX [IX_TryingExamResultId] ON [dbo].[ExamEvaluation_ExamUserScores]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_ScoreTypeId' AND object_id = object_id(N'[dbo].[ExamEvaluation_ExamUserScores]', N'U'))
DROP INDEX [IX_ScoreTypeId] ON [dbo].[ExamEvaluation_ExamUserScores]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_TryingExamCategoryId' AND object_id = object_id(N'[dbo].[Examinations_Examination]', N'U'))
DROP INDEX [IX_TryingExamCategoryId] ON [dbo].[Examinations_Examination]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_ExaminationId' AND object_id = object_id(N'[dbo].[Examinations_ExamTopicPattern]', N'U'))
DROP INDEX [IX_ExaminationId] ON [dbo].[Examinations_ExamTopicPattern]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_TopicId' AND object_id = object_id(N'[dbo].[Examinations_ExamTopicPattern]', N'U'))
DROP INDEX [IX_TopicId] ON [dbo].[Examinations_ExamTopicPattern]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_Guid' AND object_id = object_id(N'[dbo].[Examinations_ExamTopicPattern]', N'U'))
DROP INDEX [IX_Guid] ON [dbo].[Examinations_ExamTopicPattern]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_Guid' AND object_id = object_id(N'[dbo].[OnlineLessons_MeetingAccount]', N'U'))
DROP INDEX [IX_Guid] ON [dbo].[OnlineLessons_MeetingAccount]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_MeetingAccountId' AND object_id = object_id(N'[dbo].[OnlineLessons_MeetingSchoolAccount]', N'U'))
DROP INDEX [IX_MeetingAccountId] ON [dbo].[OnlineLessons_MeetingSchoolAccount]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_SchoolId' AND object_id = object_id(N'[dbo].[OnlineLessons_MeetingSchoolAccount]', N'U'))
DROP INDEX [IX_SchoolId] ON [dbo].[OnlineLessons_MeetingSchoolAccount]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_AssignmentId' AND object_id = object_id(N'[dbo].[Assignments_AssignmentContent]', N'U'))
DROP INDEX [IX_AssignmentId] ON [dbo].[Assignments_AssignmentContent]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_LinkImageId' AND object_id = object_id(N'[dbo].[PublicArea_Link]', N'U'))
DROP INDEX [IX_LinkImageId] ON [dbo].[PublicArea_Link]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_GroupId' AND object_id = object_id(N'[dbo].[PublicArea_Catalog]', N'U'))
DROP INDEX [IX_GroupId] ON [dbo].[PublicArea_Catalog]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_CoverImageId' AND object_id = object_id(N'[dbo].[PublicArea_Catalog]', N'U'))
DROP INDEX [IX_CoverImageId] ON [dbo].[PublicArea_Catalog]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_PdfId' AND object_id = object_id(N'[dbo].[PublicArea_Catalog]', N'U'))
DROP INDEX [IX_PdfId] ON [dbo].[PublicArea_Catalog]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_ImageId' AND object_id = object_id(N'[dbo].[PublicArea_CatalogPage]', N'U'))
DROP INDEX [IX_ImageId] ON [dbo].[PublicArea_CatalogPage]
IF EXISTS (SELECT name FROM sys.indexes WHERE name = N'IX_CatalogId' AND object_id = object_id(N'[dbo].[PublicArea_CatalogPage]', N'U'))
DROP INDEX [IX_CatalogId] ON [dbo].[PublicArea_CatalogPage]
ALTER TABLE [dbo].[Common_Log] ADD [Guid] [uniqueidentifier] NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000'
ALTER TABLE [dbo].[Common_Log] ADD [UpdatedOn] [datetime] NOT NULL DEFAULT '1900-01-01T00:00:00.000'
ALTER TABLE [dbo].[Common_Log] ADD [IsDeleted] [bit] NOT NULL DEFAULT 0
ALTER TABLE [dbo].[General_ScheduleTask] ADD [Guid] [uniqueidentifier] NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000'
ALTER TABLE [dbo].[General_ScheduleTask] ADD [CreatedOn] [datetime] NOT NULL DEFAULT '1900-01-01T00:00:00.000'
ALTER TABLE [dbo].[General_ScheduleTask] ADD [UpdatedOn] [datetime] NOT NULL DEFAULT '1900-01-01T00:00:00.000'
ALTER TABLE [dbo].[General_ScheduleTask] ADD [IsDeleted] [bit] NOT NULL DEFAULT 0
ALTER TABLE [dbo].[ExamApply_ExamApplyResult] ADD [SchoolId] [int] NOT NULL DEFAULT 0
ALTER TABLE [dbo].[ExamApply_ExamApplyResult] ADD [UserType] [int] NOT NULL DEFAULT 0
ALTER TABLE [dbo].[MobileApp_EducationYear] ADD [Year] [nvarchar](max)
ALTER TABLE [dbo].[MobileApp_EducationYear] ADD [Guid] [uniqueidentifier] NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000'
ALTER TABLE [dbo].[MobileApp_EducationYear] ADD [CreatedOn] [datetime] NOT NULL DEFAULT '1900-01-01T00:00:00.000'
ALTER TABLE [dbo].[MobileApp_EducationYear] ADD [UpdatedOn] [datetime] NOT NULL DEFAULT '1900-01-01T00:00:00.000'
ALTER TABLE [dbo].[MobileApp_EducationYear] ADD [IsDeleted] [bit] NOT NULL DEFAULT 0
ALTER TABLE [dbo].[MobileApp_VideoComment] ADD [Guid] [uniqueidentifier] NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000'
ALTER TABLE [dbo].[MobileApp_VideoComment] ADD [CreatedOn] [datetime] NOT NULL DEFAULT '1900-01-01T00:00:00.000'
ALTER TABLE [dbo].[MobileApp_VideoComment] ADD [UpdatedOn] [datetime] NOT NULL DEFAULT '1900-01-01T00:00:00.000'
ALTER TABLE [dbo].[MobileApp_VideoComment] ADD [IsDeleted] [bit] NOT NULL DEFAULT 0
ALTER TABLE [dbo].[Slider_SliderImage] ADD [Guid] [uniqueidentifier] NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000'
ALTER TABLE [dbo].[Slider_SliderImage] ADD [CreatedOn] [datetime] NOT NULL DEFAULT '1900-01-01T00:00:00.000'
ALTER TABLE [dbo].[Slider_SliderImage] ADD [UpdatedOn] [datetime] NOT NULL DEFAULT '1900-01-01T00:00:00.000'
ALTER TABLE [dbo].[Slider_SliderImage] ADD [IsDeleted] [bit] NOT NULL DEFAULT 0
ALTER TABLE [dbo].[Slider_SliderImageItem] ADD [Guid] [uniqueidentifier] NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000'
ALTER TABLE [dbo].[Slider_SliderImageItem] ADD [CreatedOn] [datetime] NOT NULL DEFAULT '1900-01-01T00:00:00.000'
ALTER TABLE [dbo].[Slider_SliderImageItem] ADD [UpdatedOn] [datetime] NOT NULL DEFAULT '1900-01-01T00:00:00.000'
ALTER TABLE [dbo].[Slider_SliderImageItem] ADD [IsDeleted] [bit] NOT NULL DEFAULT 0
ALTER TABLE [dbo].[QrCode_AppQrCode] ADD [Guid] [uniqueidentifier] NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000'
ALTER TABLE [dbo].[QrCode_AppQrCode] ADD [CreatedOn] [datetime] NOT NULL DEFAULT '1900-01-01T00:00:00.000'
ALTER TABLE [dbo].[QrCode_AppQrCode] ADD [UpdatedOn] [datetime] NOT NULL DEFAULT '1900-01-01T00:00:00.000'
ALTER TABLE [dbo].[QrCode_AppQrCode] ADD [IsDeleted] [bit] NOT NULL DEFAULT 0
ALTER TABLE [dbo].[OnlineLessons_ZoomUser] ADD [ZoomUserId] [nvarchar](max)
DECLARE @var0 nvarchar(128)
SELECT @var0 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MobileApp_SolutionVideo')
AND col_name(parent_object_id, parent_column_id) = 'VideoAttachmentId';
IF @var0 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_SolutionVideo] DROP CONSTRAINT [' + @var0 + ']')
ALTER TABLE [dbo].[MobileApp_SolutionVideo] ALTER COLUMN [VideoAttachmentId] [int] NOT NULL
DECLARE @var1 nvarchar(128)
SELECT @var1 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MobileApp_SolutionVideo')
AND col_name(parent_object_id, parent_column_id) = 'IsApproved';
IF @var1 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_SolutionVideo] DROP CONSTRAINT [' + @var1 + ']')
ALTER TABLE [dbo].[MobileApp_SolutionVideo] ALTER COLUMN [IsApproved] [bit] NOT NULL
DECLARE @var2 nvarchar(128)
SELECT @var2 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.Dealers_Dealer')
AND col_name(parent_object_id, parent_column_id) = 'DistrictId';
IF @var2 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[Dealers_Dealer] DROP CONSTRAINT [' + @var2 + ']')
ALTER TABLE [dbo].[Dealers_Dealer] ALTER COLUMN [DistrictId] [int] NOT NULL
DECLARE @var3 nvarchar(128)
SELECT @var3 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.Examinations_Examination')
AND col_name(parent_object_id, parent_column_id) = 'TryingExamCategoryId';
IF @var3 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[Examinations_Examination] DROP CONSTRAINT [' + @var3 + ']')
ALTER TABLE [dbo].[Examinations_Examination] ALTER COLUMN [TryingExamCategoryId] [int] NOT NULL
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[Common_Log]([Guid])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[General_ScheduleTask]([Guid])
CREATE INDEX [IX_SchoolId] ON [dbo].[ExamApply_ExamApplyResult]([SchoolId])
CREATE INDEX [IX_VideoAttachmentId] ON [dbo].[MobileApp_SolutionVideo]([VideoAttachmentId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[MobileApp_EducationYear]([Guid])
CREATE INDEX [IX_DistrictId] ON [dbo].[Dealers_Dealer]([DistrictId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[MobileApp_VideoComment]([Guid])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[Slider_SliderImage]([Guid])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[Slider_SliderImageItem]([Guid])
CREATE INDEX [IX_TryingExamCategoryId] ON [dbo].[Examinations_Examination]([TryingExamCategoryId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[QrCode_AppQrCode]([Guid])
ALTER TABLE [dbo].[ExamApply_ExamApplyResult] ADD CONSTRAINT [FK_dbo.ExamApply_ExamApplyResult_dbo.Central_School_SchoolId] FOREIGN KEY ([SchoolId]) REFERENCES [dbo].[Central_School] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_SolutionVideo] ADD CONSTRAINT [FK_dbo.MobileApp_SolutionVideo_dbo.Attachments_Attachment_VideoAttachmentId] FOREIGN KEY ([VideoAttachmentId]) REFERENCES [dbo].[Attachments_Attachment] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Dealers_Dealer] ADD CONSTRAINT [FK_dbo.Dealers_Dealer_dbo.Central_District_DistrictId] FOREIGN KEY ([DistrictId]) REFERENCES [dbo].[Central_District] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Examinations_Examination] ADD CONSTRAINT [FK_dbo.Examinations_Examination_dbo.MobileApp_TryingExamCategory_TryingExamCategoryId] FOREIGN KEY ([TryingExamCategoryId]) REFERENCES [dbo].[MobileApp_TryingExamCategory] ([Id]) ON DELETE CASCADE
DECLARE @var4 nvarchar(128)
SELECT @var4 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.Central_School')
AND col_name(parent_object_id, parent_column_id) = 'IsMainSchool';
IF @var4 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[Central_School] DROP CONSTRAINT [' + @var4 + ']')
ALTER TABLE [dbo].[Central_School] DROP COLUMN [IsMainSchool]
DECLARE @var5 nvarchar(128)
SELECT @var5 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.Central_School')
AND col_name(parent_object_id, parent_column_id) = 'ParentId';
IF @var5 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[Central_School] DROP CONSTRAINT [' + @var5 + ']')
ALTER TABLE [dbo].[Central_School] DROP COLUMN [ParentId]
DECLARE @var6 nvarchar(128)
SELECT @var6 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.Central_School')
AND col_name(parent_object_id, parent_column_id) = 'TenantId';
IF @var6 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[Central_School] DROP CONSTRAINT [' + @var6 + ']')
ALTER TABLE [dbo].[Central_School] DROP COLUMN [TenantId]
DECLARE @var7 nvarchar(128)
SELECT @var7 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.ExamApply_ExamApplyResult')
AND col_name(parent_object_id, parent_column_id) = 'Province';
IF @var7 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[ExamApply_ExamApplyResult] DROP CONSTRAINT [' + @var7 + ']')
ALTER TABLE [dbo].[ExamApply_ExamApplyResult] DROP COLUMN [Province]
DECLARE @var8 nvarchar(128)
SELECT @var8 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.ExamApply_ExamApplyResult')
AND col_name(parent_object_id, parent_column_id) = 'BranchName';
IF @var8 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[ExamApply_ExamApplyResult] DROP CONSTRAINT [' + @var8 + ']')
ALTER TABLE [dbo].[ExamApply_ExamApplyResult] DROP COLUMN [BranchName]
DECLARE @var9 nvarchar(128)
SELECT @var9 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.ExamApply_ExamApplyResult')
AND col_name(parent_object_id, parent_column_id) = 'IdentityNumber';
IF @var9 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[ExamApply_ExamApplyResult] DROP CONSTRAINT [' + @var9 + ']')
ALTER TABLE [dbo].[ExamApply_ExamApplyResult] DROP COLUMN [IdentityNumber]
DECLARE @var10 nvarchar(128)
SELECT @var10 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.ExamApply_ExamApplyResult')
AND col_name(parent_object_id, parent_column_id) = 'District';
IF @var10 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[ExamApply_ExamApplyResult] DROP CONSTRAINT [' + @var10 + ']')
ALTER TABLE [dbo].[ExamApply_ExamApplyResult] DROP COLUMN [District]
DECLARE @var11 nvarchar(128)
SELECT @var11 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.ExamApply_ExamApplyResult')
AND col_name(parent_object_id, parent_column_id) = 'SchoolName';
IF @var11 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[ExamApply_ExamApplyResult] DROP CONSTRAINT [' + @var11 + ']')
ALTER TABLE [dbo].[ExamApply_ExamApplyResult] DROP COLUMN [SchoolName]
DECLARE @var12 nvarchar(128)
SELECT @var12 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.ExamApply_ExamApplyResult')
AND col_name(parent_object_id, parent_column_id) = 'CourseTypeName';
IF @var12 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[ExamApply_ExamApplyResult] DROP CONSTRAINT [' + @var12 + ']')
ALTER TABLE [dbo].[ExamApply_ExamApplyResult] DROP COLUMN [CourseTypeName]
DECLARE @var13 nvarchar(128)
SELECT @var13 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.ExamApply_ExamApplyResult')
AND col_name(parent_object_id, parent_column_id) = 'Address';
IF @var13 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[ExamApply_ExamApplyResult] DROP CONSTRAINT [' + @var13 + ']')
ALTER TABLE [dbo].[ExamApply_ExamApplyResult] DROP COLUMN [Address]
DECLARE @var14 nvarchar(128)
SELECT @var14 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.ExamApply_ExamApplyResult')
AND col_name(parent_object_id, parent_column_id) = 'UserFile';
IF @var14 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[ExamApply_ExamApplyResult] DROP CONSTRAINT [' + @var14 + ']')
ALTER TABLE [dbo].[ExamApply_ExamApplyResult] DROP COLUMN [UserFile]
DECLARE @var15 nvarchar(128)
SELECT @var15 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.ExamApply_ExamApplyResult')
AND col_name(parent_object_id, parent_column_id) = 'BookNames';
IF @var15 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[ExamApply_ExamApplyResult] DROP CONSTRAINT [' + @var15 + ']')
ALTER TABLE [dbo].[ExamApply_ExamApplyResult] DROP COLUMN [BookNames]
DECLARE @var16 nvarchar(128)
SELECT @var16 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MobileApp_AppBook')
AND col_name(parent_object_id, parent_column_id) = 'DisplayPages';
IF @var16 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_AppBook] DROP CONSTRAINT [' + @var16 + ']')
ALTER TABLE [dbo].[MobileApp_AppBook] DROP COLUMN [DisplayPages]
DECLARE @var17 nvarchar(128)
SELECT @var17 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MobileApp_AppBook')
AND col_name(parent_object_id, parent_column_id) = 'BookKindId';
IF @var17 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_AppBook] DROP CONSTRAINT [' + @var17 + ']')
ALTER TABLE [dbo].[MobileApp_AppBook] DROP COLUMN [BookKindId]
DECLARE @var18 nvarchar(128)
SELECT @var18 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MobileApp_AppBook')
AND col_name(parent_object_id, parent_column_id) = 'HideLibrary';
IF @var18 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_AppBook] DROP CONSTRAINT [' + @var18 + ']')
ALTER TABLE [dbo].[MobileApp_AppBook] DROP COLUMN [HideLibrary]
DECLARE @var19 nvarchar(128)
SELECT @var19 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MobileApp_AppBook')
AND col_name(parent_object_id, parent_column_id) = 'AccessCode';
IF @var19 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_AppBook] DROP CONSTRAINT [' + @var19 + ']')
ALTER TABLE [dbo].[MobileApp_AppBook] DROP COLUMN [AccessCode]
DECLARE @var20 nvarchar(128)
SELECT @var20 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MobileApp_AppClass')
AND col_name(parent_object_id, parent_column_id) = 'ClassOrder';
IF @var20 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_AppClass] DROP CONSTRAINT [' + @var20 + ']')
ALTER TABLE [dbo].[MobileApp_AppClass] DROP COLUMN [ClassOrder]
DECLARE @var21 nvarchar(128)
SELECT @var21 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MobileApp_AppLesson')
AND col_name(parent_object_id, parent_column_id) = 'LessonCode';
IF @var21 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_AppLesson] DROP CONSTRAINT [' + @var21 + ']')
ALTER TABLE [dbo].[MobileApp_AppLesson] DROP COLUMN [LessonCode]
DECLARE @var22 nvarchar(128)
SELECT @var22 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MobileApp_Activity')
AND col_name(parent_object_id, parent_column_id) = 'Transcript';
IF @var22 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_Activity] DROP CONSTRAINT [' + @var22 + ']')
ALTER TABLE [dbo].[MobileApp_Activity] DROP COLUMN [Transcript]
DECLARE @var23 nvarchar(128)
SELECT @var23 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MobileApp_Activity')
AND col_name(parent_object_id, parent_column_id) = 'LinkToPageNo';
IF @var23 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_Activity] DROP CONSTRAINT [' + @var23 + ']')
ALTER TABLE [dbo].[MobileApp_Activity] DROP COLUMN [LinkToPageNo]
DECLARE @var24 nvarchar(128)
SELECT @var24 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MobileApp_Activity')
AND col_name(parent_object_id, parent_column_id) = 'GameLink';
IF @var24 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_Activity] DROP CONSTRAINT [' + @var24 + ']')
ALTER TABLE [dbo].[MobileApp_Activity] DROP COLUMN [GameLink]
DECLARE @var25 nvarchar(128)
SELECT @var25 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MobileApp_Activity')
AND col_name(parent_object_id, parent_column_id) = 'IsActive';
IF @var25 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_Activity] DROP CONSTRAINT [' + @var25 + ']')
ALTER TABLE [dbo].[MobileApp_Activity] DROP COLUMN [IsActive]
DECLARE @var26 nvarchar(128)
SELECT @var26 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MobileApp_Activity')
AND col_name(parent_object_id, parent_column_id) = 'PositionId';
IF @var26 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_Activity] DROP CONSTRAINT [' + @var26 + ']')
ALTER TABLE [dbo].[MobileApp_Activity] DROP COLUMN [PositionId]
DECLARE @var27 nvarchar(128)
SELECT @var27 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MobileApp_BookContentLesson')
AND col_name(parent_object_id, parent_column_id) = 'ActivityId';
IF @var27 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_BookContentLesson] DROP CONSTRAINT [' + @var27 + ']')
ALTER TABLE [dbo].[MobileApp_BookContentLesson] DROP COLUMN [ActivityId]
DECLARE @var28 nvarchar(128)
SELECT @var28 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MobileApp_BookContentLesson')
AND col_name(parent_object_id, parent_column_id) = 'BookContentLessonType';
IF @var28 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_BookContentLesson] DROP CONSTRAINT [' + @var28 + ']')
ALTER TABLE [dbo].[MobileApp_BookContentLesson] DROP COLUMN [BookContentLessonType]
DECLARE @var29 nvarchar(128)
SELECT @var29 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MobileApp_SolutionVideo')
AND col_name(parent_object_id, parent_column_id) = 'XamlUrl';
IF @var29 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_SolutionVideo] DROP CONSTRAINT [' + @var29 + ']')
ALTER TABLE [dbo].[MobileApp_SolutionVideo] DROP COLUMN [XamlUrl]
DECLARE @var30 nvarchar(128)
SELECT @var30 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MobileApp_SolutionVideo')
AND col_name(parent_object_id, parent_column_id) = 'SwfUrl';
IF @var30 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_SolutionVideo] DROP CONSTRAINT [' + @var30 + ']')
ALTER TABLE [dbo].[MobileApp_SolutionVideo] DROP COLUMN [SwfUrl]
DECLARE @var31 nvarchar(128)
SELECT @var31 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MobileApp_SolutionVideo')
AND col_name(parent_object_id, parent_column_id) = 'Mp3Url';
IF @var31 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_SolutionVideo] DROP CONSTRAINT [' + @var31 + ']')
ALTER TABLE [dbo].[MobileApp_SolutionVideo] DROP COLUMN [Mp3Url]
DECLARE @var32 nvarchar(128)
SELECT @var32 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MobileApp_SolutionVideo')
AND col_name(parent_object_id, parent_column_id) = 'ExternalUrl';
IF @var32 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_SolutionVideo] DROP CONSTRAINT [' + @var32 + ']')
ALTER TABLE [dbo].[MobileApp_SolutionVideo] DROP COLUMN [ExternalUrl]
DECLARE @var33 nvarchar(128)
SELECT @var33 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MobileApp_SolutionVideo')
AND col_name(parent_object_id, parent_column_id) = 'Width';
IF @var33 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_SolutionVideo] DROP CONSTRAINT [' + @var33 + ']')
ALTER TABLE [dbo].[MobileApp_SolutionVideo] DROP COLUMN [Width]
DECLARE @var34 nvarchar(128)
SELECT @var34 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MobileApp_SolutionVideo')
AND col_name(parent_object_id, parent_column_id) = 'Height';
IF @var34 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_SolutionVideo] DROP CONSTRAINT [' + @var34 + ']')
ALTER TABLE [dbo].[MobileApp_SolutionVideo] DROP COLUMN [Height]
DECLARE @var35 nvarchar(128)
SELECT @var35 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MobileApp_TestQuestion')
AND col_name(parent_object_id, parent_column_id) = 'Point';
IF @var35 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_TestQuestion] DROP CONSTRAINT [' + @var35 + ']')
ALTER TABLE [dbo].[MobileApp_TestQuestion] DROP COLUMN [Point]
DECLARE @var36 nvarchar(128)
SELECT @var36 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MobileApp_TestQuestion')
AND col_name(parent_object_id, parent_column_id) = 'Page';
IF @var36 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_TestQuestion] DROP CONSTRAINT [' + @var36 + ']')
ALTER TABLE [dbo].[MobileApp_TestQuestion] DROP COLUMN [Page]
DECLARE @var37 nvarchar(128)
SELECT @var37 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MobileApp_Question')
AND col_name(parent_object_id, parent_column_id) = 'HideOnSolutionApp';
IF @var37 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_Question] DROP CONSTRAINT [' + @var37 + ']')
ALTER TABLE [dbo].[MobileApp_Question] DROP COLUMN [HideOnSolutionApp]
DECLARE @var38 nvarchar(128)
SELECT @var38 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MobileApp_Question')
AND col_name(parent_object_id, parent_column_id) = 'PositionId';
IF @var38 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_Question] DROP CONSTRAINT [' + @var38 + ']')
ALTER TABLE [dbo].[MobileApp_Question] DROP COLUMN [PositionId]
DECLARE @var39 nvarchar(128)
SELECT @var39 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MobileApp_Question')
AND col_name(parent_object_id, parent_column_id) = 'RootPositionId';
IF @var39 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_Question] DROP CONSTRAINT [' + @var39 + ']')
ALTER TABLE [dbo].[MobileApp_Question] DROP COLUMN [RootPositionId]
DECLARE @var40 nvarchar(128)
SELECT @var40 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MobileApp_Question')
AND col_name(parent_object_id, parent_column_id) = 'SolutionId';
IF @var40 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_Question] DROP CONSTRAINT [' + @var40 + ']')
ALTER TABLE [dbo].[MobileApp_Question] DROP COLUMN [SolutionId]
DECLARE @var41 nvarchar(128)
SELECT @var41 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MobileApp_Question')
AND col_name(parent_object_id, parent_column_id) = 'SettingId';
IF @var41 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_Question] DROP CONSTRAINT [' + @var41 + ']')
ALTER TABLE [dbo].[MobileApp_Question] DROP COLUMN [SettingId]
DECLARE @var42 nvarchar(128)
SELECT @var42 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MobileApp_Choice')
AND col_name(parent_object_id, parent_column_id) = 'SolutionAttachmentId';
IF @var42 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_Choice] DROP CONSTRAINT [' + @var42 + ']')
ALTER TABLE [dbo].[MobileApp_Choice] DROP COLUMN [SolutionAttachmentId]
DECLARE @var43 nvarchar(128)
SELECT @var43 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MobileApp_Choice')
AND col_name(parent_object_id, parent_column_id) = 'PositionId';
IF @var43 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_Choice] DROP CONSTRAINT [' + @var43 + ']')
ALTER TABLE [dbo].[MobileApp_Choice] DROP COLUMN [PositionId]
DECLARE @var44 nvarchar(128)
SELECT @var44 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MobileApp_Choice')
AND col_name(parent_object_id, parent_column_id) = 'Group';
IF @var44 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_Choice] DROP CONSTRAINT [' + @var44 + ']')
ALTER TABLE [dbo].[MobileApp_Choice] DROP COLUMN [Group]
DECLARE @var45 nvarchar(128)
SELECT @var45 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MobileApp_TryingExamCategory')
AND col_name(parent_object_id, parent_column_id) = 'UserId';
IF @var45 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_TryingExamCategory] DROP CONSTRAINT [' + @var45 + ']')
ALTER TABLE [dbo].[MobileApp_TryingExamCategory] DROP COLUMN [UserId]
DECLARE @var46 nvarchar(128)
SELECT @var46 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MobileApp_TryingExamCategory')
AND col_name(parent_object_id, parent_column_id) = 'UseAsExamImportTemplate';
IF @var46 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_TryingExamCategory] DROP CONSTRAINT [' + @var46 + ']')
ALTER TABLE [dbo].[MobileApp_TryingExamCategory] DROP COLUMN [UseAsExamImportTemplate]
DECLARE @var47 nvarchar(128)
SELECT @var47 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MobileApp_EducationYear')
AND col_name(parent_object_id, parent_column_id) = 'Title';
IF @var47 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_EducationYear] DROP CONSTRAINT [' + @var47 + ']')
ALTER TABLE [dbo].[MobileApp_EducationYear] DROP COLUMN [Title]
DECLARE @var48 nvarchar(128)
SELECT @var48 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MobileApp_EducationYear')
AND col_name(parent_object_id, parent_column_id) = 'StartDate';
IF @var48 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_EducationYear] DROP CONSTRAINT [' + @var48 + ']')
ALTER TABLE [dbo].[MobileApp_EducationYear] DROP COLUMN [StartDate]
DECLARE @var49 nvarchar(128)
SELECT @var49 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MobileApp_EducationYear')
AND col_name(parent_object_id, parent_column_id) = 'EndDate';
IF @var49 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_EducationYear] DROP CONSTRAINT [' + @var49 + ']')
ALTER TABLE [dbo].[MobileApp_EducationYear] DROP COLUMN [EndDate]
DECLARE @var50 nvarchar(128)
SELECT @var50 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MobileApp_EducationYear')
AND col_name(parent_object_id, parent_column_id) = 'LibraryExpireDate';
IF @var50 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_EducationYear] DROP CONSTRAINT [' + @var50 + ']')
ALTER TABLE [dbo].[MobileApp_EducationYear] DROP COLUMN [LibraryExpireDate]
DECLARE @var51 nvarchar(128)
SELECT @var51 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MobileApp_TryingExamPlan')
AND col_name(parent_object_id, parent_column_id) = 'IsPlannedForClassrooms';
IF @var51 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_TryingExamPlan] DROP CONSTRAINT [' + @var51 + ']')
ALTER TABLE [dbo].[MobileApp_TryingExamPlan] DROP COLUMN [IsPlannedForClassrooms]
DECLARE @var52 nvarchar(128)
SELECT @var52 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.SmartBook_SmGapFillingItem')
AND col_name(parent_object_id, parent_column_id) = 'SolutionBytes';
IF @var52 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[SmartBook_SmGapFillingItem] DROP CONSTRAINT [' + @var52 + ']')
ALTER TABLE [dbo].[SmartBook_SmGapFillingItem] DROP COLUMN [SolutionBytes]
DECLARE @var53 nvarchar(128)
SELECT @var53 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.Dealers_Dealer')
AND col_name(parent_object_id, parent_column_id) = 'ProvinceId';
IF @var53 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[Dealers_Dealer] DROP CONSTRAINT [' + @var53 + ']')
ALTER TABLE [dbo].[Dealers_Dealer] DROP COLUMN [ProvinceId]
DECLARE @var54 nvarchar(128)
SELECT @var54 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.QuestionPool_QuestionPoolTest')
AND col_name(parent_object_id, parent_column_id) = 'CustomLogoPosition';
IF @var54 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[QuestionPool_QuestionPoolTest] DROP CONSTRAINT [' + @var54 + ']')
ALTER TABLE [dbo].[QuestionPool_QuestionPoolTest] DROP COLUMN [CustomLogoPosition]
DECLARE @var55 nvarchar(128)
SELECT @var55 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MobileApp_UserTestResult')
AND col_name(parent_object_id, parent_column_id) = 'AssignmentId';
IF @var55 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_UserTestResult] DROP CONSTRAINT [' + @var55 + ']')
ALTER TABLE [dbo].[MobileApp_UserTestResult] DROP COLUMN [AssignmentId]
DECLARE @var56 nvarchar(128)
SELECT @var56 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.MobileApp_UserTestResult')
AND col_name(parent_object_id, parent_column_id) = 'Score';
IF @var56 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_UserTestResult] DROP CONSTRAINT [' + @var56 + ']')
ALTER TABLE [dbo].[MobileApp_UserTestResult] DROP COLUMN [Score]
DECLARE @var57 nvarchar(128)
SELECT @var57 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.Omr_NumberBlock')
AND col_name(parent_object_id, parent_column_id) = 'WebXCoordinate';
IF @var57 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[Omr_NumberBlock] DROP CONSTRAINT [' + @var57 + ']')
ALTER TABLE [dbo].[Omr_NumberBlock] DROP COLUMN [WebXCoordinate]
DECLARE @var58 nvarchar(128)
SELECT @var58 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.Omr_NumberBlock')
AND col_name(parent_object_id, parent_column_id) = 'WebYCoordinate';
IF @var58 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[Omr_NumberBlock] DROP CONSTRAINT [' + @var58 + ']')
ALTER TABLE [dbo].[Omr_NumberBlock] DROP COLUMN [WebYCoordinate]
DECLARE @var59 nvarchar(128)
SELECT @var59 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.Omr_NumberBlock')
AND col_name(parent_object_id, parent_column_id) = 'DimensionRatio';
IF @var59 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[Omr_NumberBlock] DROP CONSTRAINT [' + @var59 + ']')
ALTER TABLE [dbo].[Omr_NumberBlock] DROP COLUMN [DimensionRatio]
DECLARE @var60 nvarchar(128)
SELECT @var60 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.Slider_MainSlider')
AND col_name(parent_object_id, parent_column_id) = 'TenantId';
IF @var60 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[Slider_MainSlider] DROP CONSTRAINT [' + @var60 + ']')
ALTER TABLE [dbo].[Slider_MainSlider] DROP COLUMN [TenantId]
DECLARE @var61 nvarchar(128)
SELECT @var61 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.Examinations_Examination')
AND col_name(parent_object_id, parent_column_id) = 'QeustionSpace';
IF @var61 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[Examinations_Examination] DROP CONSTRAINT [' + @var61 + ']')
ALTER TABLE [dbo].[Examinations_Examination] DROP COLUMN [QeustionSpace]
DECLARE @var62 nvarchar(128)
SELECT @var62 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.QrCode_AppQrCode')
AND col_name(parent_object_id, parent_column_id) = 'FromUrl';
IF @var62 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[QrCode_AppQrCode] DROP CONSTRAINT [' + @var62 + ']')
ALTER TABLE [dbo].[QrCode_AppQrCode] DROP COLUMN [FromUrl]
DECLARE @var63 nvarchar(128)
SELECT @var63 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.QrCode_AppQrCode')
AND col_name(parent_object_id, parent_column_id) = 'RedirectUrl';
IF @var63 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[QrCode_AppQrCode] DROP CONSTRAINT [' + @var63 + ']')
ALTER TABLE [dbo].[QrCode_AppQrCode] DROP COLUMN [RedirectUrl]
DECLARE @var64 nvarchar(128)
SELECT @var64 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.OnlineLessons_OnlineLesson')
AND col_name(parent_object_id, parent_column_id) = 'MeetingProviderType';
IF @var64 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[OnlineLessons_OnlineLesson] DROP CONSTRAINT [' + @var64 + ']')
ALTER TABLE [dbo].[OnlineLessons_OnlineLesson] DROP COLUMN [MeetingProviderType]
DECLARE @var65 nvarchar(128)
SELECT @var65 = name
FROM sys.default_constraints
WHERE parent_object_id = object_id(N'dbo.OnlineLessons_ZoomUser')
AND col_name(parent_object_id, parent_column_id) = 'MeetingUserId';
IF @var65 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[OnlineLessons_ZoomUser] DROP CONSTRAINT [' + @var65 + ']')
ALTER TABLE [dbo].[OnlineLessons_ZoomUser] DROP COLUMN [MeetingUserId]
DROP TABLE [dbo].[Central_SystemMenuTenant]
DROP TABLE [dbo].[ExamApply_ExamBook]
DROP TABLE [dbo].[ExamApply_ExamBranch]
DROP TABLE [dbo].[MobileApp_Position]
DROP TABLE [dbo].[MobileApp_ChoiceMap]
DROP TABLE [dbo].[MobileApp_QuestionFile]
DROP TABLE [dbo].[MobileApp_QuestionSetting]
DROP TABLE [dbo].[MobileApp_BookFile]
DROP TABLE [dbo].[MobileApp_BookFileRole]
DROP TABLE [dbo].[MobileApp_BookKind]
DROP TABLE [dbo].[MobileApp_TenantBook]
DROP TABLE [dbo].[MobileApp_BookTheme]
DROP TABLE [dbo].[MobileApp_Theme]
DROP TABLE [dbo].[MobileApp_TryingExamPlanClassRoom]
DROP TABLE [dbo].[SmartBook_LibraryApp]
DROP TABLE [dbo].[Dealers_DealerSchool]
DROP TABLE [dbo].[Dealers_DealerUser]
DROP TABLE [dbo].[Dealers_DealerFile]
DROP TABLE [dbo].[QuestionPool_QuestionPoolCategory]
DROP TABLE [dbo].[QuestionPool_QuestionPoolCategoryClass]
DROP TABLE [dbo].[ExamEvaluation_UserExam]
DROP TABLE [dbo].[ExamEvaluation_OpticalFormTemplate]
DROP TABLE [dbo].[ExamEvaluation_ExamQuestion]
DROP TABLE [dbo].[ExamEvaluation_ExamQuestionGain]
DROP TABLE [dbo].[ExamEvaluation_AreaInformation]
DROP TABLE [dbo].[ExamEvaluation_ExamResult]
DROP TABLE [dbo].[ExamEvaluation_ExamUserAnswer]
DROP TABLE [dbo].[ExamEvaluation_ExamUserLessonStats]
DROP TABLE [dbo].[ExamEvaluation_ExamUserScores]
DROP TABLE [dbo].[Examinations_ExamTopicPattern]
DROP TABLE [dbo].[OnlineLessons_MeetingAccount]
DROP TABLE [dbo].[OnlineLessons_MeetingSchoolAccount]
DROP TABLE [dbo].[Assignments_AssignmentContent]
DROP TABLE [dbo].[PublicArea_Link]
DROP TABLE [dbo].[PublicArea_CatalogGroup]
DROP TABLE [dbo].[PublicArea_Catalog]
DROP TABLE [dbo].[PublicArea_CatalogPage]