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_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.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_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.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.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_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_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.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_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.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.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_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_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_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_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_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_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_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_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_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].[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].[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.Examinations_Examination')
AND col_name(parent_object_id, parent_column_id) = 'TryingExamCategoryId';
IF @var0 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[Examinations_Examination] DROP CONSTRAINT [' + @var0 + ']')
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 UNIQUE INDEX [IX_Guid] ON [dbo].[MobileApp_EducationYear]([Guid])
CREATE INDEX [IX_TryingExamCategoryId] ON [dbo].[Examinations_Examination]([TryingExamCategoryId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[QrCode_AppQrCode]([Guid])
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 @var1 nvarchar(128)
SELECT @var1 = 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 @var1 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[Central_School] DROP CONSTRAINT [' + @var1 + ']')
ALTER TABLE [dbo].[Central_School] DROP COLUMN [IsMainSchool]
DECLARE @var2 nvarchar(128)
SELECT @var2 = 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 @var2 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[Central_School] DROP CONSTRAINT [' + @var2 + ']')
ALTER TABLE [dbo].[Central_School] DROP COLUMN [ParentId]
DECLARE @var3 nvarchar(128)
SELECT @var3 = 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 @var3 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[Central_School] DROP CONSTRAINT [' + @var3 + ']')
ALTER TABLE [dbo].[Central_School] DROP COLUMN [TenantId]
DECLARE @var4 nvarchar(128)
SELECT @var4 = 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 @var4 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_AppBook] DROP CONSTRAINT [' + @var4 + ']')
ALTER TABLE [dbo].[MobileApp_AppBook] DROP COLUMN [DisplayPages]
DECLARE @var5 nvarchar(128)
SELECT @var5 = 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 @var5 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_AppBook] DROP CONSTRAINT [' + @var5 + ']')
ALTER TABLE [dbo].[MobileApp_AppBook] DROP COLUMN [BookKindId]
DECLARE @var6 nvarchar(128)
SELECT @var6 = 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 @var6 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_AppBook] DROP CONSTRAINT [' + @var6 + ']')
ALTER TABLE [dbo].[MobileApp_AppBook] DROP COLUMN [HideLibrary]
DECLARE @var7 nvarchar(128)
SELECT @var7 = 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 @var7 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_AppClass] DROP CONSTRAINT [' + @var7 + ']')
ALTER TABLE [dbo].[MobileApp_AppClass] DROP COLUMN [ClassOrder]
DECLARE @var8 nvarchar(128)
SELECT @var8 = 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 @var8 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_AppLesson] DROP CONSTRAINT [' + @var8 + ']')
ALTER TABLE [dbo].[MobileApp_AppLesson] DROP COLUMN [LessonCode]
DECLARE @var9 nvarchar(128)
SELECT @var9 = 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 @var9 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_Activity] DROP CONSTRAINT [' + @var9 + ']')
ALTER TABLE [dbo].[MobileApp_Activity] DROP COLUMN [Transcript]
DECLARE @var10 nvarchar(128)
SELECT @var10 = 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 @var10 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_Activity] DROP CONSTRAINT [' + @var10 + ']')
ALTER TABLE [dbo].[MobileApp_Activity] DROP COLUMN [LinkToPageNo]
DECLARE @var11 nvarchar(128)
SELECT @var11 = 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 @var11 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_Activity] DROP CONSTRAINT [' + @var11 + ']')
ALTER TABLE [dbo].[MobileApp_Activity] DROP COLUMN [IsActive]
DECLARE @var12 nvarchar(128)
SELECT @var12 = 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 @var12 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_Activity] DROP CONSTRAINT [' + @var12 + ']')
ALTER TABLE [dbo].[MobileApp_Activity] DROP COLUMN [PositionId]
DECLARE @var13 nvarchar(128)
SELECT @var13 = 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 @var13 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_BookContentLesson] DROP CONSTRAINT [' + @var13 + ']')
ALTER TABLE [dbo].[MobileApp_BookContentLesson] DROP COLUMN [ActivityId]
DECLARE @var14 nvarchar(128)
SELECT @var14 = 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 @var14 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_BookContentLesson] DROP CONSTRAINT [' + @var14 + ']')
ALTER TABLE [dbo].[MobileApp_BookContentLesson] DROP COLUMN [BookContentLessonType]
DECLARE @var15 nvarchar(128)
SELECT @var15 = 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 @var15 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_TestQuestion] DROP CONSTRAINT [' + @var15 + ']')
ALTER TABLE [dbo].[MobileApp_TestQuestion] DROP COLUMN [Point]
DECLARE @var16 nvarchar(128)
SELECT @var16 = 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 @var16 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_TestQuestion] DROP CONSTRAINT [' + @var16 + ']')
ALTER TABLE [dbo].[MobileApp_TestQuestion] DROP COLUMN [Page]
DECLARE @var17 nvarchar(128)
SELECT @var17 = 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 @var17 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_Question] DROP CONSTRAINT [' + @var17 + ']')
ALTER TABLE [dbo].[MobileApp_Question] DROP COLUMN [PositionId]
DECLARE @var18 nvarchar(128)
SELECT @var18 = 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 @var18 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_Question] DROP CONSTRAINT [' + @var18 + ']')
ALTER TABLE [dbo].[MobileApp_Question] DROP COLUMN [RootPositionId]
DECLARE @var19 nvarchar(128)
SELECT @var19 = 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 @var19 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_Question] DROP CONSTRAINT [' + @var19 + ']')
ALTER TABLE [dbo].[MobileApp_Question] DROP COLUMN [SolutionId]
DECLARE @var20 nvarchar(128)
SELECT @var20 = 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 @var20 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_Question] DROP CONSTRAINT [' + @var20 + ']')
ALTER TABLE [dbo].[MobileApp_Question] DROP COLUMN [SettingId]
DECLARE @var21 nvarchar(128)
SELECT @var21 = 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 @var21 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_Choice] DROP CONSTRAINT [' + @var21 + ']')
ALTER TABLE [dbo].[MobileApp_Choice] DROP COLUMN [SolutionAttachmentId]
DECLARE @var22 nvarchar(128)
SELECT @var22 = 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 @var22 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_Choice] DROP CONSTRAINT [' + @var22 + ']')
ALTER TABLE [dbo].[MobileApp_Choice] DROP COLUMN [PositionId]
DECLARE @var23 nvarchar(128)
SELECT @var23 = 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 @var23 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_Choice] DROP CONSTRAINT [' + @var23 + ']')
ALTER TABLE [dbo].[MobileApp_Choice] DROP COLUMN [Group]
DECLARE @var24 nvarchar(128)
SELECT @var24 = 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 @var24 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_TryingExamCategory] DROP CONSTRAINT [' + @var24 + ']')
ALTER TABLE [dbo].[MobileApp_TryingExamCategory] DROP COLUMN [UserId]
DECLARE @var25 nvarchar(128)
SELECT @var25 = 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 @var25 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_TryingExamCategory] DROP CONSTRAINT [' + @var25 + ']')
ALTER TABLE [dbo].[MobileApp_TryingExamCategory] DROP COLUMN [UseAsExamImportTemplate]
DECLARE @var26 nvarchar(128)
SELECT @var26 = 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 @var26 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_EducationYear] DROP CONSTRAINT [' + @var26 + ']')
ALTER TABLE [dbo].[MobileApp_EducationYear] DROP COLUMN [Title]
DECLARE @var27 nvarchar(128)
SELECT @var27 = 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 @var27 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_EducationYear] DROP CONSTRAINT [' + @var27 + ']')
ALTER TABLE [dbo].[MobileApp_EducationYear] DROP COLUMN [StartDate]
DECLARE @var28 nvarchar(128)
SELECT @var28 = 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 @var28 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_EducationYear] DROP CONSTRAINT [' + @var28 + ']')
ALTER TABLE [dbo].[MobileApp_EducationYear] DROP COLUMN [EndDate]
DECLARE @var29 nvarchar(128)
SELECT @var29 = 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 @var29 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_EducationYear] DROP CONSTRAINT [' + @var29 + ']')
ALTER TABLE [dbo].[MobileApp_EducationYear] DROP COLUMN [LibraryExpireDate]
DECLARE @var30 nvarchar(128)
SELECT @var30 = 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 @var30 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_TryingExamPlan] DROP CONSTRAINT [' + @var30 + ']')
ALTER TABLE [dbo].[MobileApp_TryingExamPlan] DROP COLUMN [IsPlannedForClassrooms]
DECLARE @var31 nvarchar(128)
SELECT @var31 = 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 @var31 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[SmartBook_SmGapFillingItem] DROP CONSTRAINT [' + @var31 + ']')
ALTER TABLE [dbo].[SmartBook_SmGapFillingItem] DROP COLUMN [SolutionBytes]
DECLARE @var32 nvarchar(128)
SELECT @var32 = 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 @var32 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[QuestionPool_QuestionPoolTest] DROP CONSTRAINT [' + @var32 + ']')
ALTER TABLE [dbo].[QuestionPool_QuestionPoolTest] DROP COLUMN [CustomLogoPosition]
DECLARE @var33 nvarchar(128)
SELECT @var33 = 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 @var33 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_UserTestResult] DROP CONSTRAINT [' + @var33 + ']')
ALTER TABLE [dbo].[MobileApp_UserTestResult] DROP COLUMN [AssignmentId]
DECLARE @var34 nvarchar(128)
SELECT @var34 = 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 @var34 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[MobileApp_UserTestResult] DROP CONSTRAINT [' + @var34 + ']')
ALTER TABLE [dbo].[MobileApp_UserTestResult] DROP COLUMN [Score]
DECLARE @var35 nvarchar(128)
SELECT @var35 = 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 @var35 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[Examinations_Examination] DROP CONSTRAINT [' + @var35 + ']')
ALTER TABLE [dbo].[Examinations_Examination] DROP COLUMN [QeustionSpace]
DECLARE @var36 nvarchar(128)
SELECT @var36 = 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 @var36 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[QrCode_AppQrCode] DROP CONSTRAINT [' + @var36 + ']')
ALTER TABLE [dbo].[QrCode_AppQrCode] DROP COLUMN [FromUrl]
DECLARE @var37 nvarchar(128)
SELECT @var37 = 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 @var37 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[QrCode_AppQrCode] DROP CONSTRAINT [' + @var37 + ']')
ALTER TABLE [dbo].[QrCode_AppQrCode] DROP COLUMN [RedirectUrl]
DECLARE @var38 nvarchar(128)
SELECT @var38 = 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 @var38 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[OnlineLessons_OnlineLesson] DROP CONSTRAINT [' + @var38 + ']')
ALTER TABLE [dbo].[OnlineLessons_OnlineLesson] DROP COLUMN [MeetingProviderType]
DECLARE @var39 nvarchar(128)
SELECT @var39 = 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 @var39 IS NOT NULL
EXECUTE('ALTER TABLE [dbo].[OnlineLessons_ZoomUser] DROP CONSTRAINT [' + @var39 + ']')
ALTER TABLE [dbo].[OnlineLessons_ZoomUser] DROP COLUMN [MeetingUserId]
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_BookTheme]
DROP TABLE [dbo].[MobileApp_Theme]
DROP TABLE [dbo].[MobileApp_TryingExamPlanClassRoom]
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_ExamUserScores]
DROP TABLE [dbo].[ExamEvaluation_ExamUserLessonStats]
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]