Kurulum Gerekiyor

Dikkat : Kurulum Verileri Yüklenecek

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

Setup


Tenant


Kurulacak Veritabanı Adı : keykoleji
Data Source : WIN-TTCB83P9FR6\MSSQLSERVER2019


SQLQUERY :
CREATE TABLE [dbo].[Common_Category] (
[Id] [int] NOT NULL IDENTITY,
[TenantId] [int] NOT NULL,
[PluginId] [nvarchar](max),
[ParentId] [int],
[Active] [bit] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Common_Category] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Common_CategoryTranslate] (
[Id] [int] NOT NULL IDENTITY,
[TenantId] [int] NOT NULL,
[CategoryId] [int] NOT NULL,
[LanguageId] [int] NOT NULL,
[Name] [nvarchar](max),
[SeoUrl] [nvarchar](max),
[Active] [bit] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Common_CategoryTranslate] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Common_Mail] (
[Id] [int] NOT NULL IDENTITY,
[TenantId] [int] NOT NULL,
[PriorityId] [int] NOT NULL,
[From] [nvarchar](max),
[FromName] [nvarchar](max),
[ReplyTo] [nvarchar](max),
[ReplyToName] [nvarchar](max),
[Cc] [nvarchar](max),
[Bcc] [nvarchar](max),
[Subject] [nvarchar](max),
[Body] [nvarchar](max),
[AttachmentFilePath] [nvarchar](max),
[AttachmentFileName] [nvarchar](max),
[AttachedDownloadId] [int] NOT NULL,
[DontSendBeforeDateUtc] [datetime],
[MailAccountId] [int],
[Priority] [int] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Common_Mail] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Common_MailAccount] (
[Id] [int] NOT NULL IDENTITY,
[Email] [nvarchar](max),
[DisplayName] [nvarchar](max),
[Host] [nvarchar](max),
[Port] [int] NOT NULL,
[Username] [nvarchar](max),
[Password] [nvarchar](max),
[EnableSsl] [bit] NOT NULL,
[IsDefault] [bit] NOT NULL,
[UseDefaultCredentials] [bit] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Common_MailAccount] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Common_MailRecipient] (
[Id] [int] NOT NULL IDENTITY,
[To] [nvarchar](max),
[ToName] [nvarchar](max),
[MailStatus] [int] NOT NULL,
[SentOn] [datetime],
[AttempCount] [int] NOT NULL,
[MailId] [int] NOT NULL,
CONSTRAINT [PK_dbo.Common_MailRecipient] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Common_MailTemplate] (
[Id] [int] NOT NULL IDENTITY,
[Name] [nvarchar](200) NOT NULL,
[BccEmailAddresses] [nvarchar](200),
[Subject] [nvarchar](1000),
[Body] [nvarchar](max),
[IsActive] [bit] NOT NULL,
[DelayBeforeSend] [int],
[DelayPeriodId] [int] NOT NULL,
[AttachedDownloadId] [int] NOT NULL,
[MailAccountId] [int] NOT NULL,
[LimitedToTenants] [bit] NOT NULL,
[DelayPeriod] [int] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Common_MailTemplate] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Common_Log] (
[Id] [int] NOT NULL IDENTITY,
[PluginId] [nvarchar](max),
[EntityId] [int] NOT NULL,
[EntityType] [nvarchar](max),
[EntityGuid] [uniqueidentifier] NOT NULL,
[Action] [nvarchar](max),
[Description] [nvarchar](max),
[UserId] [int],
[CreatedOn] [datetime] NOT NULL,
CONSTRAINT [PK_dbo.Common_Log] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[General_ScheduleTask] (
[Id] [int] NOT NULL IDENTITY,
[Name] [nvarchar](max),
[Seconds] [int] NOT NULL,
[Type] [nvarchar](max),
[Enabled] [bit] NOT NULL,
[StopOnError] [bit] NOT NULL,
[LeasedByMachineName] [nvarchar](max),
[LeasedUntilUtc] [datetime],
[LastStartUtc] [datetime],
[LastEndUtc] [datetime],
[LastSuccessUtc] [datetime],
CONSTRAINT [PK_dbo.General_ScheduleTask] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Central_LocaleStringResourceKey] (
[Id] [int] NOT NULL IDENTITY,
[Key] [nvarchar](max),
CONSTRAINT [PK_dbo.Central_LocaleStringResourceKey] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Central_LocaleStringResourceValue] (
[Id] [int] NOT NULL IDENTITY,
[LanguageId] [int] NOT NULL,
[Value] [nvarchar](max),
[LocaleStringResourceKeyId] [int] NOT NULL,
CONSTRAINT [PK_dbo.Central_LocaleStringResourceValue] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Central_Language] (
[Id] [int] NOT NULL IDENTITY,
[Culture] [nvarchar](10),
[Name] [nvarchar](max),
[SeoCode] [nvarchar](50),
[FlagFileName] [nvarchar](max),
[DisplayOrder] [int] NOT NULL,
[IsActive] [bit] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Central_Language] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Central_Settings] (
[Id] [int] NOT NULL IDENTITY,
[Key] [nvarchar](max),
[Value] [nvarchar](max),
[SettingsGroupId] [int] NOT NULL,
[TenantId] [int] NOT NULL,
CONSTRAINT [PK_dbo.Central_Settings] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Central_SettingsGroup] (
[Id] [int] NOT NULL IDENTITY,
[Name] [nvarchar](max),
[ShowOnTabs] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Central_SettingsGroup] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Central_SystemMenu] (
[Id] [int] NOT NULL IDENTITY,
[Title] [nvarchar](max),
[ParentId] [int],
[Face] [nvarchar](max),
[Area] [nvarchar](max),
[PluginId] [nvarchar](max),
[Controller] [nvarchar](max),
[Action] [nvarchar](max),
[Url] [nvarchar](max),
[Icon] [nvarchar](max),
[SystemName] [nvarchar](max),
[DisplayOrder] [int] NOT NULL,
[DisplayPlacesStrForDb] [nvarchar](max),
[PermissionsJsonForDb] [nvarchar](max),
[IsActive] [bit] NOT NULL,
[OpenInNewTab] [bit] NOT NULL,
[OpenInPopup] [bit] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Central_SystemMenu] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Central_SystemMenuTenant] (
[Id] [int] NOT NULL IDENTITY,
[SystemMenuId] [int] NOT NULL,
[TenantId] [int] NOT NULL,
CONSTRAINT [PK_dbo.Central_SystemMenuTenant] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Central_SystemMenuTranslate] (
[Id] [int] NOT NULL IDENTITY,
[SystemMenuId] [int] NOT NULL,
[SystemLanguageId] [int] NOT NULL,
[Title] [nvarchar](max),
CONSTRAINT [PK_dbo.Central_SystemMenuTranslate] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Central_Tenant] (
[Id] [int] NOT NULL IDENTITY,
[Code] [nvarchar](20),
[Title] [nvarchar](max),
[Description] [nvarchar](max),
[Keywords] [nvarchar](max),
[IsApproved] [bit] NOT NULL,
[IsActive] [bit] NOT NULL,
[Url] [nvarchar](max),
[SslEnabled] [bit] NOT NULL,
[SecureUrl] [nvarchar](max),
[Hosts] [nvarchar](max),
[DefaultLanguageId] [int] NOT NULL,
[DisplayOrder] [int] NOT NULL,
[Phone] [nvarchar](max),
[Adress] [nvarchar](max),
[MapLink] [nvarchar](max),
[Logo] [nvarchar](max),
[Email] [nvarchar](max),
[FacebookLink] [nvarchar](max),
[TwitterLink] [nvarchar](max),
[InstagramLink] [nvarchar](max),
[GoogleAnalyticsCode] [nvarchar](max),
[FacebookPixelCode] [nvarchar](max),
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Central_Tenant] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Central_User] (
[Id] [int] NOT NULL IDENTITY,
[TenantId] [int],
[SystemRole] [int] NOT NULL,
[UserName] [nvarchar](100),
[IdentityNumber] [nvarchar](11),
[PasswordHash] [nvarchar](max),
[PasswordSalt] [nvarchar](max),
[ResetPasswordGuid] [uniqueidentifier],
[ResetPasswordCode] [nvarchar](max),
[ResetPasswordExpiry] [datetime],
[FailedLoginAttempts] [int] NOT NULL,
[CannotLoginUntilDate] [datetime],
[CurrentEncryption] [nvarchar](max),
[Email] [nvarchar](100),
[MailActive] [bit],
[FirstName] [nvarchar](max),
[LastName] [nvarchar](max),
[Title] [nvarchar](max),
[Avatar] [nvarchar](max),
[MobilePhone] [nvarchar](max),
[LanguageId] [int],
[SystemThemeId] [int] NOT NULL,
[UserDirectoryId] [int],
[OneSignalPlayerId] [nvarchar](max),
[UserDirectoryGuid] [uniqueidentifier],
[IsActive] [bit] NOT NULL,
[SchoolId] [int],
[RejectReason] [nvarchar](max),
[LastIpAddress] [char](15),
[LastLoginDateUtc] [datetime],
[LastActivityDateUtc] [datetime] NOT NULL,
[UserFile] [nvarchar](max),
[StudentNumber] [char](15),
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Central_User] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Central_ExternalAuthenticationRecord] (
[Id] [int] NOT NULL IDENTITY,
[UserId] [int] NOT NULL,
[Email] [nvarchar](max),
[ExternalIdentifier] [nvarchar](max),
[ExternalDisplayIdentifier] [nvarchar](max),
[OAuthToken] [nvarchar](max),
[OAuthAccessToken] [nvarchar](max),
[ProviderSystemName] [nvarchar](max),
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Central_ExternalAuthenticationRecord] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Central_PermiUserScreenAction] (
[Id] [int] NOT NULL IDENTITY,
[UserId] [int] NOT NULL,
[PermiScreenActionId] [int] NOT NULL,
[Allow] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Central_PermiUserScreenAction] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Central_PermiScreenAction] (
[Id] [int] NOT NULL IDENTITY,
[PermiScreenId] [int] NOT NULL,
[PermiActionId] [int] NOT NULL,
[Active] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Central_PermiScreenAction] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Central_PermiAction] (
[Id] [int] NOT NULL IDENTITY,
[Code] [nvarchar](max),
[Description] [nvarchar](max),
[ForMatrix] [bit] NOT NULL,
[Active] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Central_PermiAction] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Central_PermiScreen] (
[Id] [int] NOT NULL IDENTITY,
[PluginId] [nvarchar](max),
[Code] [nvarchar](max),
[Description] [nvarchar](max),
[Active] [bit] NOT NULL,
[Order] [int] NOT NULL,
CONSTRAINT [PK_dbo.Central_PermiScreen] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Central_School] (
[Id] [int] NOT NULL IDENTITY,
[Name] [nvarchar](max) NOT NULL,
[DistrictId] [int] NOT NULL,
[Address] [nvarchar](max),
[PhoneNumber] [nvarchar](max),
[WebSiteUrl] [nvarchar](max),
[IsUserCreated] [bit] NOT NULL,
[IsMainSchool] [bit] NOT NULL,
[UseForMySchoolPlugin] [bit] NOT NULL,
[SchoolType] [int] NOT NULL,
[MernisCode] [nvarchar](15),
[ParentId] [int],
[TenantId] [int],
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Central_School] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Central_District] (
[Id] [int] NOT NULL IDENTITY,
[Name] [nvarchar](max) NOT NULL,
[Code] [nvarchar](max),
[ProvinceId] [int] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Central_District] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Central_Province] (
[Id] [int] NOT NULL IDENTITY,
[Name] [nvarchar](max) NOT NULL,
[PlateCode] [nvarchar](max) NOT NULL,
[Code] [nvarchar](max),
[CountryId] [int] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Central_Province] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Central_Country] (
[Id] [int] NOT NULL IDENTITY,
[Name] [nvarchar](max) NOT NULL,
[Code] [nvarchar](max) NOT NULL,
[IsDefault] [bit] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Central_Country] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Central_UserData] (
[Id] [int] NOT NULL IDENTITY,
[UserId] [int] NOT NULL,
CONSTRAINT [PK_dbo.Central_UserData] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Central_UserDirectory] (
[Id] [int] NOT NULL IDENTITY,
[TenantId] [int] NOT NULL,
[Name] [nvarchar](max),
[Type] [nvarchar](max),
[Server] [nvarchar](max),
[UserName] [nvarchar](max),
[Password] [nvarchar](max),
[Approved] [bit] NOT NULL,
[Active] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Central_UserDirectory] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Central_UserGroup] (
[Id] [int] NOT NULL IDENTITY,
[Name] [nvarchar](max) NOT NULL,
[ParentId] [int],
[Order] [int] NOT NULL,
[UserGroupType] [int] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Central_UserGroup] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Central_UserRelation] (
[Id] [int] NOT NULL IDENTITY,
[UserId] [int] NOT NULL,
[RelatedUserId] [int] NOT NULL,
CONSTRAINT [PK_dbo.Central_UserRelation] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Central_UserRole] (
[Id] [int] NOT NULL IDENTITY,
[TenantId] [int] NOT NULL,
[UserId] [int] NOT NULL,
[RoleId] [int] NOT NULL,
CONSTRAINT [PK_dbo.Central_UserRole] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Central_Role] (
[Id] [int] NOT NULL IDENTITY,
[Name] [nvarchar](max) NOT NULL,
[DisplayName] [nvarchar](max),
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Central_Role] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Central_PermiRoleScreenAction] (
[Id] [int] NOT NULL IDENTITY,
[RoleId] [int] NOT NULL,
[PermiScreenActionId] [int] NOT NULL,
[Allow] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Central_PermiRoleScreenAction] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Central_ErrorLog] (
[Id] [int] NOT NULL IDENTITY,
[TenantId] [int],
[Date] [datetime] NOT NULL,
[UserId] [int],
[Screen] [nvarchar](max),
[Type] [nvarchar](max),
[Message] [nvarchar](max),
[StackTrace] [nvarchar](max),
[ErrorLogLevel] [int] NOT NULL,
CONSTRAINT [PK_dbo.Central_ErrorLog] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Central_LoginLog] (
[Id] [int] NOT NULL IDENTITY,
[Date] [datetime] NOT NULL,
[TenantId] [int],
[UserId] [int],
[Ip] [nvarchar](max),
[Status] [int] NOT NULL,
[TryTenantCode] [nvarchar](max),
[TryUserName] [nvarchar](max),
CONSTRAINT [PK_dbo.Central_LoginLog] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Central_IpRule] (
[Id] [int] NOT NULL IDENTITY,
[TenantId] [int] NOT NULL,
[FromIp] [nvarchar](max),
[ToIp] [nvarchar](max),
[Blocked] [bit] NOT NULL,
[Approved] [bit] NOT NULL,
[Active] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Central_IpRule] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Attachments_Attachment] (
[Id] [int] NOT NULL IDENTITY,
[Title] [nvarchar](max),
[Description] [nvarchar](max),
[AttachmentFolderId] [int],
[FileExtension] [nvarchar](max),
[MimeType] [nvarchar](max),
[FileUrl] [nvarchar](max),
[Size] [bigint] NOT NULL,
[FileName] [nvarchar](max),
[DisplayOrder] [int] NOT NULL,
[DownloadCount] [int] NOT NULL,
[FileBinary] [varbinary](max),
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Attachments_Attachment] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Attachments_AttachmentFolder] (
[Id] [int] NOT NULL IDENTITY,
[SeoUrl] [nvarchar](max) NOT NULL,
[ParentPath] [nvarchar](max),
[FolderPath] [nvarchar](max),
[Title] [nvarchar](max) NOT NULL,
[Description] [nvarchar](max),
[ParentId] [int],
[DisplayOrder] [int] NOT NULL,
[IsHidden] [bit] NOT NULL,
[IsActive] [bit] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Attachments_AttachmentFolder] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Chat_ChatMessage] (
[Id] [int] NOT NULL IDENTITY,
[SenderId] [int] NOT NULL,
[RoomId] [int] NOT NULL,
[Message] [nvarchar](max),
[IsRead] [bit] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Chat_ChatMessage] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[ExamApply_ExamClass] (
[Id] [int] NOT NULL IDENTITY,
[Name] [nvarchar](max),
[DisplayOrder] [int] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.ExamApply_ExamClass] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[ExamApply_ExamDate] (
[Id] [int] NOT NULL IDENTITY,
[Date] [datetime] NOT NULL,
[ExamDateHint] [nvarchar](max),
[ExamClassId] [int] NOT NULL,
[IsGeneralExam] [bit] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.ExamApply_ExamDate] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[ExamApply_ExamApplyResult] (
[Id] [int] NOT NULL IDENTITY,
[UserName] [nvarchar](max),
[PhoneNumber] [nvarchar](max),
[Email] [nvarchar](max),
[Province] [nvarchar](max),
[BranchName] [nvarchar](max),
[IdentityNumber] [nvarchar](max),
[District] [nvarchar](max),
[SchoolName] [nvarchar](max),
[CourseTypeName] [nvarchar](max),
[Address] [nvarchar](max),
[UserFile] [nvarchar](max),
[BookNames] [nvarchar](max),
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.ExamApply_ExamApplyResult] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[ExamApply_ExamBook] (
[Id] [int] NOT NULL IDENTITY,
[Name] [nvarchar](max),
[ExamBranchId] [int] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.ExamApply_ExamBook] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[ExamApply_ExamBranch] (
[Id] [int] NOT NULL IDENTITY,
[Name] [nvarchar](max),
[DisplayOrder] [int] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.ExamApply_ExamBranch] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[ExamApply_ExamApplyResultDate] (
[Id] [int] NOT NULL IDENTITY,
[ExamApplyResultId] [int] NOT NULL,
[ExamDateId] [int] NOT NULL,
CONSTRAINT [PK_dbo.ExamApply_ExamApplyResultDate] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Messaging_Message] (
[Id] [int] NOT NULL IDENTITY,
[SenderId] [int] NOT NULL,
[Content] [nvarchar](max),
[IsActive] [bit] NOT NULL,
[MessageConversationId] [int] NOT NULL,
[ReplayMessageId] [int] NOT NULL,
[Attachment] [nvarchar](max),
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Messaging_Message] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Messaging_MessageConversation] (
[Id] [int] NOT NULL IDENTITY,
[LastMessageId] [int] NOT NULL,
CONSTRAINT [PK_dbo.Messaging_MessageConversation] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Messaging_MessageParticipant] (
[Id] [int] NOT NULL IDENTITY,
[UserId] [int] NOT NULL,
[MessageConversationId] [int] NOT NULL,
[IsActive] [bit] NOT NULL,
[IsCreator] [bit] NOT NULL,
[JoinTime] [datetime] NOT NULL,
[UnreadMessageCount] [int] NOT NULL,
CONSTRAINT [PK_dbo.Messaging_MessageParticipant] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[News_NewsItem] (
[Id] [int] NOT NULL IDENTITY,
[Title] [nvarchar](max),
[Summary] [nvarchar](max),
[Content] [nvarchar](max),
[ImageUrl] [nvarchar](max),
[AllowComments] [bit] NOT NULL,
[PublishDate] [datetime] NOT NULL,
[EndDate] [datetime],
[DisplayCount] [int] NOT NULL,
[SeoUrl] [nvarchar](max),
[IsMobile] [bit] NOT NULL,
[IsHeadLine] [bit] NOT NULL,
[IsActive] [bit] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
[Category_Id] [int],
[NewsToUser_Id] [int],
CONSTRAINT [PK_dbo.News_NewsItem] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[News_NewsCategory] (
[Id] [int] NOT NULL IDENTITY,
[ParentId] [int] NOT NULL,
[Name] [nvarchar](max),
[Description] [nvarchar](max),
[IsActive] [bit] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.News_NewsCategory] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[News_NewsComment] (
[Id] [int] NOT NULL IDENTITY,
[Content] [nvarchar](max),
[IsConfirm] [bit] NOT NULL,
[Like] [int] NOT NULL,
[Dislike] [int] NOT NULL,
[UserName] [nvarchar](max),
[Email] [nvarchar](max),
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
[News_Id] [int],
[User_Id] [int],
CONSTRAINT [PK_dbo.News_NewsComment] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[News_NewsToUser] (
[Id] [int] NOT NULL IDENTITY,
[UserId] [int] NOT NULL,
CONSTRAINT [PK_dbo.News_NewsToUser] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[News_NewsUserGroup] (
[Id] [int] NOT NULL IDENTITY,
[NewsItemId] [int] NOT NULL,
[UserGroupId] [int] NOT NULL,
CONSTRAINT [PK_dbo.News_NewsUserGroup] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[News_NewsTag] (
[Id] [int] NOT NULL IDENTITY,
[Name] [nvarchar](max),
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.News_NewsTag] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[SmartBoardAdmin_SmartBookItem] (
[Id] [int] NOT NULL IDENTITY,
[BookName] [nvarchar](max),
[Isbn] [nvarchar](max),
[BookType] [int] NOT NULL,
[AppClassId] [int] NOT NULL,
[AppLessonId] [int] NOT NULL,
[AppBookCategoryId] [int],
[ClientId] [int],
[ClientName] [nvarchar](max),
[OperatorId] [int],
[SmartBookPdfId] [int] NOT NULL,
[CoverImageId] [int],
[SmartBookId] [int],
[OperationStatus] [int] NOT NULL,
[UrgencyDegreeType] [int] NOT NULL,
[RelatedAppBookId] [int],
[IsPromotion] [bit] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.SmartBoardAdmin_SmartBookItem] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_AppBookCategory] (
[Id] [int] NOT NULL IDENTITY,
[Name] [nvarchar](max) NOT NULL,
[Description] [nvarchar](max),
[Image] [nvarchar](max),
[DisplayOrder] [int] NOT NULL,
[IsActive] [bit] NOT NULL,
[ParentId] [int],
[IncludeInTopMenu] [bit] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_AppBookCategory] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_AppBook] (
[Id] [int] NOT NULL IDENTITY,
[Name] [nvarchar](max),
[AuthorName] [nvarchar](max),
[AppBookPublisherId] [int],
[Isbn] [nvarchar](max),
[Price] [float] NOT NULL,
[OldPrice] [float] NOT NULL,
[ShopUrl] [nvarchar](max),
[AttachmentId] [int],
[SolutionAttachmentId] [int],
[PrintingAttachmentId] [int],
[BookType] [int] NOT NULL,
[CoverImageUrl] [nvarchar](max),
[CoverImageThumbUrl] [nvarchar](max),
[DisplayOrder] [int] NOT NULL,
[AppClassId] [int] NOT NULL,
[AppLessonId] [int],
[DisplayStartPageNumber] [int],
[DisplayEndPageNumber] [int],
[DisplayPages] [nvarchar](max),
[IsActive] [bit] NOT NULL,
[IsPageConverted] [bit] NOT NULL,
[SmartBoardBookId] [int],
[SmartBoardCoverImageUrl] [nvarchar](max),
[SmartBoardAttachmentUrl] [nvarchar](max),
[AttachmentFolderId] [int],
[SmartBookAttachmentId] [int],
[SheetTemplateId] [int],
[TestQrCodeStartIndex] [int] NOT NULL,
[EducationYearId] [int],
[BookLetCount] [int],
[AppBookCategoryId] [int],
[ParentAppBookId] [int],
[BookFlipBookUrl] [nvarchar](max),
[AppBookDescription] [nvarchar](max),
[IsActiveForSolutionSystem] [bit] NOT NULL,
[SmartBookVersionId] [int],
[UseForQuestionPool] [bit] NOT NULL,
[VideoAccessByOnlyQrCode] [bit] NOT NULL,
[BookKindId] [int],
[HideLibrary] [bit] NOT NULL,
[AccessCode] [nvarchar](max),
[RelatedTryingExamId] [int],
[TryingExamCategoryId] [int],
[ExamStartDate] [datetime],
[ExamEndDate] [datetime],
[IsCollectiveTryingExam] [bit] NOT NULL,
[TryingExamCategorySectionId] [int],
[IsHaveSpecialDate] [bit] NOT NULL,
[IsTimeLimited] [bit] NOT NULL,
[ExamDuration] [int],
[IsDownloadable] [bit] NOT NULL,
[TryingExamCount] [int],
[IsActivationCodeRequired] [bit] NOT NULL,
[SolveType] [int] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_AppBook] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_AppBookPackagesToBook] (
[Id] [int] NOT NULL IDENTITY,
[AppBookId] [int] NOT NULL,
[AppBookPackagesId] [int] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_AppBookPackagesToBook] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_AppBookPackages] (
[Id] [int] NOT NULL IDENTITY,
[Name] [nvarchar](max),
[Order] [int] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_AppBookPackages] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_AppBookPermission] (
[Id] [int] NOT NULL IDENTITY,
[AppBookId] [int] NOT NULL,
[AppBookAction] [int] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_AppBookPermission] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_AppBookPermissionRole] (
[Id] [int] NOT NULL IDENTITY,
[AppBookPermissionId] [int] NOT NULL,
[IsAllowed] [bit] NOT NULL,
[RoleId] [int] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_AppBookPermissionRole] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_AppBookPermissionSchool] (
[Id] [int] NOT NULL IDENTITY,
[AppBookPermissionId] [int] NOT NULL,
[IsAllowed] [bit] NOT NULL,
[SchoolId] [int] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_AppBookPermissionSchool] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_AppBookPermissionUser] (
[Id] [int] NOT NULL IDENTITY,
[AppBookPermissionId] [int] NOT NULL,
[IsAllowed] [bit] NOT NULL,
[UserId] [int] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_AppBookPermissionUser] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_AppBookPublisher] (
[Id] [int] NOT NULL IDENTITY,
[Name] [nvarchar](max),
[Logo] [nvarchar](max),
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_AppBookPublisher] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_AppBookUserGroups] (
[Id] [int] NOT NULL IDENTITY,
[UserGroupId] [int] NOT NULL,
[AppBookId] [int] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_AppBookUserGroups] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_AppClass] (
[Id] [int] NOT NULL IDENTITY,
[Name] [nvarchar](max),
[Order] [int] NOT NULL,
[ClassOrder] [int] NOT NULL,
[UserGroupId] [int] NOT NULL,
[HasTimeTable] [bit] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_AppClass] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_AppLesson] (
[Id] [int] NOT NULL IDENTITY,
[Name] [nvarchar](max),
[Order] [int] NOT NULL,
[SmartBookLessonId] [int] NOT NULL,
[CanAddSolutionVideo] [bit] NOT NULL,
[LessonCode] [nvarchar](max),
[UserGroupId] [int],
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_AppLesson] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_BookContent] (
[Id] [int] NOT NULL IDENTITY,
[Name] [nvarchar](max),
[StartPageNumber] [int] NOT NULL,
[EndPageNumber] [int] NOT NULL,
[DisplayOrder] [int] NOT NULL,
[AppBookId] [int] NOT NULL,
[BookLetCount] [int],
[ParentBookContentId] [int],
[TryingExamCategorySectionId] [int],
[AttachmentFolderId] [int],
[VideoAttachmentId] [int],
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_BookContent] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_Activity] (
[Id] [int] NOT NULL IDENTITY,
[Title] [nvarchar](max),
[Description] [nvarchar](max),
[Transcript] [nvarchar](max),
[LinkToPageNo] [int],
[GameLink] [nvarchar](max),
[ContentAttachmentId] [int],
[PageNumber] [int] NOT NULL,
[IsActive] [bit] NOT NULL,
[BookContentId] [int] NOT NULL,
[PositionId] [int],
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_Activity] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_Position] (
[Id] [int] NOT NULL IDENTITY,
[PageNumber] [int] NOT NULL,
[X] [float] NOT NULL,
[Y] [float] NOT NULL,
[Width] [float] NOT NULL,
[Height] [float] NOT NULL,
[ImageWidth] [float] NOT NULL,
[ImageHeight] [float] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_Position] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_BookContentLesson] (
[Id] [int] NOT NULL IDENTITY,
[Name] [nvarchar](max),
[BookContentId] [int] NOT NULL,
[SolutionVideoId] [int],
[AttachmentFolderId] [int],
[AttactmentId] [int],
[IsPublished] [bit] NOT NULL,
[PublishedDateTime] [datetime] NOT NULL,
[ActivityId] [int] NOT NULL,
[BookContentLessonType] [int] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
[Attachment_Id] [int],
CONSTRAINT [PK_dbo.MobileApp_BookContentLesson] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_SolutionVideo] (
[Id] [int] NOT NULL IDENTITY,
[VideoAttachmentId] [int],
[UserId] [int] NOT NULL,
[IsApproved] [bit],
[IsConverted] [bit] NOT NULL,
[ViewCount] [int] NOT NULL,
[XamlUrl] [nvarchar](max),
[SwfUrl] [nvarchar](max),
[Mp3Url] [nvarchar](max),
[ExternalUrl] [nvarchar](max),
[Width] [int],
[Height] [int],
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_SolutionVideo] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_Test] (
[Id] [int] NOT NULL IDENTITY,
[Name] [nvarchar](max),
[DisplayOrder] [int] NOT NULL,
[StartTime] [datetime],
[EndTime] [datetime],
[TypeOfTestContent] [int] NOT NULL,
[ChoiceCount] [int],
[IsActive] [bit] NOT NULL,
[BookContentId] [int],
[QuestionCount] [int] NOT NULL,
[LessonId] [int],
[TryingExamCategorySectionLessonId] [int],
[StartPageNumber] [int],
[EndPageNumber] [int],
[AreSolutionsPublished] [bit] NOT NULL,
[AttachmentFolderId] [int],
[SheetTemplateId] [int],
[UserId] [int],
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_Test] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Omr_SheetTemplate] (
[Id] [int] NOT NULL IDENTITY,
[Name] [nvarchar](max),
[SheetBoundsWidth] [int] NOT NULL,
[SheetBoundsHeight] [int] NOT NULL,
[MaxBlobSizeRatio] [float] NOT NULL,
[MinBlobSizeRatio] [float] NOT NULL,
[IsDefaultTemplate] [bit] NOT NULL,
[QrCodeEnable] [bit] NOT NULL,
[SheetSizeId] [int] NOT NULL,
[Margin] [int] NOT NULL,
[OmrImgScale] [float] NOT NULL,
[MarkSize] [int] NOT NULL,
[OptionsCount] [int] NOT NULL,
[ExamName] [nvarchar](max),
[OpticalChar] [nvarchar](max),
[BookLetType] [nvarchar](max),
[PrimaryColorHex] [nvarchar](max),
[SecondaryColorHex] [nvarchar](max),
[PrimaryTextColorHex] [nvarchar](max),
[SecondaryTextColorHex] [nvarchar](max),
[PaperHeaderTextColorHex] [nvarchar](max),
[CornerMarkDimension] [int] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Omr_SheetTemplate] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_TestQuestion] (
[Id] [int] NOT NULL IDENTITY,
[QuestionId] [int] NOT NULL,
[BookLetType] [int],
[TestId] [int] NOT NULL,
[Order] [int] NOT NULL,
[SmartBookTestId] [int],
[SmartBookQuestionId] [int],
[Point] [float],
[Page] [int],
CONSTRAINT [PK_dbo.MobileApp_TestQuestion] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_QuestionComment] (
[Id] [int] NOT NULL IDENTITY,
[Comment] [nvarchar](max),
[IsSolved] [bit] NOT NULL,
[TestQuestionId] [int] NOT NULL,
[QuestionCommentType] [int] NOT NULL,
[UserId] [int] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_QuestionComment] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_Question] (
[Id] [int] NOT NULL IDENTITY,
[Content] [nvarchar](max),
[CorrectAnswer] [nvarchar](max),
[DisplayText] [nvarchar](max),
[QuestionType] [int] NOT NULL,
[DifficultyLevel] [int] NOT NULL,
[IsActive] [bit] NOT NULL,
[DisplayOrder] [int] NOT NULL,
[AttachmentId] [int],
[RootQuestionAttachmentId] [int],
[IsAskedQuestion] [bit] NOT NULL,
[AskedQuestionExamName] [nvarchar](max),
[UseForQuestionPool] [bit] NOT NULL,
[HideOnSolutionApp] [bit] NOT NULL,
[UploadedBySchool] [bit] NOT NULL,
[PositionId] [int],
[RootPositionId] [int],
[SolutionId] [int],
[SettingId] [int],
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_Question] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_Choice] (
[Id] [int] NOT NULL IDENTITY,
[Name] [nvarchar](max),
[Description] [nvarchar](max),
[IsCorrect] [bit] NOT NULL,
[Content] [nvarchar](max),
[AttachmentId] [int],
[SolutionAttachmentId] [int],
[QuestionId] [int] NOT NULL,
[PositionId] [int],
[Group] [int],
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_Choice] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_ChoiceMap] (
[Id] [int] NOT NULL IDENTITY,
[SourceId] [int] NOT NULL,
[TargetId] [int] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_ChoiceMap] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_QuestionFile] (
[Id] [int] NOT NULL IDENTITY,
[FileType] [int] NOT NULL,
[DisplayOrder] [int] NOT NULL,
[QuestionId] [int] NOT NULL,
[Transcript] [nvarchar](max),
[FileUrl] [nvarchar](max),
[FileId] [int],
[PositionId] [int],
CONSTRAINT [PK_dbo.MobileApp_QuestionFile] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_QuestionSetting] (
[Id] [int] NOT NULL IDENTITY,
[HasCompleteButton] [bit] NOT NULL,
[HasSoundAlert] [bit] NOT NULL,
[CustomOptions] [nvarchar](max),
CONSTRAINT [PK_dbo.MobileApp_QuestionSetting] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_Solution] (
[Id] [int] NOT NULL IDENTITY,
[Content] [nvarchar](max),
[QuestionId] [int] NOT NULL,
[AttachmentId] [int],
[SolutionType] [int] NOT NULL,
[VideoId] [int],
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_Solution] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_TryingExamCategorySectionLesson] (
[Id] [int] NOT NULL IDENTITY,
[TryingExamCategorySectionId] [int] NOT NULL,
[LessonId] [int] NOT NULL,
[QuestionCount] [int] NOT NULL,
[DisplayOrder] [int] NOT NULL,
[OrLessonId] [int],
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_TryingExamCategorySectionLesson] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_LessonCoefficient] (
[Id] [int] NOT NULL IDENTITY,
[TryingExamCategorySectionLessonId] [int] NOT NULL,
[ScoreTypeId] [int] NOT NULL,
[Coefficient] [real] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_LessonCoefficient] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_ScoreType] (
[Id] [int] NOT NULL IDENTITY,
[Name] [nvarchar](max),
[BaseScore] [real] NOT NULL,
[FactorConstant] [int] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_ScoreType] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_TryingExamCategorySection] (
[Id] [int] NOT NULL IDENTITY,
[Name] [nvarchar](max),
[Order] [int] NOT NULL,
[TryingExamCategoryId] [int] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_TryingExamCategorySection] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_TryingExamCategory] (
[Id] [int] NOT NULL IDENTITY,
[Name] [nvarchar](max),
[Code] [nvarchar](max),
[BaseScore] [real] NOT NULL,
[IsActive] [bit] NOT NULL,
[UseForCalculateScore] [bit] NOT NULL,
[Order] [int] NOT NULL,
[ChoiceCount] [int] NOT NULL,
[SheetTemplateId] [int],
[RelatedTryingExamCategoryId] [int],
[UserId] [int] NOT NULL,
[UseAsExamImportTemplate] [bit] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_TryingExamCategory] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_TryingExamCategoryClass] (
[Id] [int] NOT NULL IDENTITY,
[TryingExamCategoryId] [int] NOT NULL,
[AppClassId] [int] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_TryingExamCategoryClass] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_TryingExamCategoryScoreType] (
[Id] [int] NOT NULL IDENTITY,
[TryingExamCategoryId] [int] NOT NULL,
[ScoreTypeId] [int] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_TryingExamCategoryScoreType] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_BookFile] (
[Id] [int] NOT NULL IDENTITY,
[Title] [nvarchar](max),
[Link] [nvarchar](max),
[DisplayOrder] [int] NOT NULL,
[IsActive] [bit] NOT NULL,
[BookFileType] [int],
[FileViewType] [int],
[BookId] [int] NOT NULL,
[FileId] [int],
CONSTRAINT [PK_dbo.MobileApp_BookFile] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_BookFileRole] (
[Id] [int] NOT NULL IDENTITY,
[RoleId] [int] NOT NULL,
[BookFileId] [int] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_BookFileRole] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_BookKind] (
[Id] [int] NOT NULL IDENTITY,
[Title] [nvarchar](max),
[DisplayOrder] [int] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_BookKind] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_EducationYear] (
[Id] [int] NOT NULL IDENTITY,
[Title] [nvarchar](max),
[StartDate] [datetime] NOT NULL,
[EndDate] [datetime] NOT NULL,
[LibraryExpireDate] [datetime],
CONSTRAINT [PK_dbo.MobileApp_EducationYear] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_BookPage] (
[Id] [int] NOT NULL IDENTITY,
[PageNumber] [int] NOT NULL,
[AttachmentId] [int] NOT NULL,
[BookId] [int] NOT NULL,
[IsSolutionPage] [bit] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_BookPage] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[SmartBook_SmartBookVersion] (
[Id] [int] NOT NULL IDENTITY,
[AttachmentId] [int] NOT NULL,
[Version] [nvarchar](max),
[Description] [nvarchar](max),
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.SmartBook_SmartBookVersion] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_TenantBook] (
[Id] [int] NOT NULL IDENTITY,
[Title] [nvarchar](max),
[TenantId] [int] NOT NULL,
[BookId] [int] NOT NULL,
[CoverImageId] [int],
CONSTRAINT [PK_dbo.MobileApp_TenantBook] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_BookTheme] (
[Id] [int] NOT NULL IDENTITY,
[BookId] [int] NOT NULL,
[ThemeId] [int] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_BookTheme] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_Theme] (
[Id] [int] NOT NULL IDENTITY,
[Title] [nvarchar](max),
[DisplayOrder] [int] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_Theme] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_TryingExamPlan] (
[Id] [int] NOT NULL IDENTITY,
[Title] [nvarchar](max),
[Description] [nvarchar](max),
[TryingExamId] [int] NOT NULL,
[SchoolId] [int] NOT NULL,
[CreatorUserId] [int] NOT NULL,
[StartDate] [datetime] NOT NULL,
[EndDate] [datetime] NOT NULL,
[IsTimeLimited] [bit] NOT NULL,
[ExamDuration] [int],
[IsPlannedForClassrooms] [bit] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_TryingExamPlan] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_TryingExamPlanClassRoom] (
[Id] [int] NOT NULL IDENTITY,
[ClassRoomId] [int] NOT NULL,
[PlanId] [int] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_TryingExamPlanClassRoom] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[SmartBoardAdmin_SmartBookItemComment] (
[Id] [int] NOT NULL IDENTITY,
[CommentUserId] [int] NOT NULL,
[Comment] [nvarchar](max),
[CommentDateTime] [datetime] NOT NULL,
[CommentUserName] [nvarchar](max),
[SmartBookItemId] [int] NOT NULL,
[CommentAttachmentId] [int],
[AttachmentType] [int],
[IsFinished] [bit] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.SmartBoardAdmin_SmartBookItemComment] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[SmartBook_SmGapFilling] (
[Id] [int] NOT NULL IDENTITY,
[BookId] [int] NOT NULL,
[PageNumber] [int] NOT NULL,
[QuestionPositionLeft] [float] NOT NULL,
[QuestionPositionTop] [float] NOT NULL,
[W] [float] NOT NULL,
[H] [float] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.SmartBook_SmGapFilling] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[SmartBook_SmGapFillingItem] (
[Id] [int] NOT NULL IDENTITY,
[SmBookId] [int] NOT NULL,
[PageNumber] [int] NOT NULL,
[GapFillingId] [int] NOT NULL,
[Type] [int] NOT NULL,
[Value] [nvarchar](max),
[X] [float] NOT NULL,
[Y] [float] NOT NULL,
[Width] [float] NOT NULL,
[Height] [float] NOT NULL,
[OrginalImageWidth] [float] NOT NULL,
[OrginalImageHeight] [float] NOT NULL,
[IconX] [float] NOT NULL,
[IconY] [float] NOT NULL,
[IconWidth] [float] NOT NULL,
[IconHeight] [float] NOT NULL,
[SolutionBytes] [varbinary](max),
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.SmartBook_SmGapFillingItem] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[SmartBook_SmBook] (
[Id] [int] NOT NULL IDENTITY,
[AppBookId] [int],
[SmartBookName] [nvarchar](max),
[AttachmentId] [int] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.SmartBook_SmBook] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[SmartBook_SmBookContent] (
[Id] [int] NOT NULL IDENTITY,
[StartPage] [int] NOT NULL,
[EndPage] [int] NOT NULL,
[Name] [nvarchar](max),
[BookContentType] [int] NOT NULL,
[SmartBookId] [int] NOT NULL,
[ParentBookContentId] [int],
[Order] [int] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.SmartBook_SmBookContent] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[SmartBook_SmPage] (
[Id] [int] NOT NULL IDENTITY,
[SmBookId] [int] NOT NULL,
[PageNumber] [int] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.SmartBook_SmPage] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[SmartBook_SmQuestion] (
[Id] [int] NOT NULL IDENTITY,
[QuestionNo] [int] NOT NULL,
[XCoordinate] [float] NOT NULL,
[YCoordinate] [float] NOT NULL,
[Width] [float] NOT NULL,
[Height] [float] NOT NULL,
[PageNumber] [int],
[OriginalImageWidth] [float] NOT NULL,
[OriginalImageHeight] [float] NOT NULL,
[SolutionBytes] [varbinary](max),
[Answer] [nvarchar](max),
[SmartBookContentId] [int] NOT NULL,
[SmBookId] [int] NOT NULL,
[QuestionType] [nvarchar](max),
[OptionsCount] [int] NOT NULL,
[TestId] [nvarchar](max),
[AnswerBytes] [varbinary](max),
[IsSolutionUnitedQuestion] [bit] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.SmartBook_SmQuestion] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[SmartBook_UserNotes] (
[Id] [int] NOT NULL IDENTITY,
[SmBookId] [int] NOT NULL,
[PageNumber] [int] NOT NULL,
[UserDrawings] [nvarchar](max),
[UserId] [int] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.SmartBook_UserNotes] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[SmartBook_UserDrawings] (
[Id] [int] NOT NULL IDENTITY,
[SmBookId] [int] NOT NULL,
[Drawings] [nvarchar](max),
[UserId] [int] NOT NULL,
[EntityId] [int] NOT NULL,
[DrawingType] [int] NOT NULL,
[PageWidth] [float] NOT NULL,
[PageHeight] [float] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.SmartBook_UserDrawings] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[SmartBook_UsersEmptyPage] (
[Id] [int] NOT NULL IDENTITY,
[SmBookId] [int] NOT NULL,
[UserDrawings] [nvarchar](max),
[UserId] [int] NOT NULL,
[PaperClass] [nvarchar](max),
[DrawingImage] [nvarchar](max),
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.SmartBook_UsersEmptyPage] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[SmartBook_LibraryApp] (
[Id] [int] NOT NULL IDENTITY,
[Title] [nvarchar](max),
[Version] [nvarchar](max),
[DisplayOrder] [int] NOT NULL,
[Platform] [int] NOT NULL,
[Path] [nvarchar](max),
[IsActive] [bit] NOT NULL,
[AppAttachmentId] [int],
[TenantId] [int],
[LessonId] [int],
CONSTRAINT [PK_dbo.SmartBook_LibraryApp] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[TimeTable_TimeTableColumn] (
[Id] [int] NOT NULL IDENTITY,
[Day] [int] NOT NULL,
[TimeTableId] [int] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.TimeTable_TimeTableColumn] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[TimeTable_TimeTable] (
[Id] [int] NOT NULL IDENTITY,
[WeekNumber] [int] NOT NULL,
[Year] [int] NOT NULL,
[AppClassId] [int],
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.TimeTable_TimeTable] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[TimeTable_TimeTableRow] (
[Id] [int] NOT NULL IDENTITY,
[StartTimeMinute] [int] NOT NULL,
[EndTimeMinute] [int] NOT NULL,
[TimeTableId] [int] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.TimeTable_TimeTableRow] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[TimeTable_TimeTableItemLesson] (
[Id] [int] NOT NULL IDENTITY,
[TimeTableColumnId] [int] NOT NULL,
[TimeTableRowId] [int] NOT NULL,
[DisplayName] [nvarchar](max),
[BookContentLessonId] [int] NOT NULL,
[BookContentId] [int] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.TimeTable_TimeTableItemLesson] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[TimeTable_UserLessonVideoStatistics] (
[Id] [int] NOT NULL IDENTITY,
[UserId] [int] NOT NULL,
[BookContentLessonId] [int] NOT NULL,
[TotalVideoDuration] [int] NOT NULL,
[VideoStateForUser] [int] NOT NULL,
[TotalTimeSecondInVideoPage] [int] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.TimeTable_UserLessonVideoStatistics] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MySchool_ClassRoom] (
[Id] [int] NOT NULL IDENTITY,
[Name] [nvarchar](max),
[SchoolId] [int] NOT NULL,
[Branch] [int] NOT NULL,
[AppClassId] [int] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.MySchool_ClassRoom] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MySchool_UserClassRoom] (
[Id] [int] NOT NULL IDENTITY,
[UserId] [int] NOT NULL,
[ClassRoomId] [int] NOT NULL,
[ClassRoomUserType] [int] NOT NULL,
CONSTRAINT [PK_dbo.MySchool_UserClassRoom] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[ActivationCodes_ActivationCode] (
[Id] [int] NOT NULL IDENTITY,
[EntityId] [int] NOT NULL,
[Code] [nvarchar](max) NOT NULL,
[SerialNumber] [int] NOT NULL,
[ActivationCodeType] [int] NOT NULL,
[IsCodeUsedBefore] [bit] NOT NULL,
[UserId] [int],
[ExpireDate] [datetime],
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.ActivationCodes_ActivationCode] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[ActivationCodes_UserActivationCode] (
[Id] [int] NOT NULL IDENTITY,
[UserId] [int] NOT NULL,
[ActivationCodeId] [int] NOT NULL,
[ActivationDate] [datetime] NOT NULL,
CONSTRAINT [PK_dbo.ActivationCodes_UserActivationCode] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[ActivationCodes_UserActivationCodeRequest] (
[Id] [int] NOT NULL IDENTITY,
[UserId] [int],
[UserEmail] [nvarchar](max),
[UserPhoneNumber] [nvarchar](max),
[UserFirstName] [nvarchar](max),
[UserLastName] [nvarchar](max),
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.ActivationCodes_UserActivationCodeRequest] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[ActivationCodes_UserActivationCodeRequestUserGroup] (
[Id] [int] NOT NULL IDENTITY,
[UserActivationCodeRequestId] [int] NOT NULL,
[UserGroupId] [int] NOT NULL,
CONSTRAINT [PK_dbo.ActivationCodes_UserActivationCodeRequestUserGroup] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[SolutionApp_UserQuestionDrawing] (
[Id] [int] NOT NULL IDENTITY,
[Name] [nvarchar](max),
[UserId] [int] NOT NULL,
[EntityId] [int] NOT NULL,
[DrawingType] [int] NOT NULL,
[DrawingJson] [nvarchar](max),
[DrawingImage] [nvarchar](max),
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.SolutionApp_UserQuestionDrawing] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Dealers_Dealer] (
[Id] [int] NOT NULL IDENTITY,
[Name] [nvarchar](max),
[Address] [nvarchar](max),
[Phone] [nvarchar](max),
[DistrictId] [int],
[ProvinceId] [int] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Dealers_Dealer] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Dealers_DealerSchool] (
[Id] [int] NOT NULL IDENTITY,
[DealerId] [int] NOT NULL,
[SchoolId] [int] NOT NULL,
CONSTRAINT [PK_dbo.Dealers_DealerSchool] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Dealers_DealerUser] (
[Id] [int] NOT NULL IDENTITY,
[DealerId] [int] NOT NULL,
[UserId] [int] NOT NULL,
CONSTRAINT [PK_dbo.Dealers_DealerUser] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Dealers_DealerFile] (
[Id] [int] NOT NULL IDENTITY,
[Title] [nvarchar](max),
[IsShared] [bit] NOT NULL,
[DealerId] [int] NOT NULL,
[FileId] [int] NOT NULL,
CONSTRAINT [PK_dbo.Dealers_DealerFile] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[QuestionPool_QuestionPoolTest] (
[Id] [int] NOT NULL IDENTITY,
[QuestionSpace] [int],
[PdfTitle] [nvarchar](max),
[TestName] [nvarchar](max),
[NameAndSurname] [bit] NOT NULL,
[ClassAndNumber] [bit] NOT NULL,
[IsOpticForm] [bit] NOT NULL,
[IsAnswerKey] [bit] NOT NULL,
[TestId] [int],
[UserId] [int] NOT NULL,
[AttachmentId] [int],
[CustomLogoPosition] [int],
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.QuestionPool_QuestionPoolTest] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[QuestionPool_QuestionPoolCategory] (
[Id] [int] NOT NULL IDENTITY,
[CategoryName] [nvarchar](max),
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.QuestionPool_QuestionPoolCategory] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[QuestionPool_QuestionPoolCategoryClass] (
[Id] [int] NOT NULL IDENTITY,
[QuestionPoolCategoryId] [int] NOT NULL,
[ClassId] [int] NOT NULL,
CONSTRAINT [PK_dbo.QuestionPool_QuestionPoolCategoryClass] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[FrequentlyAskedQuestions_FrequentlyAskedQuestion] (
[Id] [int] NOT NULL IDENTITY,
[Name] [nvarchar](max),
[Description] [nvarchar](max),
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.FrequentlyAskedQuestions_FrequentlyAskedQuestion] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Gains_GainTopic] (
[Id] [int] NOT NULL IDENTITY,
[Title] [nvarchar](max),
[Code] [nvarchar](max),
[Description] [nvarchar](max),
[ParentId] [int],
[AppLessonId] [int] NOT NULL,
[AppClassId] [int] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Gains_GainTopic] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Gains_GainTags] (
[Id] [int] NOT NULL IDENTITY,
[Tag] [nvarchar](max),
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
[GainTopic_Id] [int],
CONSTRAINT [PK_dbo.Gains_GainTags] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Gains_MebGain] (
[Id] [int] NOT NULL IDENTITY,
[Title] [nvarchar](max),
[Code] [nvarchar](max),
[Description] [nvarchar](max),
[GainTopicId] [int],
[ParentGainId] [int],
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Gains_MebGain] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Gains_GainTopicTags] (
[Id] [int] NOT NULL IDENTITY,
[GainTopicId] [int] NOT NULL,
[GainTagsId] [int] NOT NULL,
CONSTRAINT [PK_dbo.Gains_GainTopicTags] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Gains_MebGainQuestion] (
[Id] [int] NOT NULL IDENTITY,
[QuestionId] [int] NOT NULL,
[MebGainId] [int] NOT NULL,
CONSTRAINT [PK_dbo.Gains_MebGainQuestion] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Contacts_Contact] (
[Id] [int] NOT NULL IDENTITY,
[Title] [nvarchar](max),
[Latitude] [nvarchar](max),
[Longitude] [nvarchar](max),
[Address] [nvarchar](max),
[PhoneNumber] [nvarchar](max),
[FaxNumber] [nvarchar](max),
[EmailAddress] [nvarchar](max),
[MapApiKey] [nvarchar](max),
[YoutubeLink] [nvarchar](max),
[LinkedinLink] [nvarchar](max),
[FaceBookLink] [nvarchar](max),
[TwitterLink] [nvarchar](max),
[InstagramLink] [nvarchar](max),
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Contacts_Contact] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Contacts_UserContact] (
[Id] [int] NOT NULL IDENTITY,
[FullName] [nvarchar](max),
[EmailAddress] [nvarchar](max),
[Subject] [nvarchar](max),
[Message] [nvarchar](max),
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Contacts_UserContact] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Counters_CounterUserGroup] (
[Id] [int] NOT NULL IDENTITY,
[UserGroupId] [int] NOT NULL,
[CounterId] [int] NOT NULL,
CONSTRAINT [PK_dbo.Counters_CounterUserGroup] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Counters_Counter] (
[Id] [int] NOT NULL IDENTITY,
[Name] [nvarchar](max),
[EndDate] [datetime] NOT NULL,
[CounterType] [int] NOT NULL,
[CounterColor] [nvarchar](max),
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Counters_Counter] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_RelatedLessonCoefficient] (
[Id] [int] NOT NULL IDENTITY,
[TryingExamCategoryId] [int],
[RelatedTryingExamCategorySectionLessonId] [int],
[ScoreTypeId] [int] NOT NULL,
[Coefficient] [real] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_RelatedLessonCoefficient] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_TryingExamResult] (
[Id] [int] NOT NULL IDENTITY,
[TryingExamId] [int],
[TryingExamCategoryId] [int],
[Name] [nvarchar](max),
[DurationText] [nvarchar](max),
[UserId] [int] NOT NULL,
[ResultDate] [datetime] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_TryingExamResult] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_UserLessonStatistics] (
[Id] [int] NOT NULL IDENTITY,
[AppLessonId] [int] NOT NULL,
[TryingExamResultId] [int] NOT NULL,
[QuestionCount] [int] NOT NULL,
[CorrectAnswerCount] [int] NOT NULL,
[WrongAnswerCount] [int] NOT NULL,
[NullAnswerCount] [int] NOT NULL,
[NetCount] [float] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_UserLessonStatistics] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_UserAnswer] (
[Id] [int] NOT NULL IDENTITY,
[QuestionId] [int] NOT NULL,
[QuestionNumber] [int] NOT NULL,
[LessonStatisticId] [int] NOT NULL,
[CorrectAnswer] [nvarchar](max),
[StudentAnswer] [nvarchar](max),
[UserLessonStatistics_Id] [int],
CONSTRAINT [PK_dbo.MobileApp_UserAnswer] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_UserScores] (
[Id] [int] NOT NULL IDENTITY,
[TryingExamResultId] [int] NOT NULL,
[ScoreTypeId] [int] NOT NULL,
[Score] [float] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_UserScores] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_HomePageItem] (
[Id] [int] NOT NULL IDENTITY,
[HomePageItemType] [int] NOT NULL,
[Name] [nvarchar](max),
[EntityId] [int],
[Order] [int] NOT NULL,
[IsActive] [bit] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_HomePageItem] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_HomePageItemElement] (
[Id] [int] NOT NULL IDENTITY,
[HomePageItemId] [int] NOT NULL,
[EntityId] [int] NOT NULL,
[Name] [nvarchar](max),
CONSTRAINT [PK_dbo.MobileApp_HomePageItemElement] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_UserEvent] (
[Id] [int] NOT NULL IDENTITY,
[UserId] [int] NOT NULL,
[Name] [nvarchar](max),
[Description] [nvarchar](max),
[StartDate] [datetime] NOT NULL,
[EndDate] [datetime] NOT NULL,
[IsCompleted] [bit] NOT NULL,
[IsApiEvent] [bit] NOT NULL,
[ApiEventId] [int],
[ReminderActive] [bit] NOT NULL,
[NotificationId] [nvarchar](max),
[CalendarItemType] [int] NOT NULL,
[EntityId] [int] NOT NULL,
[BookId] [int],
[StartPageNumber] [int],
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_UserEvent] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_UserTestResult] (
[Id] [int] NOT NULL IDENTITY,
[TestId] [int] NOT NULL,
[TestTitle] [nvarchar](max),
[QuestionCount] [int] NOT NULL,
[UserId] [int] NOT NULL,
[CorrectAnswerCount] [int] NOT NULL,
[WrongAnswerCount] [int] NOT NULL,
[NullAnswerCount] [int] NOT NULL,
[DurationText] [nvarchar](max),
[ResultDate] [datetime] NOT NULL,
[AssignmentId] [int],
[Score] [float],
CONSTRAINT [PK_dbo.MobileApp_UserTestResult] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_UserTestAnswer] (
[Id] [int] NOT NULL IDENTITY,
[QuestionId] [int] NOT NULL,
[QuestionNumber] [int] NOT NULL,
[UserTestResultId] [int] NOT NULL,
[CorrectAnswer] [nvarchar](max),
[StudentAnswer] [nvarchar](max),
CONSTRAINT [PK_dbo.MobileApp_UserTestAnswer] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_UserBooks] (
[Id] [int] NOT NULL IDENTITY,
[UserId] [int] NOT NULL,
[AppBookId] [int] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_UserBooks] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_TeacherSolutions] (
[Id] [int] NOT NULL IDENTITY,
[TestId] [int] NOT NULL,
[SolverUserId] [int] NOT NULL,
[ApprovedUserId] [int],
[TestSolutionStatus] [int] NOT NULL,
[LastUpdateTime] [datetime] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_TeacherSolutions] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_VideoComment] (
[Id] [int] NOT NULL IDENTITY,
[SolutionVideoId] [int] NOT NULL,
[Comment] [nvarchar](max),
[UserId] [int] NOT NULL,
[UserName] [nvarchar](max),
[Date] [datetime] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_VideoComment] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[MobileApp_BookContentLessonAreas] (
[Id] [int] NOT NULL IDENTITY,
[BookContentLessonId] [int] NOT NULL,
[Order] [int] NOT NULL,
[Width] [float] NOT NULL,
[Height] [float] NOT NULL,
[XCoordinate] [float] NOT NULL,
[YCoordinate] [float] NOT NULL,
[ImageHeight] [float] NOT NULL,
[ImageWidth] [float] NOT NULL,
[AttachmentId] [int],
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.MobileApp_BookContentLessonAreas] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Omr_AnswerBlock] (
[Id] [int] NOT NULL IDENTITY,
[BlockHeader] [nvarchar](max),
[Width] [real] NOT NULL,
[Height] [real] NOT NULL,
[X] [real] NOT NULL,
[Y] [real] NOT NULL,
[Options] [int] NOT NULL,
[Rows] [int] NOT NULL,
[BlockId] [int] NOT NULL,
[StartOfInd] [int] NOT NULL,
[SheetTemplateId] [int] NOT NULL,
[DimensionRatio] [float],
[WebXCoordinate] [real] NOT NULL,
[WebYCoordinate] [real] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Omr_AnswerBlock] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Omr_NumberBlock] (
[Id] [int] NOT NULL IDENTITY,
[Width] [real] NOT NULL,
[Height] [real] NOT NULL,
[X] [real] NOT NULL,
[Y] [real] NOT NULL,
[WebXCoordinate] [real] NOT NULL,
[WebYCoordinate] [real] NOT NULL,
[Digits] [int] NOT NULL,
[BlockId] [int] NOT NULL,
[SheetTemplateId] [int] NOT NULL,
[DimensionRatio] [float] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Omr_NumberBlock] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Omr_QrCodeBlock] (
[Id] [int] NOT NULL IDENTITY,
[Width] [real] NOT NULL,
[Height] [real] NOT NULL,
[X] [real] NOT NULL,
[Y] [real] NOT NULL,
[SheetTemplateId] [int] NOT NULL,
[DimensionRatio] [float] NOT NULL,
[WebXCoordinate] [real] NOT NULL,
[WebYCoordinate] [real] NOT NULL,
[WriteQrCodeString] [nvarchar](max),
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Omr_QrCodeBlock] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Slider_SliderImage] (
[Id] [int] NOT NULL IDENTITY,
[Name] [nvarchar](max),
[ImageUrl] [nvarchar](max),
[IsActive] [bit] NOT NULL,
[DisplayOrder] [int] NOT NULL,
[LinkUrl] [nvarchar](max),
[ClassName] [nvarchar](max),
[DataTransition] [nvarchar](max),
[ExtraData] [nvarchar](max),
[SliderId] [int] NOT NULL,
[PublishStart] [datetime],
[PublishEnd] [datetime],
[IsMobileImage] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Slider_SliderImage] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Slider_MainSlider] (
[Id] [int] NOT NULL IDENTITY,
[Name] [nvarchar](max),
[SliderCode] [nvarchar](max),
[IsActive] [bit] NOT NULL,
[TypeId] [int],
[SliderSettings] [nvarchar](max),
[PublishStart] [datetime],
[PublishEnd] [datetime],
[TenantId] [int],
[DisplayPlacesStrForDb] [nvarchar](max),
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Slider_MainSlider] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Slider_SliderImageItem] (
[Id] [int] NOT NULL IDENTITY,
[SliderImageId] [int] NOT NULL,
[ClassName] [nvarchar](max),
[Settings] [nvarchar](max),
[Text] [nvarchar](max),
[AttachmentId] [int],
CONSTRAINT [PK_dbo.Slider_SliderImageItem] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[ExamEvaluation_UserExam] (
[Id] [int] NOT NULL IDENTITY,
[ExamName] [nvarchar](max),
[UserId] [int] NOT NULL,
[SchoolId] [int],
[TryingExamCategoryId] [int] NOT NULL,
[RelatedExamId] [int],
[OptionCount] [int] NOT NULL,
[BookLetCount] [int] NOT NULL,
[OpticalFormTemplateId] [int],
[IsCommonExam] [bit] NOT NULL,
[TryingExamId] [int],
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.ExamEvaluation_UserExam] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[ExamEvaluation_OpticalFormTemplate] (
[Id] [int] NOT NULL IDENTITY,
[Name] [nvarchar](max),
[ExamCategoryId] [int] NOT NULL,
[UserId] [int] NOT NULL,
[IsCommonTemplate] [bit] NOT NULL,
CONSTRAINT [PK_dbo.ExamEvaluation_OpticalFormTemplate] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[ExamEvaluation_ExamQuestion] (
[Id] [int] NOT NULL IDENTITY,
[UserExamId] [int] NOT NULL,
[QuestionNumberA] [int] NOT NULL,
[QuestionNumberB] [int],
[QuestionNumberC] [int],
[QuestionNumberD] [int],
[CorrectAnswer] [nvarchar](max),
[QuestionGain] [nvarchar](max),
[BookLetType] [int] NOT NULL,
[SectionLessonId] [int],
[QuestionId] [int],
CONSTRAINT [PK_dbo.ExamEvaluation_ExamQuestion] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[ExamEvaluation_ExamQuestionGain] (
[Id] [int] NOT NULL IDENTITY,
[GainId] [int] NOT NULL,
[ExamQuestionId] [int] NOT NULL,
CONSTRAINT [PK_dbo.ExamEvaluation_ExamQuestionGain] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[ExamEvaluation_AreaInformation] (
[Id] [int] NOT NULL IDENTITY,
[Name] [nvarchar](max),
[StartPosition] [int] NOT NULL,
[EndPosition] [int] NOT NULL,
[Length] [int] NOT NULL,
[Type] [int] NOT NULL,
[TryingExamSectionId] [int],
[OpticalFormTemplateId] [int] NOT NULL,
CONSTRAINT [PK_dbo.ExamEvaluation_AreaInformation] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[ExamEvaluation_ExamResult] (
[Id] [int] NOT NULL IDENTITY,
[UserExamId] [int] NOT NULL,
[UserFullName] [nvarchar](max),
[StudentNumberText] [nvarchar](max),
[StudentNumber] [nvarchar](max),
[ClassRoomText] [nvarchar](max),
[ClassRoomId] [int],
[ClassRoomName] [nvarchar](max),
[IdentityNumber] [nvarchar](max),
[BookLetType] [nvarchar](max),
[ExamNo] [nvarchar](max),
[SchoolCode] [nvarchar](max),
[UserId] [int],
[SchoolId] [int],
[RelatedExamResultId] [int],
[RelatedExamId] [int],
[RelatedExamIsExternal] [bit],
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.ExamEvaluation_ExamResult] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[ExamEvaluation_ExamUserAnswer] (
[Id] [int] NOT NULL IDENTITY,
[ExamResultId] [int],
[ExamQuestionId] [int] NOT NULL,
[UserAnswer] [nvarchar](max),
[BookLetType] [int] NOT NULL,
[QuestionNumber] [int] NOT NULL,
[ExamUserLessonStats_Id] [int],
CONSTRAINT [PK_dbo.ExamEvaluation_ExamUserAnswer] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[ExamEvaluation_ExamUserLessonStats] (
[Id] [int] NOT NULL IDENTITY,
[AppLessonId] [int] NOT NULL,
[SectionLessonId] [int] NOT NULL,
[TryingExamResultId] [int] NOT NULL,
[QuestionCount] [int] NOT NULL,
[CorrectAnswerCount] [int] NOT NULL,
[WrongAnswerCount] [int] NOT NULL,
[NullAnswerCount] [int] NOT NULL,
[NetCount] [float] NOT NULL,
CONSTRAINT [PK_dbo.ExamEvaluation_ExamUserLessonStats] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[ExamEvaluation_ExamUserScores] (
[Id] [int] NOT NULL IDENTITY,
[TryingExamResultId] [int] NOT NULL,
[ScoreTypeId] [int] NOT NULL,
[Score] [float] NOT NULL,
CONSTRAINT [PK_dbo.ExamEvaluation_ExamUserScores] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Examinations_Examination] (
[Id] [int] NOT NULL IDENTITY,
[Name] [nvarchar](max),
[TryingExamCategoryId] [int],
[UserId] [int] NOT NULL,
[QeustionSpace] [int] NOT NULL,
[ExaminationType] [int] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Examinations_Examination] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Examinations_ExaminationTest] (
[Id] [int] NOT NULL IDENTITY,
[ExaminationId] [int] NOT NULL,
[TestId] [int] NOT NULL,
CONSTRAINT [PK_dbo.Examinations_ExaminationTest] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Examinations_ExamTopicPattern] (
[Id] [int] NOT NULL IDENTITY,
[ExaminationId] [int] NOT NULL,
[TopicId] [int] NOT NULL,
[QuestionCount] [int] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Examinations_ExamTopicPattern] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[OnlineExam_ExamTopicDistrubition] (
[Id] [int] NOT NULL IDENTITY,
[TryingExamCategoryId] [int] NOT NULL,
[Name] [nvarchar](max),
[IsDefault] [bit] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.OnlineExam_ExamTopicDistrubition] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[OnlineExam_SectionTopicDistrubition] (
[Id] [int] NOT NULL IDENTITY,
[ExamTopicDistrubitionId] [int] NOT NULL,
[SectionLessonId] [int] NOT NULL,
[GainTopicId] [int] NOT NULL,
[QuestionCount] [int] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.OnlineExam_SectionTopicDistrubition] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[QrCode_AppQrCode] (
[Id] [int] NOT NULL IDENTITY,
[Type] [int] NOT NULL,
[EntityId] [int] NOT NULL,
[QrCodeString] [nvarchar](max),
[FromUrl] [nvarchar](max),
[RedirectUrl] [nvarchar](max),
[IsActive] [bit] NOT NULL,
CONSTRAINT [PK_dbo.QrCode_AppQrCode] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[OnlineLessons_OnlineLesson] (
[Id] [int] NOT NULL IDENTITY,
[Topic] [nvarchar](max),
[LessonId] [int],
[LessonDate] [datetime] NOT NULL,
[LessonDescription] [nvarchar](max),
[CreatorUserId] [int] NOT NULL,
[StartTime] [time](7) NOT NULL,
[EndTime] [time](7) NOT NULL,
[MainLessonId] [int],
[IsMainLesson] [bit] NOT NULL,
[IsPublicLesson] [bit] NOT NULL,
[MeetingProviderType] [int] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.OnlineLessons_OnlineLesson] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[OnlineLessons_OnlineLessonAttendance] (
[Id] [int] NOT NULL IDENTITY,
[OnlineLessonId] [int] NOT NULL,
[UserId] [int] NOT NULL,
[IsJoined] [bit] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.OnlineLessons_OnlineLessonAttendance] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[OnlineLessons_OnlineLessonToClassRoom] (
[Id] [int] NOT NULL IDENTITY,
[OnlineLessonId] [int] NOT NULL,
[ClassRoomId] [int] NOT NULL,
CONSTRAINT [PK_dbo.OnlineLessons_OnlineLessonToClassRoom] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[OnlineLessons_Meeting] (
[Id] [int] NOT NULL IDENTITY,
[MeetingId] [nvarchar](max),
[OnlineLessonId] [int] NOT NULL,
[UserId] [int] NOT NULL,
[MeetingUrl] [nvarchar](max),
[MeetingPassword] [nvarchar](max),
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.OnlineLessons_Meeting] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[OnlineLessons_MeetingUser] (
[Id] [int] NOT NULL IDENTITY,
[UserId] [int] NOT NULL,
[UserEmail] [nvarchar](max),
[MeetingUserId] [nvarchar](max),
[IsApproved] [bit] NOT NULL,
[ClassRoomId] [int] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.OnlineLessons_MeetingUser] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[OnlineLessons_MeetingAccount] (
[Id] [int] NOT NULL IDENTITY,
[MeetingTitle] [nvarchar](max),
[ClientId] [nvarchar](max),
[ClientSecret] [nvarchar](max),
[ZoomAccountId] [nvarchar](max),
[TenantId] [nvarchar](max),
[RedirectUrl] [nvarchar](max),
[ExecutiveEmailAccount] [nvarchar](max),
[ExecutiveRefreshToken] [nvarchar](max),
[ZoomJwtToken] [nvarchar](max),
[IsDefault] [bit] NOT NULL,
[MeetingProviderType] [int] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.OnlineLessons_MeetingAccount] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[OnlineLessons_MeetingSchoolAccount] (
[Id] [int] NOT NULL IDENTITY,
[MeetingAccountId] [int] NOT NULL,
[SchoolId] [int] NOT NULL,
CONSTRAINT [PK_dbo.OnlineLessons_MeetingSchoolAccount] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Assignments_Assignment] (
[Id] [int] NOT NULL IDENTITY,
[Title] [nvarchar](max),
[TestId] [int] NOT NULL,
[CreatorUserId] [int] NOT NULL,
[StartDate] [datetime] NOT NULL,
[EndDate] [datetime] NOT NULL,
[Description] [nvarchar](max),
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Assignments_Assignment] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Assignments_AssignmentContent] (
[Id] [int] NOT NULL IDENTITY,
[AssignmentId] [int] NOT NULL,
[Type] [int] NOT NULL,
[EntityId] [int] NOT NULL,
CONSTRAINT [PK_dbo.Assignments_AssignmentContent] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Assignments_AssignmentToClassRoom] (
[Id] [int] NOT NULL IDENTITY,
[ClassRoomId] [int] NOT NULL,
[AssignmentId] [int] NOT NULL,
CONSTRAINT [PK_dbo.Assignments_AssignmentToClassRoom] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Assignments_AssignmentToUser] (
[Id] [int] NOT NULL IDENTITY,
[StudentId] [int] NOT NULL,
[AssignmentId] [int] NOT NULL,
[CompleteDate] [datetime],
CONSTRAINT [PK_dbo.Assignments_AssignmentToUser] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Events_AppEvent] (
[Id] [int] NOT NULL IDENTITY,
[Name] [nvarchar](max),
[Description] [nvarchar](max),
[EventImage] [nvarchar](max),
[StartDate] [datetime] NOT NULL,
[EndDate] [datetime] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.Events_AppEvent] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[PublicArea_WebPage] (
[Id] [int] NOT NULL IDENTITY,
[TenantId] [int] NOT NULL,
[CategoryId] [int] NOT NULL,
[SystemName] [nvarchar](max),
[SeoUrl] [nvarchar](max),
[IsActive] [bit] NOT NULL,
[PermissionsJsonForDb] [nvarchar](max),
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.PublicArea_WebPage] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[PublicArea_WebPageTranslate] (
[Id] [int] NOT NULL IDENTITY,
[TenantId] [int] NOT NULL,
[PageId] [int],
[LanguageId] [int] NOT NULL,
[Title] [nvarchar](max),
[Content] [nvarchar](max),
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.PublicArea_WebPageTranslate] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[PublicArea_Company] (
[Id] [int] NOT NULL IDENTITY,
[Title] [nvarchar](max),
[AboutUs] [nvarchar](max),
[WhyUs] [nvarchar](max),
[Phone] [nvarchar](max),
[Adress] [nvarchar](max),
[MapLink] [nvarchar](max),
[AttachmentId] [int],
[Logo] [nvarchar](max),
[IsActive] [bit] NOT NULL,
[Email] [nvarchar](max),
[FacebookLink] [nvarchar](max),
[TwitterLink] [nvarchar](max),
[InstagramLink] [nvarchar](max),
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.PublicArea_Company] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[PublicArea_Stories] (
[Id] [int] NOT NULL IDENTITY,
[Subject] [nvarchar](max),
[Body] [nvarchar](max),
[AttachmentId] [int],
[IsActive] [bit] NOT NULL,
[Link] [nvarchar](max),
[TenantId] [int] NOT NULL,
[Description] [nvarchar](max),
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
[Company_Id] [int],
CONSTRAINT [PK_dbo.PublicArea_Stories] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[PublicArea_Link] (
[Id] [int] NOT NULL IDENTITY,
[Title] [nvarchar](max),
[Description] [nvarchar](max),
[RedirectUrl] [nvarchar](max),
[DisplayOrder] [int] NOT NULL,
[IsActive] [bit] NOT NULL,
[LinkImageId] [int],
CONSTRAINT [PK_dbo.PublicArea_Link] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[PublicArea_CatalogGroup] (
[Id] [int] NOT NULL IDENTITY,
[Title] [nvarchar](max),
[DisplayOrder] [int] NOT NULL,
CONSTRAINT [PK_dbo.PublicArea_CatalogGroup] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[PublicArea_Catalog] (
[Id] [int] NOT NULL IDENTITY,
[Title] [nvarchar](max),
[Description] [nvarchar](max),
[DisplayOrder] [int] NOT NULL,
[IsActive] [bit] NOT NULL,
[GroupId] [int],
[CoverImageId] [int],
[PdfId] [int],
CONSTRAINT [PK_dbo.PublicArea_Catalog] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[PublicArea_CatalogPage] (
[Id] [int] NOT NULL IDENTITY,
[DisplayOrder] [int] NOT NULL,
[ImageId] [int] NOT NULL,
[CatalogId] [int] NOT NULL,
CONSTRAINT [PK_dbo.PublicArea_CatalogPage] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[ProductPackages_Packages] (
[Id] [int] NOT NULL IDENTITY,
[Name] [nvarchar](max),
[Description] [nvarchar](max),
[Gtin] [nvarchar](max),
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.ProductPackages_Packages] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[ProductPackages_PackagesToProducts] (
[Id] [int] NOT NULL IDENTITY,
[PackagesId] [int] NOT NULL,
[EntityId] [int] NOT NULL,
[EntityType] [int] NOT NULL,
CONSTRAINT [PK_dbo.ProductPackages_PackagesToProducts] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[ProductPackages_PackagesUserPermission] (
[Id] [int] NOT NULL IDENTITY,
[PackagesId] [int] NOT NULL,
[UserId] [int] NOT NULL,
CONSTRAINT [PK_dbo.ProductPackages_PackagesUserPermission] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[VideoLessons_VideoLesson] (
[Id] [int] NOT NULL IDENTITY,
[Title] [nvarchar](max),
[CoverImageUrl] [nvarchar](max),
[Description] [nvarchar](max),
[DisplayOrder] [int] NOT NULL,
[Price] [float] NOT NULL,
[OldPrice] [float] NOT NULL,
[ShopUrl] [nvarchar](max),
[IsActive] [bit] NOT NULL,
[IsApproved] [bit] NOT NULL,
[RatingCount] [int] NOT NULL,
[Rating] [float] NOT NULL,
[AppClassId] [int],
[AppLessonId] [int],
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.VideoLessons_VideoLesson] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[VideoLessons_VideoLessonComments] (
[Id] [int] NOT NULL IDENTITY,
[Comment] [nvarchar](max),
[CreatedDate] [datetime] NOT NULL,
[UserId] [int] NOT NULL,
[VideoLessonId] [int] NOT NULL,
CONSTRAINT [PK_dbo.VideoLessons_VideoLessonComments] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[VideoLessons_VideoLessonContent] (
[Id] [int] NOT NULL IDENTITY,
[Title] [nvarchar](max),
[Description] [nvarchar](max),
[DisplayOrder] [int] NOT NULL,
[IsActive] [bit] NOT NULL,
[VideoLessonId] [int] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.VideoLessons_VideoLessonContent] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[VideoLessons_ContentVideos] (
[Id] [int] NOT NULL IDENTITY,
[VideoLessonItemId] [int] NOT NULL,
[VideoLessonContentId] [int] NOT NULL,
CONSTRAINT [PK_dbo.VideoLessons_ContentVideos] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[VideoLessons_VideoLessonItem] (
[Id] [int] NOT NULL IDENTITY,
[Title] [nvarchar](max),
[Description] [nvarchar](max),
[VideoUrl] [nvarchar](max),
[Code] [nvarchar](max),
[AttachmentId] [int],
[DisplayOrder] [int] NOT NULL,
[Duration] [int] NOT NULL,
[IsLive] [bit] NOT NULL,
[IsActive] [bit] NOT NULL,
[IsApproved] [bit] NOT NULL,
[IsFree] [bit] NOT NULL,
[ViewCount] [int] NOT NULL,
[ViewingLimit] [int],
[VideoLessonAuthorId] [int] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.VideoLessons_VideoLessonItem] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[VideoLessons_VideoLessonAuthor] (
[Id] [int] NOT NULL IDENTITY,
[Title] [nvarchar](max),
[Description] [nvarchar](max),
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.VideoLessons_VideoLessonAuthor] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[VideoLessons_VideoLessonDocument] (
[Id] [int] NOT NULL IDENTITY,
[AttachmentId] [int] NOT NULL,
[VideoLessonItemId] [int] NOT NULL,
CONSTRAINT [PK_dbo.VideoLessons_VideoLessonDocument] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[VideoLessons_VideoLessonItemNotes] (
[Id] [int] NOT NULL IDENTITY,
[Notes] [nvarchar](max),
[CreatedDate] [datetime] NOT NULL,
[VideoLessonItemId] [int] NOT NULL,
[UserId] [int] NOT NULL,
CONSTRAINT [PK_dbo.VideoLessons_VideoLessonItemNotes] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[VideoLessons_UserViewCounts] (
[Id] [int] NOT NULL IDENTITY,
[VideoLessonItemId] [int] NOT NULL,
[UserId] [int] NOT NULL,
[ViewCount] [int] NOT NULL,
CONSTRAINT [PK_dbo.VideoLessons_UserViewCounts] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[VideoLessons_VideoLessonUserPermission] (
[Id] [int] NOT NULL IDENTITY,
[UserId] [int] NOT NULL,
[VideoLessonId] [int] NOT NULL,
CONSTRAINT [PK_dbo.VideoLessons_VideoLessonUserPermission] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[VideoLessons_VimeoAccessToken] (
[Id] [int] NOT NULL IDENTITY,
[AccessToken] [nvarchar](max),
[Title] [nvarchar](max),
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.VideoLessons_VimeoAccessToken] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[VideoLessons_VideoLessonItemsBugReports] (
[Id] [int] NOT NULL IDENTITY,
[Bug] [nvarchar](max),
[VideoLessonItemId] [int] NOT NULL,
[UserId] [int] NOT NULL,
[BugStatus] [bit] NOT NULL,
[BugType] [int] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.VideoLessons_VideoLessonItemsBugReports] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[DevApp_Notifications_Notification] (
[Id] [int] NOT NULL IDENTITY,
[Title] [nvarchar](max),
[Message] [nvarchar](max),
[Url] [nvarchar](max),
[BigPictureUrl] [nvarchar](max),
[NotifyDate] [datetime],
[PublishArea] [int] NOT NULL,
[NotificationType] [int] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
[Sender_Id] [int],
CONSTRAINT [PK_dbo.DevApp_Notifications_Notification] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[DevApp_Notifications_NotificationRecipient] (
[Id] [int] NOT NULL IDENTITY,
[NotificationId] [int] NOT NULL,
[RecipientId] [int],
[RecipientRoleId] [int],
[IsRead] [bit] NOT NULL,
CONSTRAINT [PK_dbo.DevApp_Notifications_NotificationRecipient] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[DevApp_Notifications_NotificationProvider] (
[Id] [int] NOT NULL IDENTITY,
[Title] [nvarchar](max),
[AppPostUrl] [nvarchar](max),
[AppId] [nvarchar](max),
[AppRestApiKey] [nvarchar](max),
[IsActive] [bit] NOT NULL,
[IsDefault] [bit] NOT NULL,
[Guid] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL,
CONSTRAINT [PK_dbo.DevApp_Notifications_NotificationProvider] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Central_UserGroupToUser] (
[UserGroupId] [int] NOT NULL,
[UserId] [int] NOT NULL,
CONSTRAINT [PK_dbo.Central_UserGroupToUser] PRIMARY KEY ([UserGroupId], [UserId])
)
CREATE TABLE [dbo].[NewsTagNewsItems] (
[NewsTag_Id] [int] NOT NULL,
[NewsItem_Id] [int] NOT NULL,
CONSTRAINT [PK_dbo.NewsTagNewsItems] PRIMARY KEY ([NewsTag_Id], [NewsItem_Id])
)
CREATE TABLE [dbo].[Central_UserScore] (
[Id] [int] NOT NULL,
[ActionId] [int] NOT NULL,
[ActionType] [int] NOT NULL,
[Description] [nvarchar](max),
[Point] [decimal](18, 4) NOT NULL,
CONSTRAINT [PK_dbo.Central_UserScore] PRIMARY KEY ([Id])
)
CREATE INDEX [IX_ParentId] ON [dbo].[Common_Category]([ParentId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[Common_Category]([Guid])
CREATE INDEX [IX_CategoryId] ON [dbo].[Common_CategoryTranslate]([CategoryId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[Common_CategoryTranslate]([Guid])
CREATE INDEX [IX_MailAccountId] ON [dbo].[Common_Mail]([MailAccountId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[Common_Mail]([Guid])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[Common_MailAccount]([Guid])
CREATE INDEX [IX_MailId] ON [dbo].[Common_MailRecipient]([MailId])
CREATE INDEX [IX_MailAccountId] ON [dbo].[Common_MailTemplate]([MailAccountId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[Common_MailTemplate]([Guid])
CREATE INDEX [IX_LocaleStringResourceKeyId] ON [dbo].[Central_LocaleStringResourceValue]([LocaleStringResourceKeyId])
CREATE UNIQUE INDEX [IX_Culture] ON [dbo].[Central_Language]([Culture])
CREATE UNIQUE INDEX [IX_SeoCode] ON [dbo].[Central_Language]([SeoCode])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[Central_Language]([Guid])
CREATE INDEX [IX_SettingsGroupId] ON [dbo].[Central_Settings]([SettingsGroupId])
CREATE INDEX [IX_ParentId] ON [dbo].[Central_SystemMenu]([ParentId])
CREATE INDEX [IX_SystemMenuId] ON [dbo].[Central_SystemMenuTenant]([SystemMenuId])
CREATE INDEX [IX_SystemMenuId] ON [dbo].[Central_SystemMenuTranslate]([SystemMenuId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[Central_Tenant]([Guid])
CREATE INDEX [IX_TenantId] ON [dbo].[Central_User]([TenantId])
CREATE INDEX [IX_UserName] ON [dbo].[Central_User]([UserName])
CREATE INDEX [IX_Email] ON [dbo].[Central_User]([Email])
CREATE INDEX [IX_LanguageId] ON [dbo].[Central_User]([LanguageId])
CREATE INDEX [IX_UserDirectoryId] ON [dbo].[Central_User]([UserDirectoryId])
CREATE INDEX [IX_SchoolId] ON [dbo].[Central_User]([SchoolId])
CREATE INDEX [IX_LastIpAddress] ON [dbo].[Central_User]([LastIpAddress])
CREATE INDEX [IX_StudentNumber] ON [dbo].[Central_User]([StudentNumber])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[Central_User]([Guid])
CREATE INDEX [IX_UserId] ON [dbo].[Central_ExternalAuthenticationRecord]([UserId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[Central_ExternalAuthenticationRecord]([Guid])
CREATE INDEX [IX_UserId] ON [dbo].[Central_PermiUserScreenAction]([UserId])
CREATE INDEX [IX_PermiScreenActionId] ON [dbo].[Central_PermiUserScreenAction]([PermiScreenActionId])
CREATE INDEX [IX_PermiScreenId] ON [dbo].[Central_PermiScreenAction]([PermiScreenId])
CREATE INDEX [IX_PermiActionId] ON [dbo].[Central_PermiScreenAction]([PermiActionId])
CREATE INDEX [IX_DistrictId] ON [dbo].[Central_School]([DistrictId])
CREATE INDEX [IX_MernisCode] ON [dbo].[Central_School]([MernisCode])
CREATE INDEX [IX_ParentId] ON [dbo].[Central_School]([ParentId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[Central_School]([Guid])
CREATE INDEX [IX_ProvinceId] ON [dbo].[Central_District]([ProvinceId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[Central_District]([Guid])
CREATE INDEX [IX_CountryId] ON [dbo].[Central_Province]([CountryId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[Central_Province]([Guid])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[Central_Country]([Guid])
CREATE INDEX [IX_UserId] ON [dbo].[Central_UserData]([UserId])
CREATE INDEX [IX_ParentId] ON [dbo].[Central_UserGroup]([ParentId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[Central_UserGroup]([Guid])
CREATE INDEX [IX_UserId] ON [dbo].[Central_UserRelation]([UserId])
CREATE INDEX [IX_UserId] ON [dbo].[Central_UserRole]([UserId])
CREATE INDEX [IX_RoleId] ON [dbo].[Central_UserRole]([RoleId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[Central_Role]([Guid])
CREATE INDEX [IX_RoleId] ON [dbo].[Central_PermiRoleScreenAction]([RoleId])
CREATE INDEX [IX_PermiScreenActionId] ON [dbo].[Central_PermiRoleScreenAction]([PermiScreenActionId])
CREATE INDEX [IX_TenantId] ON [dbo].[Central_ErrorLog]([TenantId])
CREATE INDEX [IX_UserId] ON [dbo].[Central_ErrorLog]([UserId])
CREATE INDEX [IX_AttachmentFolderId] ON [dbo].[Attachments_Attachment]([AttachmentFolderId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[Attachments_Attachment]([Guid])
CREATE INDEX [IX_ParentId] ON [dbo].[Attachments_AttachmentFolder]([ParentId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[Attachments_AttachmentFolder]([Guid])
CREATE INDEX [IX_SenderId] ON [dbo].[Chat_ChatMessage]([SenderId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[Chat_ChatMessage]([Guid])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[ExamApply_ExamClass]([Guid])
CREATE INDEX [IX_ExamClassId] ON [dbo].[ExamApply_ExamDate]([ExamClassId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[ExamApply_ExamDate]([Guid])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[ExamApply_ExamApplyResult]([Guid])
CREATE INDEX [IX_ExamBranchId] ON [dbo].[ExamApply_ExamBook]([ExamBranchId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[ExamApply_ExamBook]([Guid])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[ExamApply_ExamBranch]([Guid])
CREATE INDEX [IX_ExamApplyResultId] ON [dbo].[ExamApply_ExamApplyResultDate]([ExamApplyResultId])
CREATE INDEX [IX_ExamDateId] ON [dbo].[ExamApply_ExamApplyResultDate]([ExamDateId])
CREATE INDEX [IX_SenderId] ON [dbo].[Messaging_Message]([SenderId])
CREATE INDEX [IX_MessageConversationId] ON [dbo].[Messaging_Message]([MessageConversationId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[Messaging_Message]([Guid])
CREATE INDEX [IX_UserId] ON [dbo].[Messaging_MessageParticipant]([UserId])
CREATE INDEX [IX_MessageConversationId] ON [dbo].[Messaging_MessageParticipant]([MessageConversationId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[News_NewsItem]([Guid])
CREATE INDEX [IX_Category_Id] ON [dbo].[News_NewsItem]([Category_Id])
CREATE INDEX [IX_NewsToUser_Id] ON [dbo].[News_NewsItem]([NewsToUser_Id])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[News_NewsCategory]([Guid])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[News_NewsComment]([Guid])
CREATE INDEX [IX_News_Id] ON [dbo].[News_NewsComment]([News_Id])
CREATE INDEX [IX_User_Id] ON [dbo].[News_NewsComment]([User_Id])
CREATE INDEX [IX_UserId] ON [dbo].[News_NewsToUser]([UserId])
CREATE INDEX [IX_NewsItemId] ON [dbo].[News_NewsUserGroup]([NewsItemId])
CREATE INDEX [IX_UserGroupId] ON [dbo].[News_NewsUserGroup]([UserGroupId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[News_NewsTag]([Guid])
CREATE INDEX [IX_AppClassId] ON [dbo].[SmartBoardAdmin_SmartBookItem]([AppClassId])
CREATE INDEX [IX_AppLessonId] ON [dbo].[SmartBoardAdmin_SmartBookItem]([AppLessonId])
CREATE INDEX [IX_AppBookCategoryId] ON [dbo].[SmartBoardAdmin_SmartBookItem]([AppBookCategoryId])
CREATE INDEX [IX_ClientId] ON [dbo].[SmartBoardAdmin_SmartBookItem]([ClientId])
CREATE INDEX [IX_OperatorId] ON [dbo].[SmartBoardAdmin_SmartBookItem]([OperatorId])
CREATE INDEX [IX_SmartBookPdfId] ON [dbo].[SmartBoardAdmin_SmartBookItem]([SmartBookPdfId])
CREATE INDEX [IX_CoverImageId] ON [dbo].[SmartBoardAdmin_SmartBookItem]([CoverImageId])
CREATE INDEX [IX_SmartBookId] ON [dbo].[SmartBoardAdmin_SmartBookItem]([SmartBookId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[SmartBoardAdmin_SmartBookItem]([Guid])
CREATE INDEX [IX_ParentId] ON [dbo].[MobileApp_AppBookCategory]([ParentId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[MobileApp_AppBookCategory]([Guid])
CREATE INDEX [IX_AppBookPublisherId] ON [dbo].[MobileApp_AppBook]([AppBookPublisherId])
CREATE INDEX [IX_AttachmentId] ON [dbo].[MobileApp_AppBook]([AttachmentId])
CREATE INDEX [IX_SolutionAttachmentId] ON [dbo].[MobileApp_AppBook]([SolutionAttachmentId])
CREATE INDEX [IX_PrintingAttachmentId] ON [dbo].[MobileApp_AppBook]([PrintingAttachmentId])
CREATE INDEX [IX_AppClassId] ON [dbo].[MobileApp_AppBook]([AppClassId])
CREATE INDEX [IX_AppLessonId] ON [dbo].[MobileApp_AppBook]([AppLessonId])
CREATE INDEX [IX_AttachmentFolderId] ON [dbo].[MobileApp_AppBook]([AttachmentFolderId])
CREATE INDEX [IX_SmartBookAttachmentId] ON [dbo].[MobileApp_AppBook]([SmartBookAttachmentId])
CREATE INDEX [IX_SheetTemplateId] ON [dbo].[MobileApp_AppBook]([SheetTemplateId])
CREATE INDEX [IX_EducationYearId] ON [dbo].[MobileApp_AppBook]([EducationYearId])
CREATE INDEX [IX_AppBookCategoryId] ON [dbo].[MobileApp_AppBook]([AppBookCategoryId])
CREATE INDEX [IX_ParentAppBookId] ON [dbo].[MobileApp_AppBook]([ParentAppBookId])
CREATE INDEX [IX_SmartBookVersionId] ON [dbo].[MobileApp_AppBook]([SmartBookVersionId])
CREATE INDEX [IX_BookKindId] ON [dbo].[MobileApp_AppBook]([BookKindId])
CREATE INDEX [IX_TryingExamCategoryId] ON [dbo].[MobileApp_AppBook]([TryingExamCategoryId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[MobileApp_AppBook]([Guid])
CREATE INDEX [IX_AppBookId] ON [dbo].[MobileApp_AppBookPackagesToBook]([AppBookId])
CREATE INDEX [IX_AppBookPackagesId] ON [dbo].[MobileApp_AppBookPackagesToBook]([AppBookPackagesId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[MobileApp_AppBookPackages]([Guid])
CREATE INDEX [IX_AppBookId] ON [dbo].[MobileApp_AppBookPermission]([AppBookId])
CREATE INDEX [IX_AppBookPermissionId] ON [dbo].[MobileApp_AppBookPermissionRole]([AppBookPermissionId])
CREATE INDEX [IX_RoleId] ON [dbo].[MobileApp_AppBookPermissionRole]([RoleId])
CREATE INDEX [IX_AppBookPermissionId] ON [dbo].[MobileApp_AppBookPermissionSchool]([AppBookPermissionId])
CREATE INDEX [IX_SchoolId] ON [dbo].[MobileApp_AppBookPermissionSchool]([SchoolId])
CREATE INDEX [IX_AppBookPermissionId] ON [dbo].[MobileApp_AppBookPermissionUser]([AppBookPermissionId])
CREATE INDEX [IX_UserId] ON [dbo].[MobileApp_AppBookPermissionUser]([UserId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[MobileApp_AppBookPublisher]([Guid])
CREATE INDEX [IX_AppBookId] ON [dbo].[MobileApp_AppBookUserGroups]([AppBookId])
CREATE INDEX [IX_UserGroupId] ON [dbo].[MobileApp_AppClass]([UserGroupId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[MobileApp_AppClass]([Guid])
CREATE INDEX [IX_UserGroupId] ON [dbo].[MobileApp_AppLesson]([UserGroupId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[MobileApp_AppLesson]([Guid])
CREATE INDEX [IX_AppBookId] ON [dbo].[MobileApp_BookContent]([AppBookId])
CREATE INDEX [IX_ParentBookContentId] ON [dbo].[MobileApp_BookContent]([ParentBookContentId])
CREATE INDEX [IX_TryingExamCategorySectionId] ON [dbo].[MobileApp_BookContent]([TryingExamCategorySectionId])
CREATE INDEX [IX_AttachmentFolderId] ON [dbo].[MobileApp_BookContent]([AttachmentFolderId])
CREATE INDEX [IX_VideoAttachmentId] ON [dbo].[MobileApp_BookContent]([VideoAttachmentId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[MobileApp_BookContent]([Guid])
CREATE INDEX [IX_ContentAttachmentId] ON [dbo].[MobileApp_Activity]([ContentAttachmentId])
CREATE INDEX [IX_BookContentId] ON [dbo].[MobileApp_Activity]([BookContentId])
CREATE INDEX [IX_PositionId] ON [dbo].[MobileApp_Activity]([PositionId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[MobileApp_Activity]([Guid])
CREATE INDEX [IX_BookContentId] ON [dbo].[MobileApp_BookContentLesson]([BookContentId])
CREATE INDEX [IX_SolutionVideoId] ON [dbo].[MobileApp_BookContentLesson]([SolutionVideoId])
CREATE INDEX [IX_AttachmentFolderId] ON [dbo].[MobileApp_BookContentLesson]([AttachmentFolderId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[MobileApp_BookContentLesson]([Guid])
CREATE INDEX [IX_Attachment_Id] ON [dbo].[MobileApp_BookContentLesson]([Attachment_Id])
CREATE INDEX [IX_VideoAttachmentId] ON [dbo].[MobileApp_SolutionVideo]([VideoAttachmentId])
CREATE INDEX [IX_UserId] ON [dbo].[MobileApp_SolutionVideo]([UserId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[MobileApp_SolutionVideo]([Guid])
CREATE INDEX [IX_BookContentId] ON [dbo].[MobileApp_Test]([BookContentId])
CREATE INDEX [IX_LessonId] ON [dbo].[MobileApp_Test]([LessonId])
CREATE INDEX [IX_TryingExamCategorySectionLessonId] ON [dbo].[MobileApp_Test]([TryingExamCategorySectionLessonId])
CREATE INDEX [IX_AttachmentFolderId] ON [dbo].[MobileApp_Test]([AttachmentFolderId])
CREATE INDEX [IX_SheetTemplateId] ON [dbo].[MobileApp_Test]([SheetTemplateId])
CREATE INDEX [IX_UserId] ON [dbo].[MobileApp_Test]([UserId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[MobileApp_Test]([Guid])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[Omr_SheetTemplate]([Guid])
CREATE INDEX [IX_QuestionId] ON [dbo].[MobileApp_TestQuestion]([QuestionId])
CREATE INDEX [IX_TestId] ON [dbo].[MobileApp_TestQuestion]([TestId])
CREATE INDEX [IX_TestQuestionId] ON [dbo].[MobileApp_QuestionComment]([TestQuestionId])
CREATE INDEX [IX_UserId] ON [dbo].[MobileApp_QuestionComment]([UserId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[MobileApp_QuestionComment]([Guid])
CREATE INDEX [IX_AttachmentId] ON [dbo].[MobileApp_Question]([AttachmentId])
CREATE INDEX [IX_RootQuestionAttachmentId] ON [dbo].[MobileApp_Question]([RootQuestionAttachmentId])
CREATE INDEX [IX_PositionId] ON [dbo].[MobileApp_Question]([PositionId])
CREATE INDEX [IX_RootPositionId] ON [dbo].[MobileApp_Question]([RootPositionId])
CREATE INDEX [IX_SolutionId] ON [dbo].[MobileApp_Question]([SolutionId])
CREATE INDEX [IX_SettingId] ON [dbo].[MobileApp_Question]([SettingId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[MobileApp_Question]([Guid])
CREATE INDEX [IX_AttachmentId] ON [dbo].[MobileApp_Choice]([AttachmentId])
CREATE INDEX [IX_SolutionAttachmentId] ON [dbo].[MobileApp_Choice]([SolutionAttachmentId])
CREATE INDEX [IX_QuestionId] ON [dbo].[MobileApp_Choice]([QuestionId])
CREATE INDEX [IX_PositionId] ON [dbo].[MobileApp_Choice]([PositionId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[MobileApp_Choice]([Guid])
CREATE INDEX [IX_SourceId] ON [dbo].[MobileApp_ChoiceMap]([SourceId])
CREATE INDEX [IX_TargetId] ON [dbo].[MobileApp_ChoiceMap]([TargetId])
CREATE INDEX [IX_QuestionId] ON [dbo].[MobileApp_QuestionFile]([QuestionId])
CREATE INDEX [IX_FileId] ON [dbo].[MobileApp_QuestionFile]([FileId])
CREATE INDEX [IX_PositionId] ON [dbo].[MobileApp_QuestionFile]([PositionId])
CREATE INDEX [IX_AttachmentId] ON [dbo].[MobileApp_Solution]([AttachmentId])
CREATE INDEX [IX_VideoId] ON [dbo].[MobileApp_Solution]([VideoId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[MobileApp_Solution]([Guid])
CREATE INDEX [IX_TryingExamCategorySectionId] ON [dbo].[MobileApp_TryingExamCategorySectionLesson]([TryingExamCategorySectionId])
CREATE INDEX [IX_LessonId] ON [dbo].[MobileApp_TryingExamCategorySectionLesson]([LessonId])
CREATE INDEX [IX_OrLessonId] ON [dbo].[MobileApp_TryingExamCategorySectionLesson]([OrLessonId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[MobileApp_TryingExamCategorySectionLesson]([Guid])
CREATE INDEX [IX_TryingExamCategorySectionLessonId] ON [dbo].[MobileApp_LessonCoefficient]([TryingExamCategorySectionLessonId])
CREATE INDEX [IX_ScoreTypeId] ON [dbo].[MobileApp_LessonCoefficient]([ScoreTypeId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[MobileApp_LessonCoefficient]([Guid])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[MobileApp_ScoreType]([Guid])
CREATE INDEX [IX_TryingExamCategoryId] ON [dbo].[MobileApp_TryingExamCategorySection]([TryingExamCategoryId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[MobileApp_TryingExamCategorySection]([Guid])
CREATE INDEX [IX_SheetTemplateId] ON [dbo].[MobileApp_TryingExamCategory]([SheetTemplateId])
CREATE INDEX [IX_RelatedTryingExamCategoryId] ON [dbo].[MobileApp_TryingExamCategory]([RelatedTryingExamCategoryId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[MobileApp_TryingExamCategory]([Guid])
CREATE INDEX [IX_TryingExamCategoryId] ON [dbo].[MobileApp_TryingExamCategoryClass]([TryingExamCategoryId])
CREATE INDEX [IX_AppClassId] ON [dbo].[MobileApp_TryingExamCategoryClass]([AppClassId])
CREATE INDEX [IX_TryingExamCategoryId] ON [dbo].[MobileApp_TryingExamCategoryScoreType]([TryingExamCategoryId])
CREATE INDEX [IX_ScoreTypeId] ON [dbo].[MobileApp_TryingExamCategoryScoreType]([ScoreTypeId])
CREATE INDEX [IX_BookId] ON [dbo].[MobileApp_BookFile]([BookId])
CREATE INDEX [IX_FileId] ON [dbo].[MobileApp_BookFile]([FileId])
CREATE INDEX [IX_RoleId] ON [dbo].[MobileApp_BookFileRole]([RoleId])
CREATE INDEX [IX_BookFileId] ON [dbo].[MobileApp_BookFileRole]([BookFileId])
CREATE INDEX [IX_AttachmentId] ON [dbo].[MobileApp_BookPage]([AttachmentId])
CREATE INDEX [IX_BookId] ON [dbo].[MobileApp_BookPage]([BookId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[MobileApp_BookPage]([Guid])
CREATE INDEX [IX_AttachmentId] ON [dbo].[SmartBook_SmartBookVersion]([AttachmentId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[SmartBook_SmartBookVersion]([Guid])
CREATE INDEX [IX_TenantId] ON [dbo].[MobileApp_TenantBook]([TenantId])
CREATE INDEX [IX_BookId] ON [dbo].[MobileApp_TenantBook]([BookId])
CREATE INDEX [IX_CoverImageId] ON [dbo].[MobileApp_TenantBook]([CoverImageId])
CREATE INDEX [IX_BookId] ON [dbo].[MobileApp_BookTheme]([BookId])
CREATE INDEX [IX_ThemeId] ON [dbo].[MobileApp_BookTheme]([ThemeId])
CREATE INDEX [IX_TryingExamId] ON [dbo].[MobileApp_TryingExamPlan]([TryingExamId])
CREATE INDEX [IX_SchoolId] ON [dbo].[MobileApp_TryingExamPlan]([SchoolId])
CREATE INDEX [IX_CreatorUserId] ON [dbo].[MobileApp_TryingExamPlan]([CreatorUserId])
CREATE INDEX [IX_PlanId] ON [dbo].[MobileApp_TryingExamPlanClassRoom]([PlanId])
CREATE INDEX [IX_CommentUserId] ON [dbo].[SmartBoardAdmin_SmartBookItemComment]([CommentUserId])
CREATE INDEX [IX_SmartBookItemId] ON [dbo].[SmartBoardAdmin_SmartBookItemComment]([SmartBookItemId])
CREATE INDEX [IX_CommentAttachmentId] ON [dbo].[SmartBoardAdmin_SmartBookItemComment]([CommentAttachmentId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[SmartBoardAdmin_SmartBookItemComment]([Guid])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[SmartBook_SmGapFilling]([Guid])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[SmartBook_SmGapFillingItem]([Guid])
CREATE INDEX [IX_AppBookId] ON [dbo].[SmartBook_SmBook]([AppBookId])
CREATE INDEX [IX_AttachmentId] ON [dbo].[SmartBook_SmBook]([AttachmentId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[SmartBook_SmBook]([Guid])
CREATE INDEX [IX_SmartBookId] ON [dbo].[SmartBook_SmBookContent]([SmartBookId])
CREATE INDEX [IX_ParentBookContentId] ON [dbo].[SmartBook_SmBookContent]([ParentBookContentId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[SmartBook_SmBookContent]([Guid])
CREATE INDEX [IX_SmBookId] ON [dbo].[SmartBook_SmPage]([SmBookId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[SmartBook_SmPage]([Guid])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[SmartBook_SmQuestion]([Guid])
CREATE INDEX [IX_UserId] ON [dbo].[SmartBook_UserNotes]([UserId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[SmartBook_UserNotes]([Guid])
CREATE INDEX [IX_UserId] ON [dbo].[SmartBook_UserDrawings]([UserId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[SmartBook_UserDrawings]([Guid])
CREATE INDEX [IX_UserId] ON [dbo].[SmartBook_UsersEmptyPage]([UserId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[SmartBook_UsersEmptyPage]([Guid])
CREATE INDEX [IX_AppAttachmentId] ON [dbo].[SmartBook_LibraryApp]([AppAttachmentId])
CREATE INDEX [IX_TenantId] ON [dbo].[SmartBook_LibraryApp]([TenantId])
CREATE INDEX [IX_LessonId] ON [dbo].[SmartBook_LibraryApp]([LessonId])
CREATE INDEX [IX_TimeTableId] ON [dbo].[TimeTable_TimeTableColumn]([TimeTableId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[TimeTable_TimeTableColumn]([Guid])
CREATE INDEX [IX_AppClassId] ON [dbo].[TimeTable_TimeTable]([AppClassId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[TimeTable_TimeTable]([Guid])
CREATE INDEX [IX_TimeTableId] ON [dbo].[TimeTable_TimeTableRow]([TimeTableId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[TimeTable_TimeTableRow]([Guid])
CREATE INDEX [IX_BookContentLessonId] ON [dbo].[TimeTable_TimeTableItemLesson]([BookContentLessonId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[TimeTable_TimeTableItemLesson]([Guid])
CREATE INDEX [IX_UserId] ON [dbo].[TimeTable_UserLessonVideoStatistics]([UserId])
CREATE INDEX [IX_BookContentLessonId] ON [dbo].[TimeTable_UserLessonVideoStatistics]([BookContentLessonId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[TimeTable_UserLessonVideoStatistics]([Guid])
CREATE INDEX [IX_SchoolId] ON [dbo].[MySchool_ClassRoom]([SchoolId])
CREATE INDEX [IX_AppClassId] ON [dbo].[MySchool_ClassRoom]([AppClassId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[MySchool_ClassRoom]([Guid])
CREATE INDEX [IX_UserId] ON [dbo].[MySchool_UserClassRoom]([UserId])
CREATE INDEX [IX_ClassRoomId] ON [dbo].[MySchool_UserClassRoom]([ClassRoomId])
CREATE INDEX [IX_UserId] ON [dbo].[ActivationCodes_ActivationCode]([UserId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[ActivationCodes_ActivationCode]([Guid])
CREATE INDEX [IX_UserId] ON [dbo].[ActivationCodes_UserActivationCode]([UserId])
CREATE INDEX [IX_ActivationCodeId] ON [dbo].[ActivationCodes_UserActivationCode]([ActivationCodeId])
CREATE INDEX [IX_UserId] ON [dbo].[ActivationCodes_UserActivationCodeRequest]([UserId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[ActivationCodes_UserActivationCodeRequest]([Guid])
CREATE INDEX [IX_UserActivationCodeRequestId] ON [dbo].[ActivationCodes_UserActivationCodeRequestUserGroup]([UserActivationCodeRequestId])
CREATE INDEX [IX_UserGroupId] ON [dbo].[ActivationCodes_UserActivationCodeRequestUserGroup]([UserGroupId])
CREATE INDEX [IX_UserId] ON [dbo].[SolutionApp_UserQuestionDrawing]([UserId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[SolutionApp_UserQuestionDrawing]([Guid])
CREATE INDEX [IX_DistrictId] ON [dbo].[Dealers_Dealer]([DistrictId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[Dealers_Dealer]([Guid])
CREATE INDEX [IX_DealerId] ON [dbo].[Dealers_DealerSchool]([DealerId])
CREATE INDEX [IX_SchoolId] ON [dbo].[Dealers_DealerSchool]([SchoolId])
CREATE INDEX [IX_DealerId] ON [dbo].[Dealers_DealerUser]([DealerId])
CREATE INDEX [IX_UserId] ON [dbo].[Dealers_DealerUser]([UserId])
CREATE INDEX [IX_DealerId] ON [dbo].[Dealers_DealerFile]([DealerId])
CREATE INDEX [IX_FileId] ON [dbo].[Dealers_DealerFile]([FileId])
CREATE INDEX [IX_TestId] ON [dbo].[QuestionPool_QuestionPoolTest]([TestId])
CREATE INDEX [IX_UserId] ON [dbo].[QuestionPool_QuestionPoolTest]([UserId])
CREATE INDEX [IX_AttachmentId] ON [dbo].[QuestionPool_QuestionPoolTest]([AttachmentId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[QuestionPool_QuestionPoolTest]([Guid])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[QuestionPool_QuestionPoolCategory]([Guid])
CREATE INDEX [IX_QuestionPoolCategoryId] ON [dbo].[QuestionPool_QuestionPoolCategoryClass]([QuestionPoolCategoryId])
CREATE INDEX [IX_ClassId] ON [dbo].[QuestionPool_QuestionPoolCategoryClass]([ClassId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[FrequentlyAskedQuestions_FrequentlyAskedQuestion]([Guid])
CREATE INDEX [IX_ParentId] ON [dbo].[Gains_GainTopic]([ParentId])
CREATE INDEX [IX_AppLessonId] ON [dbo].[Gains_GainTopic]([AppLessonId])
CREATE INDEX [IX_AppClassId] ON [dbo].[Gains_GainTopic]([AppClassId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[Gains_GainTopic]([Guid])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[Gains_GainTags]([Guid])
CREATE INDEX [IX_GainTopic_Id] ON [dbo].[Gains_GainTags]([GainTopic_Id])
CREATE INDEX [IX_GainTopicId] ON [dbo].[Gains_MebGain]([GainTopicId])
CREATE INDEX [IX_ParentGainId] ON [dbo].[Gains_MebGain]([ParentGainId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[Gains_MebGain]([Guid])
CREATE INDEX [IX_GainTopicId] ON [dbo].[Gains_GainTopicTags]([GainTopicId])
CREATE INDEX [IX_GainTagsId] ON [dbo].[Gains_GainTopicTags]([GainTagsId])
CREATE INDEX [IX_QuestionId] ON [dbo].[Gains_MebGainQuestion]([QuestionId])
CREATE INDEX [IX_MebGainId] ON [dbo].[Gains_MebGainQuestion]([MebGainId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[Contacts_Contact]([Guid])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[Contacts_UserContact]([Guid])
CREATE INDEX [IX_UserGroupId] ON [dbo].[Counters_CounterUserGroup]([UserGroupId])
CREATE INDEX [IX_CounterId] ON [dbo].[Counters_CounterUserGroup]([CounterId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[Counters_Counter]([Guid])
CREATE INDEX [IX_TryingExamCategoryId] ON [dbo].[MobileApp_RelatedLessonCoefficient]([TryingExamCategoryId])
CREATE INDEX [IX_RelatedTryingExamCategorySectionLessonId] ON [dbo].[MobileApp_RelatedLessonCoefficient]([RelatedTryingExamCategorySectionLessonId])
CREATE INDEX [IX_ScoreTypeId] ON [dbo].[MobileApp_RelatedLessonCoefficient]([ScoreTypeId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[MobileApp_RelatedLessonCoefficient]([Guid])
CREATE INDEX [IX_TryingExamId] ON [dbo].[MobileApp_TryingExamResult]([TryingExamId])
CREATE INDEX [IX_TryingExamCategoryId] ON [dbo].[MobileApp_TryingExamResult]([TryingExamCategoryId])
CREATE INDEX [IX_UserId] ON [dbo].[MobileApp_TryingExamResult]([UserId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[MobileApp_TryingExamResult]([Guid])
CREATE INDEX [IX_AppLessonId] ON [dbo].[MobileApp_UserLessonStatistics]([AppLessonId])
CREATE INDEX [IX_TryingExamResultId] ON [dbo].[MobileApp_UserLessonStatistics]([TryingExamResultId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[MobileApp_UserLessonStatistics]([Guid])
CREATE INDEX [IX_QuestionId] ON [dbo].[MobileApp_UserAnswer]([QuestionId])
CREATE INDEX [IX_UserLessonStatistics_Id] ON [dbo].[MobileApp_UserAnswer]([UserLessonStatistics_Id])
CREATE INDEX [IX_TryingExamResultId] ON [dbo].[MobileApp_UserScores]([TryingExamResultId])
CREATE INDEX [IX_ScoreTypeId] ON [dbo].[MobileApp_UserScores]([ScoreTypeId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[MobileApp_UserScores]([Guid])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[MobileApp_HomePageItem]([Guid])
CREATE INDEX [IX_HomePageItemId] ON [dbo].[MobileApp_HomePageItemElement]([HomePageItemId])
CREATE INDEX [IX_UserId] ON [dbo].[MobileApp_UserEvent]([UserId])
CREATE INDEX [IX_BookId] ON [dbo].[MobileApp_UserEvent]([BookId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[MobileApp_UserEvent]([Guid])
CREATE INDEX [IX_TestId] ON [dbo].[MobileApp_UserTestResult]([TestId])
CREATE INDEX [IX_UserId] ON [dbo].[MobileApp_UserTestResult]([UserId])
CREATE INDEX [IX_QuestionId] ON [dbo].[MobileApp_UserTestAnswer]([QuestionId])
CREATE INDEX [IX_UserTestResultId] ON [dbo].[MobileApp_UserTestAnswer]([UserTestResultId])
CREATE INDEX [IX_UserId] ON [dbo].[MobileApp_UserBooks]([UserId])
CREATE INDEX [IX_AppBookId] ON [dbo].[MobileApp_UserBooks]([AppBookId])
CREATE INDEX [IX_TestId] ON [dbo].[MobileApp_TeacherSolutions]([TestId])
CREATE INDEX [IX_SolverUserId] ON [dbo].[MobileApp_TeacherSolutions]([SolverUserId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[MobileApp_TeacherSolutions]([Guid])
CREATE INDEX [IX_SolutionVideoId] ON [dbo].[MobileApp_VideoComment]([SolutionVideoId])
CREATE INDEX [IX_AttachmentId] ON [dbo].[MobileApp_BookContentLessonAreas]([AttachmentId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[MobileApp_BookContentLessonAreas]([Guid])
CREATE INDEX [IX_SheetTemplateId] ON [dbo].[Omr_AnswerBlock]([SheetTemplateId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[Omr_AnswerBlock]([Guid])
CREATE INDEX [IX_SheetTemplateId] ON [dbo].[Omr_NumberBlock]([SheetTemplateId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[Omr_NumberBlock]([Guid])
CREATE INDEX [IX_SheetTemplateId] ON [dbo].[Omr_QrCodeBlock]([SheetTemplateId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[Omr_QrCodeBlock]([Guid])
CREATE INDEX [IX_SliderId] ON [dbo].[Slider_SliderImage]([SliderId])
CREATE INDEX [IX_TenantId] ON [dbo].[Slider_MainSlider]([TenantId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[Slider_MainSlider]([Guid])
CREATE INDEX [IX_SliderImageId] ON [dbo].[Slider_SliderImageItem]([SliderImageId])
CREATE INDEX [IX_AttachmentId] ON [dbo].[Slider_SliderImageItem]([AttachmentId])
CREATE INDEX [IX_UserId] ON [dbo].[ExamEvaluation_UserExam]([UserId])
CREATE INDEX [IX_TryingExamCategoryId] ON [dbo].[ExamEvaluation_UserExam]([TryingExamCategoryId])
CREATE INDEX [IX_OpticalFormTemplateId] ON [dbo].[ExamEvaluation_UserExam]([OpticalFormTemplateId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[ExamEvaluation_UserExam]([Guid])
CREATE INDEX [IX_UserExamId] ON [dbo].[ExamEvaluation_ExamQuestion]([UserExamId])
CREATE INDEX [IX_SectionLessonId] ON [dbo].[ExamEvaluation_ExamQuestion]([SectionLessonId])
CREATE INDEX [IX_GainId] ON [dbo].[ExamEvaluation_ExamQuestionGain]([GainId])
CREATE INDEX [IX_ExamQuestionId] ON [dbo].[ExamEvaluation_ExamQuestionGain]([ExamQuestionId])
CREATE INDEX [IX_OpticalFormTemplateId] ON [dbo].[ExamEvaluation_AreaInformation]([OpticalFormTemplateId])
CREATE INDEX [IX_UserExamId] ON [dbo].[ExamEvaluation_ExamResult]([UserExamId])
CREATE INDEX [IX_UserId] ON [dbo].[ExamEvaluation_ExamResult]([UserId])
CREATE INDEX [IX_SchoolId] ON [dbo].[ExamEvaluation_ExamResult]([SchoolId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[ExamEvaluation_ExamResult]([Guid])
CREATE INDEX [IX_ExamResultId] ON [dbo].[ExamEvaluation_ExamUserAnswer]([ExamResultId])
CREATE INDEX [IX_ExamQuestionId] ON [dbo].[ExamEvaluation_ExamUserAnswer]([ExamQuestionId])
CREATE INDEX [IX_ExamUserLessonStats_Id] ON [dbo].[ExamEvaluation_ExamUserAnswer]([ExamUserLessonStats_Id])
CREATE INDEX [IX_AppLessonId] ON [dbo].[ExamEvaluation_ExamUserLessonStats]([AppLessonId])
CREATE INDEX [IX_TryingExamResultId] ON [dbo].[ExamEvaluation_ExamUserLessonStats]([TryingExamResultId])
CREATE INDEX [IX_TryingExamResultId] ON [dbo].[ExamEvaluation_ExamUserScores]([TryingExamResultId])
CREATE INDEX [IX_ScoreTypeId] ON [dbo].[ExamEvaluation_ExamUserScores]([ScoreTypeId])
CREATE INDEX [IX_TryingExamCategoryId] ON [dbo].[Examinations_Examination]([TryingExamCategoryId])
CREATE INDEX [IX_UserId] ON [dbo].[Examinations_Examination]([UserId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[Examinations_Examination]([Guid])
CREATE INDEX [IX_ExaminationId] ON [dbo].[Examinations_ExaminationTest]([ExaminationId])
CREATE INDEX [IX_TestId] ON [dbo].[Examinations_ExaminationTest]([TestId])
CREATE INDEX [IX_ExaminationId] ON [dbo].[Examinations_ExamTopicPattern]([ExaminationId])
CREATE INDEX [IX_TopicId] ON [dbo].[Examinations_ExamTopicPattern]([TopicId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[Examinations_ExamTopicPattern]([Guid])
CREATE INDEX [IX_TryingExamCategoryId] ON [dbo].[OnlineExam_ExamTopicDistrubition]([TryingExamCategoryId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[OnlineExam_ExamTopicDistrubition]([Guid])
CREATE INDEX [IX_ExamTopicDistrubitionId] ON [dbo].[OnlineExam_SectionTopicDistrubition]([ExamTopicDistrubitionId])
CREATE INDEX [IX_GainTopicId] ON [dbo].[OnlineExam_SectionTopicDistrubition]([GainTopicId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[OnlineExam_SectionTopicDistrubition]([Guid])
CREATE INDEX [IX_LessonId] ON [dbo].[OnlineLessons_OnlineLesson]([LessonId])
CREATE INDEX [IX_CreatorUserId] ON [dbo].[OnlineLessons_OnlineLesson]([CreatorUserId])
CREATE INDEX [IX_MainLessonId] ON [dbo].[OnlineLessons_OnlineLesson]([MainLessonId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[OnlineLessons_OnlineLesson]([Guid])
CREATE INDEX [IX_OnlineLessonId] ON [dbo].[OnlineLessons_OnlineLessonAttendance]([OnlineLessonId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[OnlineLessons_OnlineLessonAttendance]([Guid])
CREATE INDEX [IX_OnlineLessonId] ON [dbo].[OnlineLessons_OnlineLessonToClassRoom]([OnlineLessonId])
CREATE INDEX [IX_ClassRoomId] ON [dbo].[OnlineLessons_OnlineLessonToClassRoom]([ClassRoomId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[OnlineLessons_Meeting]([Guid])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[OnlineLessons_MeetingUser]([Guid])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[OnlineLessons_MeetingAccount]([Guid])
CREATE INDEX [IX_MeetingAccountId] ON [dbo].[OnlineLessons_MeetingSchoolAccount]([MeetingAccountId])
CREATE INDEX [IX_SchoolId] ON [dbo].[OnlineLessons_MeetingSchoolAccount]([SchoolId])
CREATE INDEX [IX_TestId] ON [dbo].[Assignments_Assignment]([TestId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[Assignments_Assignment]([Guid])
CREATE INDEX [IX_AssignmentId] ON [dbo].[Assignments_AssignmentContent]([AssignmentId])
CREATE INDEX [IX_ClassRoomId] ON [dbo].[Assignments_AssignmentToClassRoom]([ClassRoomId])
CREATE INDEX [IX_AssignmentId] ON [dbo].[Assignments_AssignmentToClassRoom]([AssignmentId])
CREATE INDEX [IX_StudentId] ON [dbo].[Assignments_AssignmentToUser]([StudentId])
CREATE INDEX [IX_AssignmentId] ON [dbo].[Assignments_AssignmentToUser]([AssignmentId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[Events_AppEvent]([Guid])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[PublicArea_WebPage]([Guid])
CREATE INDEX [IX_PageId] ON [dbo].[PublicArea_WebPageTranslate]([PageId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[PublicArea_WebPageTranslate]([Guid])
CREATE INDEX [IX_AttachmentId] ON [dbo].[PublicArea_Company]([AttachmentId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[PublicArea_Company]([Guid])
CREATE INDEX [IX_AttachmentId] ON [dbo].[PublicArea_Stories]([AttachmentId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[PublicArea_Stories]([Guid])
CREATE INDEX [IX_Company_Id] ON [dbo].[PublicArea_Stories]([Company_Id])
CREATE INDEX [IX_LinkImageId] ON [dbo].[PublicArea_Link]([LinkImageId])
CREATE INDEX [IX_GroupId] ON [dbo].[PublicArea_Catalog]([GroupId])
CREATE INDEX [IX_CoverImageId] ON [dbo].[PublicArea_Catalog]([CoverImageId])
CREATE INDEX [IX_PdfId] ON [dbo].[PublicArea_Catalog]([PdfId])
CREATE INDEX [IX_ImageId] ON [dbo].[PublicArea_CatalogPage]([ImageId])
CREATE INDEX [IX_CatalogId] ON [dbo].[PublicArea_CatalogPage]([CatalogId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[ProductPackages_Packages]([Guid])
CREATE INDEX [IX_PackagesId] ON [dbo].[ProductPackages_PackagesToProducts]([PackagesId])
CREATE INDEX [IX_PackagesId] ON [dbo].[ProductPackages_PackagesUserPermission]([PackagesId])
CREATE INDEX [IX_UserId] ON [dbo].[ProductPackages_PackagesUserPermission]([UserId])
CREATE INDEX [IX_AppClassId] ON [dbo].[VideoLessons_VideoLesson]([AppClassId])
CREATE INDEX [IX_AppLessonId] ON [dbo].[VideoLessons_VideoLesson]([AppLessonId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[VideoLessons_VideoLesson]([Guid])
CREATE INDEX [IX_UserId] ON [dbo].[VideoLessons_VideoLessonComments]([UserId])
CREATE INDEX [IX_VideoLessonId] ON [dbo].[VideoLessons_VideoLessonComments]([VideoLessonId])
CREATE INDEX [IX_VideoLessonId] ON [dbo].[VideoLessons_VideoLessonContent]([VideoLessonId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[VideoLessons_VideoLessonContent]([Guid])
CREATE INDEX [IX_VideoLessonItemId] ON [dbo].[VideoLessons_ContentVideos]([VideoLessonItemId])
CREATE INDEX [IX_VideoLessonContentId] ON [dbo].[VideoLessons_ContentVideos]([VideoLessonContentId])
CREATE INDEX [IX_AttachmentId] ON [dbo].[VideoLessons_VideoLessonItem]([AttachmentId])
CREATE INDEX [IX_VideoLessonAuthorId] ON [dbo].[VideoLessons_VideoLessonItem]([VideoLessonAuthorId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[VideoLessons_VideoLessonItem]([Guid])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[VideoLessons_VideoLessonAuthor]([Guid])
CREATE INDEX [IX_AttachmentId] ON [dbo].[VideoLessons_VideoLessonDocument]([AttachmentId])
CREATE INDEX [IX_VideoLessonItemId] ON [dbo].[VideoLessons_VideoLessonDocument]([VideoLessonItemId])
CREATE INDEX [IX_VideoLessonItemId] ON [dbo].[VideoLessons_VideoLessonItemNotes]([VideoLessonItemId])
CREATE INDEX [IX_UserId] ON [dbo].[VideoLessons_VideoLessonItemNotes]([UserId])
CREATE INDEX [IX_VideoLessonItemId] ON [dbo].[VideoLessons_UserViewCounts]([VideoLessonItemId])
CREATE INDEX [IX_UserId] ON [dbo].[VideoLessons_UserViewCounts]([UserId])
CREATE INDEX [IX_UserId] ON [dbo].[VideoLessons_VideoLessonUserPermission]([UserId])
CREATE INDEX [IX_VideoLessonId] ON [dbo].[VideoLessons_VideoLessonUserPermission]([VideoLessonId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[VideoLessons_VimeoAccessToken]([Guid])
CREATE INDEX [IX_VideoLessonItemId] ON [dbo].[VideoLessons_VideoLessonItemsBugReports]([VideoLessonItemId])
CREATE INDEX [IX_UserId] ON [dbo].[VideoLessons_VideoLessonItemsBugReports]([UserId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[VideoLessons_VideoLessonItemsBugReports]([Guid])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[DevApp_Notifications_Notification]([Guid])
CREATE INDEX [IX_Sender_Id] ON [dbo].[DevApp_Notifications_Notification]([Sender_Id])
CREATE INDEX [IX_NotificationId] ON [dbo].[DevApp_Notifications_NotificationRecipient]([NotificationId])
CREATE INDEX [IX_RecipientId] ON [dbo].[DevApp_Notifications_NotificationRecipient]([RecipientId])
CREATE INDEX [IX_RecipientRoleId] ON [dbo].[DevApp_Notifications_NotificationRecipient]([RecipientRoleId])
CREATE UNIQUE INDEX [IX_Guid] ON [dbo].[DevApp_Notifications_NotificationProvider]([Guid])
CREATE INDEX [IX_UserGroupId] ON [dbo].[Central_UserGroupToUser]([UserGroupId])
CREATE INDEX [IX_UserId] ON [dbo].[Central_UserGroupToUser]([UserId])
CREATE INDEX [IX_NewsTag_Id] ON [dbo].[NewsTagNewsItems]([NewsTag_Id])
CREATE INDEX [IX_NewsItem_Id] ON [dbo].[NewsTagNewsItems]([NewsItem_Id])
CREATE INDEX [IX_Id] ON [dbo].[Central_UserScore]([Id])
ALTER TABLE [dbo].[Common_Category] ADD CONSTRAINT [FK_dbo.Common_Category_dbo.Common_Category_ParentId] FOREIGN KEY ([ParentId]) REFERENCES [dbo].[Common_Category] ([Id])
ALTER TABLE [dbo].[Common_CategoryTranslate] ADD CONSTRAINT [FK_dbo.Common_CategoryTranslate_dbo.Common_Category_CategoryId] FOREIGN KEY ([CategoryId]) REFERENCES [dbo].[Common_Category] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Common_Mail] ADD CONSTRAINT [FK_dbo.Common_Mail_dbo.Common_MailAccount_MailAccountId] FOREIGN KEY ([MailAccountId]) REFERENCES [dbo].[Common_MailAccount] ([Id])
ALTER TABLE [dbo].[Common_MailRecipient] ADD CONSTRAINT [FK_dbo.Common_MailRecipient_dbo.Common_Mail_MailId] FOREIGN KEY ([MailId]) REFERENCES [dbo].[Common_Mail] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Common_MailTemplate] ADD CONSTRAINT [FK_dbo.Common_MailTemplate_dbo.Common_MailAccount_MailAccountId] FOREIGN KEY ([MailAccountId]) REFERENCES [dbo].[Common_MailAccount] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Central_LocaleStringResourceValue] ADD CONSTRAINT [FK_dbo.Central_LocaleStringResourceValue_dbo.Central_LocaleStringResourceKey_LocaleStringResourceKeyId] FOREIGN KEY ([LocaleStringResourceKeyId]) REFERENCES [dbo].[Central_LocaleStringResourceKey] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Central_Settings] ADD CONSTRAINT [FK_dbo.Central_Settings_dbo.Central_SettingsGroup_SettingsGroupId] FOREIGN KEY ([SettingsGroupId]) REFERENCES [dbo].[Central_SettingsGroup] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Central_SystemMenu] ADD CONSTRAINT [FK_dbo.Central_SystemMenu_dbo.Central_SystemMenu_ParentId] FOREIGN KEY ([ParentId]) REFERENCES [dbo].[Central_SystemMenu] ([Id])
ALTER TABLE [dbo].[Central_SystemMenuTenant] ADD CONSTRAINT [FK_dbo.Central_SystemMenuTenant_dbo.Central_SystemMenu_SystemMenuId] FOREIGN KEY ([SystemMenuId]) REFERENCES [dbo].[Central_SystemMenu] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Central_SystemMenuTranslate] ADD CONSTRAINT [FK_dbo.Central_SystemMenuTranslate_dbo.Central_SystemMenu_SystemMenuId] FOREIGN KEY ([SystemMenuId]) REFERENCES [dbo].[Central_SystemMenu] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Central_User] ADD CONSTRAINT [FK_dbo.Central_User_dbo.Central_Language_LanguageId] FOREIGN KEY ([LanguageId]) REFERENCES [dbo].[Central_Language] ([Id])
ALTER TABLE [dbo].[Central_User] ADD CONSTRAINT [FK_dbo.Central_User_dbo.Central_School_SchoolId] FOREIGN KEY ([SchoolId]) REFERENCES [dbo].[Central_School] ([Id])
ALTER TABLE [dbo].[Central_User] ADD CONSTRAINT [FK_dbo.Central_User_dbo.Central_Tenant_TenantId] FOREIGN KEY ([TenantId]) REFERENCES [dbo].[Central_Tenant] ([Id])
ALTER TABLE [dbo].[Central_User] ADD CONSTRAINT [FK_dbo.Central_User_dbo.Central_UserDirectory_UserDirectoryId] FOREIGN KEY ([UserDirectoryId]) REFERENCES [dbo].[Central_UserDirectory] ([Id])
ALTER TABLE [dbo].[Central_ExternalAuthenticationRecord] ADD CONSTRAINT [FK_dbo.Central_ExternalAuthenticationRecord_dbo.Central_User_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Central_User] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Central_PermiUserScreenAction] ADD CONSTRAINT [FK_dbo.Central_PermiUserScreenAction_dbo.Central_PermiScreenAction_PermiScreenActionId] FOREIGN KEY ([PermiScreenActionId]) REFERENCES [dbo].[Central_PermiScreenAction] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Central_PermiUserScreenAction] ADD CONSTRAINT [FK_dbo.Central_PermiUserScreenAction_dbo.Central_User_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Central_User] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Central_PermiScreenAction] ADD CONSTRAINT [FK_dbo.Central_PermiScreenAction_dbo.Central_PermiAction_PermiActionId] FOREIGN KEY ([PermiActionId]) REFERENCES [dbo].[Central_PermiAction] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Central_PermiScreenAction] ADD CONSTRAINT [FK_dbo.Central_PermiScreenAction_dbo.Central_PermiScreen_PermiScreenId] FOREIGN KEY ([PermiScreenId]) REFERENCES [dbo].[Central_PermiScreen] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Central_School] ADD CONSTRAINT [FK_dbo.Central_School_dbo.Central_District_DistrictId] FOREIGN KEY ([DistrictId]) REFERENCES [dbo].[Central_District] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Central_School] ADD CONSTRAINT [FK_dbo.Central_School_dbo.Central_School_ParentId] FOREIGN KEY ([ParentId]) REFERENCES [dbo].[Central_School] ([Id])
ALTER TABLE [dbo].[Central_District] ADD CONSTRAINT [FK_dbo.Central_District_dbo.Central_Province_ProvinceId] FOREIGN KEY ([ProvinceId]) REFERENCES [dbo].[Central_Province] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Central_Province] ADD CONSTRAINT [FK_dbo.Central_Province_dbo.Central_Country_CountryId] FOREIGN KEY ([CountryId]) REFERENCES [dbo].[Central_Country] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Central_UserData] ADD CONSTRAINT [FK_dbo.Central_UserData_dbo.Central_User_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Central_User] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Central_UserGroup] ADD CONSTRAINT [FK_dbo.Central_UserGroup_dbo.Central_UserGroup_ParentId] FOREIGN KEY ([ParentId]) REFERENCES [dbo].[Central_UserGroup] ([Id])
ALTER TABLE [dbo].[Central_UserRelation] ADD CONSTRAINT [FK_dbo.Central_UserRelation_dbo.Central_User_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Central_User] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Central_UserRole] ADD CONSTRAINT [FK_dbo.Central_UserRole_dbo.Central_Role_RoleId] FOREIGN KEY ([RoleId]) REFERENCES [dbo].[Central_Role] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Central_UserRole] ADD CONSTRAINT [FK_dbo.Central_UserRole_dbo.Central_User_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Central_User] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Central_PermiRoleScreenAction] ADD CONSTRAINT [FK_dbo.Central_PermiRoleScreenAction_dbo.Central_PermiScreenAction_PermiScreenActionId] FOREIGN KEY ([PermiScreenActionId]) REFERENCES [dbo].[Central_PermiScreenAction] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Central_PermiRoleScreenAction] ADD CONSTRAINT [FK_dbo.Central_PermiRoleScreenAction_dbo.Central_Role_RoleId] FOREIGN KEY ([RoleId]) REFERENCES [dbo].[Central_Role] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Central_ErrorLog] ADD CONSTRAINT [FK_dbo.Central_ErrorLog_dbo.Central_Tenant_TenantId] FOREIGN KEY ([TenantId]) REFERENCES [dbo].[Central_Tenant] ([Id])
ALTER TABLE [dbo].[Central_ErrorLog] ADD CONSTRAINT [FK_dbo.Central_ErrorLog_dbo.Central_User_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Central_User] ([Id])
ALTER TABLE [dbo].[Attachments_Attachment] ADD CONSTRAINT [FK_dbo.Attachments_Attachment_dbo.Attachments_AttachmentFolder_AttachmentFolderId] FOREIGN KEY ([AttachmentFolderId]) REFERENCES [dbo].[Attachments_AttachmentFolder] ([Id])
ALTER TABLE [dbo].[Attachments_AttachmentFolder] ADD CONSTRAINT [FK_dbo.Attachments_AttachmentFolder_dbo.Attachments_AttachmentFolder_ParentId] FOREIGN KEY ([ParentId]) REFERENCES [dbo].[Attachments_AttachmentFolder] ([Id])
ALTER TABLE [dbo].[Chat_ChatMessage] ADD CONSTRAINT [FK_dbo.Chat_ChatMessage_dbo.Central_User_SenderId] FOREIGN KEY ([SenderId]) REFERENCES [dbo].[Central_User] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[ExamApply_ExamDate] ADD CONSTRAINT [FK_dbo.ExamApply_ExamDate_dbo.ExamApply_ExamClass_ExamClassId] FOREIGN KEY ([ExamClassId]) REFERENCES [dbo].[ExamApply_ExamClass] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[ExamApply_ExamBook] ADD CONSTRAINT [FK_dbo.ExamApply_ExamBook_dbo.ExamApply_ExamBranch_ExamBranchId] FOREIGN KEY ([ExamBranchId]) REFERENCES [dbo].[ExamApply_ExamBranch] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[ExamApply_ExamApplyResultDate] ADD CONSTRAINT [FK_dbo.ExamApply_ExamApplyResultDate_dbo.ExamApply_ExamApplyResult_ExamApplyResultId] FOREIGN KEY ([ExamApplyResultId]) REFERENCES [dbo].[ExamApply_ExamApplyResult] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[ExamApply_ExamApplyResultDate] ADD CONSTRAINT [FK_dbo.ExamApply_ExamApplyResultDate_dbo.ExamApply_ExamDate_ExamDateId] FOREIGN KEY ([ExamDateId]) REFERENCES [dbo].[ExamApply_ExamDate] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Messaging_Message] ADD CONSTRAINT [FK_dbo.Messaging_Message_dbo.Messaging_MessageConversation_MessageConversationId] FOREIGN KEY ([MessageConversationId]) REFERENCES [dbo].[Messaging_MessageConversation] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Messaging_Message] ADD CONSTRAINT [FK_dbo.Messaging_Message_dbo.Central_User_SenderId] FOREIGN KEY ([SenderId]) REFERENCES [dbo].[Central_User] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Messaging_MessageParticipant] ADD CONSTRAINT [FK_dbo.Messaging_MessageParticipant_dbo.Messaging_MessageConversation_MessageConversationId] FOREIGN KEY ([MessageConversationId]) REFERENCES [dbo].[Messaging_MessageConversation] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Messaging_MessageParticipant] ADD CONSTRAINT [FK_dbo.Messaging_MessageParticipant_dbo.Central_User_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Central_User] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[News_NewsItem] ADD CONSTRAINT [FK_dbo.News_NewsItem_dbo.News_NewsCategory_Category_Id] FOREIGN KEY ([Category_Id]) REFERENCES [dbo].[News_NewsCategory] ([Id])
ALTER TABLE [dbo].[News_NewsItem] ADD CONSTRAINT [FK_dbo.News_NewsItem_dbo.News_NewsToUser_NewsToUser_Id] FOREIGN KEY ([NewsToUser_Id]) REFERENCES [dbo].[News_NewsToUser] ([Id])
ALTER TABLE [dbo].[News_NewsComment] ADD CONSTRAINT [FK_dbo.News_NewsComment_dbo.News_NewsItem_News_Id] FOREIGN KEY ([News_Id]) REFERENCES [dbo].[News_NewsItem] ([Id])
ALTER TABLE [dbo].[News_NewsComment] ADD CONSTRAINT [FK_dbo.News_NewsComment_dbo.Central_User_User_Id] FOREIGN KEY ([User_Id]) REFERENCES [dbo].[Central_User] ([Id])
ALTER TABLE [dbo].[News_NewsToUser] ADD CONSTRAINT [FK_dbo.News_NewsToUser_dbo.Central_User_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Central_User] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[News_NewsUserGroup] ADD CONSTRAINT [FK_dbo.News_NewsUserGroup_dbo.News_NewsItem_NewsItemId] FOREIGN KEY ([NewsItemId]) REFERENCES [dbo].[News_NewsItem] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[News_NewsUserGroup] ADD CONSTRAINT [FK_dbo.News_NewsUserGroup_dbo.Central_UserGroup_UserGroupId] FOREIGN KEY ([UserGroupId]) REFERENCES [dbo].[Central_UserGroup] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[SmartBoardAdmin_SmartBookItem] ADD CONSTRAINT [FK_dbo.SmartBoardAdmin_SmartBookItem_dbo.MobileApp_AppBookCategory_AppBookCategoryId] FOREIGN KEY ([AppBookCategoryId]) REFERENCES [dbo].[MobileApp_AppBookCategory] ([Id])
ALTER TABLE [dbo].[SmartBoardAdmin_SmartBookItem] ADD CONSTRAINT [FK_dbo.SmartBoardAdmin_SmartBookItem_dbo.MobileApp_AppClass_AppClassId] FOREIGN KEY ([AppClassId]) REFERENCES [dbo].[MobileApp_AppClass] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[SmartBoardAdmin_SmartBookItem] ADD CONSTRAINT [FK_dbo.SmartBoardAdmin_SmartBookItem_dbo.MobileApp_AppLesson_AppLessonId] FOREIGN KEY ([AppLessonId]) REFERENCES [dbo].[MobileApp_AppLesson] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[SmartBoardAdmin_SmartBookItem] ADD CONSTRAINT [FK_dbo.SmartBoardAdmin_SmartBookItem_dbo.Central_User_ClientId] FOREIGN KEY ([ClientId]) REFERENCES [dbo].[Central_User] ([Id])
ALTER TABLE [dbo].[SmartBoardAdmin_SmartBookItem] ADD CONSTRAINT [FK_dbo.SmartBoardAdmin_SmartBookItem_dbo.Attachments_Attachment_CoverImageId] FOREIGN KEY ([CoverImageId]) REFERENCES [dbo].[Attachments_Attachment] ([Id])
ALTER TABLE [dbo].[SmartBoardAdmin_SmartBookItem] ADD CONSTRAINT [FK_dbo.SmartBoardAdmin_SmartBookItem_dbo.Central_User_OperatorId] FOREIGN KEY ([OperatorId]) REFERENCES [dbo].[Central_User] ([Id])
ALTER TABLE [dbo].[SmartBoardAdmin_SmartBookItem] ADD CONSTRAINT [FK_dbo.SmartBoardAdmin_SmartBookItem_dbo.Attachments_Attachment_SmartBookId] FOREIGN KEY ([SmartBookId]) REFERENCES [dbo].[Attachments_Attachment] ([Id])
ALTER TABLE [dbo].[SmartBoardAdmin_SmartBookItem] ADD CONSTRAINT [FK_dbo.SmartBoardAdmin_SmartBookItem_dbo.Attachments_Attachment_SmartBookPdfId] FOREIGN KEY ([SmartBookPdfId]) REFERENCES [dbo].[Attachments_Attachment] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_AppBookCategory] ADD CONSTRAINT [FK_dbo.MobileApp_AppBookCategory_dbo.MobileApp_AppBookCategory_ParentId] FOREIGN KEY ([ParentId]) REFERENCES [dbo].[MobileApp_AppBookCategory] ([Id])
ALTER TABLE [dbo].[MobileApp_AppBook] ADD CONSTRAINT [FK_dbo.MobileApp_AppBook_dbo.MobileApp_AppBookCategory_AppBookCategoryId] FOREIGN KEY ([AppBookCategoryId]) REFERENCES [dbo].[MobileApp_AppBookCategory] ([Id])
ALTER TABLE [dbo].[MobileApp_AppBook] ADD CONSTRAINT [FK_dbo.MobileApp_AppBook_dbo.MobileApp_AppBookPublisher_AppBookPublisherId] FOREIGN KEY ([AppBookPublisherId]) REFERENCES [dbo].[MobileApp_AppBookPublisher] ([Id])
ALTER TABLE [dbo].[MobileApp_AppBook] ADD CONSTRAINT [FK_dbo.MobileApp_AppBook_dbo.MobileApp_AppClass_AppClassId] FOREIGN KEY ([AppClassId]) REFERENCES [dbo].[MobileApp_AppClass] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_AppBook] ADD CONSTRAINT [FK_dbo.MobileApp_AppBook_dbo.MobileApp_AppLesson_AppLessonId] FOREIGN KEY ([AppLessonId]) REFERENCES [dbo].[MobileApp_AppLesson] ([Id])
ALTER TABLE [dbo].[MobileApp_AppBook] ADD CONSTRAINT [FK_dbo.MobileApp_AppBook_dbo.Attachments_Attachment_AttachmentId] FOREIGN KEY ([AttachmentId]) REFERENCES [dbo].[Attachments_Attachment] ([Id])
ALTER TABLE [dbo].[MobileApp_AppBook] ADD CONSTRAINT [FK_dbo.MobileApp_AppBook_dbo.Attachments_AttachmentFolder_AttachmentFolderId] FOREIGN KEY ([AttachmentFolderId]) REFERENCES [dbo].[Attachments_AttachmentFolder] ([Id])
ALTER TABLE [dbo].[MobileApp_AppBook] ADD CONSTRAINT [FK_dbo.MobileApp_AppBook_dbo.MobileApp_BookKind_BookKindId] FOREIGN KEY ([BookKindId]) REFERENCES [dbo].[MobileApp_BookKind] ([Id])
ALTER TABLE [dbo].[MobileApp_AppBook] ADD CONSTRAINT [FK_dbo.MobileApp_AppBook_dbo.MobileApp_AppBook_ParentAppBookId] FOREIGN KEY ([ParentAppBookId]) REFERENCES [dbo].[MobileApp_AppBook] ([Id])
ALTER TABLE [dbo].[MobileApp_AppBook] ADD CONSTRAINT [FK_dbo.MobileApp_AppBook_dbo.MobileApp_EducationYear_EducationYearId] FOREIGN KEY ([EducationYearId]) REFERENCES [dbo].[MobileApp_EducationYear] ([Id])
ALTER TABLE [dbo].[MobileApp_AppBook] ADD CONSTRAINT [FK_dbo.MobileApp_AppBook_dbo.Attachments_Attachment_PrintingAttachmentId] FOREIGN KEY ([PrintingAttachmentId]) REFERENCES [dbo].[Attachments_Attachment] ([Id])
ALTER TABLE [dbo].[MobileApp_AppBook] ADD CONSTRAINT [FK_dbo.MobileApp_AppBook_dbo.Omr_SheetTemplate_SheetTemplateId] FOREIGN KEY ([SheetTemplateId]) REFERENCES [dbo].[Omr_SheetTemplate] ([Id])
ALTER TABLE [dbo].[MobileApp_AppBook] ADD CONSTRAINT [FK_dbo.MobileApp_AppBook_dbo.Attachments_Attachment_SmartBookAttachmentId] FOREIGN KEY ([SmartBookAttachmentId]) REFERENCES [dbo].[Attachments_Attachment] ([Id])
ALTER TABLE [dbo].[MobileApp_AppBook] ADD CONSTRAINT [FK_dbo.MobileApp_AppBook_dbo.SmartBook_SmartBookVersion_SmartBookVersionId] FOREIGN KEY ([SmartBookVersionId]) REFERENCES [dbo].[SmartBook_SmartBookVersion] ([Id])
ALTER TABLE [dbo].[MobileApp_AppBook] ADD CONSTRAINT [FK_dbo.MobileApp_AppBook_dbo.Attachments_Attachment_SolutionAttachmentId] FOREIGN KEY ([SolutionAttachmentId]) REFERENCES [dbo].[Attachments_Attachment] ([Id])
ALTER TABLE [dbo].[MobileApp_AppBook] ADD CONSTRAINT [FK_dbo.MobileApp_AppBook_dbo.MobileApp_TryingExamCategory_TryingExamCategoryId] FOREIGN KEY ([TryingExamCategoryId]) REFERENCES [dbo].[MobileApp_TryingExamCategory] ([Id])
ALTER TABLE [dbo].[MobileApp_AppBookPackagesToBook] ADD CONSTRAINT [FK_dbo.MobileApp_AppBookPackagesToBook_dbo.MobileApp_AppBook_AppBookId] FOREIGN KEY ([AppBookId]) REFERENCES [dbo].[MobileApp_AppBook] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_AppBookPackagesToBook] ADD CONSTRAINT [FK_dbo.MobileApp_AppBookPackagesToBook_dbo.MobileApp_AppBookPackages_AppBookPackagesId] FOREIGN KEY ([AppBookPackagesId]) REFERENCES [dbo].[MobileApp_AppBookPackages] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_AppBookPermission] ADD CONSTRAINT [FK_dbo.MobileApp_AppBookPermission_dbo.MobileApp_AppBook_AppBookId] FOREIGN KEY ([AppBookId]) REFERENCES [dbo].[MobileApp_AppBook] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_AppBookPermissionRole] ADD CONSTRAINT [FK_dbo.MobileApp_AppBookPermissionRole_dbo.MobileApp_AppBookPermission_AppBookPermissionId] FOREIGN KEY ([AppBookPermissionId]) REFERENCES [dbo].[MobileApp_AppBookPermission] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_AppBookPermissionRole] ADD CONSTRAINT [FK_dbo.MobileApp_AppBookPermissionRole_dbo.Central_Role_RoleId] FOREIGN KEY ([RoleId]) REFERENCES [dbo].[Central_Role] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_AppBookPermissionSchool] ADD CONSTRAINT [FK_dbo.MobileApp_AppBookPermissionSchool_dbo.MobileApp_AppBookPermission_AppBookPermissionId] FOREIGN KEY ([AppBookPermissionId]) REFERENCES [dbo].[MobileApp_AppBookPermission] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_AppBookPermissionSchool] ADD CONSTRAINT [FK_dbo.MobileApp_AppBookPermissionSchool_dbo.Central_School_SchoolId] FOREIGN KEY ([SchoolId]) REFERENCES [dbo].[Central_School] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_AppBookPermissionUser] ADD CONSTRAINT [FK_dbo.MobileApp_AppBookPermissionUser_dbo.MobileApp_AppBookPermission_AppBookPermissionId] FOREIGN KEY ([AppBookPermissionId]) REFERENCES [dbo].[MobileApp_AppBookPermission] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_AppBookPermissionUser] ADD CONSTRAINT [FK_dbo.MobileApp_AppBookPermissionUser_dbo.Central_User_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Central_User] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_AppBookUserGroups] ADD CONSTRAINT [FK_dbo.MobileApp_AppBookUserGroups_dbo.MobileApp_AppBook_AppBookId] FOREIGN KEY ([AppBookId]) REFERENCES [dbo].[MobileApp_AppBook] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_AppClass] ADD CONSTRAINT [FK_dbo.MobileApp_AppClass_dbo.Central_UserGroup_UserGroupId] FOREIGN KEY ([UserGroupId]) REFERENCES [dbo].[Central_UserGroup] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_AppLesson] ADD CONSTRAINT [FK_dbo.MobileApp_AppLesson_dbo.Central_UserGroup_UserGroupId] FOREIGN KEY ([UserGroupId]) REFERENCES [dbo].[Central_UserGroup] ([Id])
ALTER TABLE [dbo].[MobileApp_BookContent] ADD CONSTRAINT [FK_dbo.MobileApp_BookContent_dbo.MobileApp_AppBook_AppBookId] FOREIGN KEY ([AppBookId]) REFERENCES [dbo].[MobileApp_AppBook] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_BookContent] ADD CONSTRAINT [FK_dbo.MobileApp_BookContent_dbo.Attachments_AttachmentFolder_AttachmentFolderId] FOREIGN KEY ([AttachmentFolderId]) REFERENCES [dbo].[Attachments_AttachmentFolder] ([Id])
ALTER TABLE [dbo].[MobileApp_BookContent] ADD CONSTRAINT [FK_dbo.MobileApp_BookContent_dbo.MobileApp_BookContent_ParentBookContentId] FOREIGN KEY ([ParentBookContentId]) REFERENCES [dbo].[MobileApp_BookContent] ([Id])
ALTER TABLE [dbo].[MobileApp_BookContent] ADD CONSTRAINT [FK_dbo.MobileApp_BookContent_dbo.MobileApp_TryingExamCategorySection_TryingExamCategorySectionId] FOREIGN KEY ([TryingExamCategorySectionId]) REFERENCES [dbo].[MobileApp_TryingExamCategorySection] ([Id])
ALTER TABLE [dbo].[MobileApp_BookContent] ADD CONSTRAINT [FK_dbo.MobileApp_BookContent_dbo.Attachments_Attachment_VideoAttachmentId] FOREIGN KEY ([VideoAttachmentId]) REFERENCES [dbo].[Attachments_Attachment] ([Id])
ALTER TABLE [dbo].[MobileApp_Activity] ADD CONSTRAINT [FK_dbo.MobileApp_Activity_dbo.MobileApp_BookContent_BookContentId] FOREIGN KEY ([BookContentId]) REFERENCES [dbo].[MobileApp_BookContent] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_Activity] ADD CONSTRAINT [FK_dbo.MobileApp_Activity_dbo.Attachments_Attachment_ContentAttachmentId] FOREIGN KEY ([ContentAttachmentId]) REFERENCES [dbo].[Attachments_Attachment] ([Id])
ALTER TABLE [dbo].[MobileApp_Activity] ADD CONSTRAINT [FK_dbo.MobileApp_Activity_dbo.MobileApp_Position_PositionId] FOREIGN KEY ([PositionId]) REFERENCES [dbo].[MobileApp_Position] ([Id])
ALTER TABLE [dbo].[MobileApp_BookContentLesson] ADD CONSTRAINT [FK_dbo.MobileApp_BookContentLesson_dbo.Attachments_Attachment_Attachment_Id] FOREIGN KEY ([Attachment_Id]) REFERENCES [dbo].[Attachments_Attachment] ([Id])
ALTER TABLE [dbo].[MobileApp_BookContentLesson] ADD CONSTRAINT [FK_dbo.MobileApp_BookContentLesson_dbo.Attachments_AttachmentFolder_AttachmentFolderId] FOREIGN KEY ([AttachmentFolderId]) REFERENCES [dbo].[Attachments_AttachmentFolder] ([Id])
ALTER TABLE [dbo].[MobileApp_BookContentLesson] ADD CONSTRAINT [FK_dbo.MobileApp_BookContentLesson_dbo.MobileApp_BookContent_BookContentId] FOREIGN KEY ([BookContentId]) REFERENCES [dbo].[MobileApp_BookContent] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_BookContentLesson] ADD CONSTRAINT [FK_dbo.MobileApp_BookContentLesson_dbo.MobileApp_SolutionVideo_SolutionVideoId] FOREIGN KEY ([SolutionVideoId]) REFERENCES [dbo].[MobileApp_SolutionVideo] ([Id])
ALTER TABLE [dbo].[MobileApp_SolutionVideo] ADD CONSTRAINT [FK_dbo.MobileApp_SolutionVideo_dbo.Central_User_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Central_User] ([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])
ALTER TABLE [dbo].[MobileApp_Test] ADD CONSTRAINT [FK_dbo.MobileApp_Test_dbo.Attachments_AttachmentFolder_AttachmentFolderId] FOREIGN KEY ([AttachmentFolderId]) REFERENCES [dbo].[Attachments_AttachmentFolder] ([Id])
ALTER TABLE [dbo].[MobileApp_Test] ADD CONSTRAINT [FK_dbo.MobileApp_Test_dbo.MobileApp_BookContent_BookContentId] FOREIGN KEY ([BookContentId]) REFERENCES [dbo].[MobileApp_BookContent] ([Id])
ALTER TABLE [dbo].[MobileApp_Test] ADD CONSTRAINT [FK_dbo.MobileApp_Test_dbo.MobileApp_AppLesson_LessonId] FOREIGN KEY ([LessonId]) REFERENCES [dbo].[MobileApp_AppLesson] ([Id])
ALTER TABLE [dbo].[MobileApp_Test] ADD CONSTRAINT [FK_dbo.MobileApp_Test_dbo.Omr_SheetTemplate_SheetTemplateId] FOREIGN KEY ([SheetTemplateId]) REFERENCES [dbo].[Omr_SheetTemplate] ([Id])
ALTER TABLE [dbo].[MobileApp_Test] ADD CONSTRAINT [FK_dbo.MobileApp_Test_dbo.MobileApp_TryingExamCategorySectionLesson_TryingExamCategorySectionLessonId] FOREIGN KEY ([TryingExamCategorySectionLessonId]) REFERENCES [dbo].[MobileApp_TryingExamCategorySectionLesson] ([Id])
ALTER TABLE [dbo].[MobileApp_Test] ADD CONSTRAINT [FK_dbo.MobileApp_Test_dbo.Central_User_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Central_User] ([Id])
ALTER TABLE [dbo].[MobileApp_TestQuestion] ADD CONSTRAINT [FK_dbo.MobileApp_TestQuestion_dbo.MobileApp_Question_QuestionId] FOREIGN KEY ([QuestionId]) REFERENCES [dbo].[MobileApp_Question] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_TestQuestion] ADD CONSTRAINT [FK_dbo.MobileApp_TestQuestion_dbo.MobileApp_Test_TestId] FOREIGN KEY ([TestId]) REFERENCES [dbo].[MobileApp_Test] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_QuestionComment] ADD CONSTRAINT [FK_dbo.MobileApp_QuestionComment_dbo.MobileApp_TestQuestion_TestQuestionId] FOREIGN KEY ([TestQuestionId]) REFERENCES [dbo].[MobileApp_TestQuestion] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_QuestionComment] ADD CONSTRAINT [FK_dbo.MobileApp_QuestionComment_dbo.Central_User_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Central_User] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_Question] ADD CONSTRAINT [FK_dbo.MobileApp_Question_dbo.Attachments_Attachment_AttachmentId] FOREIGN KEY ([AttachmentId]) REFERENCES [dbo].[Attachments_Attachment] ([Id])
ALTER TABLE [dbo].[MobileApp_Question] ADD CONSTRAINT [FK_dbo.MobileApp_Question_dbo.MobileApp_Position_PositionId] FOREIGN KEY ([PositionId]) REFERENCES [dbo].[MobileApp_Position] ([Id])
ALTER TABLE [dbo].[MobileApp_Question] ADD CONSTRAINT [FK_dbo.MobileApp_Question_dbo.MobileApp_Position_RootPositionId] FOREIGN KEY ([RootPositionId]) REFERENCES [dbo].[MobileApp_Position] ([Id])
ALTER TABLE [dbo].[MobileApp_Question] ADD CONSTRAINT [FK_dbo.MobileApp_Question_dbo.Attachments_Attachment_RootQuestionAttachmentId] FOREIGN KEY ([RootQuestionAttachmentId]) REFERENCES [dbo].[Attachments_Attachment] ([Id])
ALTER TABLE [dbo].[MobileApp_Question] ADD CONSTRAINT [FK_dbo.MobileApp_Question_dbo.MobileApp_QuestionSetting_SettingId] FOREIGN KEY ([SettingId]) REFERENCES [dbo].[MobileApp_QuestionSetting] ([Id])
ALTER TABLE [dbo].[MobileApp_Question] ADD CONSTRAINT [FK_dbo.MobileApp_Question_dbo.MobileApp_Solution_SolutionId] FOREIGN KEY ([SolutionId]) REFERENCES [dbo].[MobileApp_Solution] ([Id])
ALTER TABLE [dbo].[MobileApp_Choice] ADD CONSTRAINT [FK_dbo.MobileApp_Choice_dbo.Attachments_Attachment_AttachmentId] FOREIGN KEY ([AttachmentId]) REFERENCES [dbo].[Attachments_Attachment] ([Id])
ALTER TABLE [dbo].[MobileApp_Choice] ADD CONSTRAINT [FK_dbo.MobileApp_Choice_dbo.MobileApp_Position_PositionId] FOREIGN KEY ([PositionId]) REFERENCES [dbo].[MobileApp_Position] ([Id])
ALTER TABLE [dbo].[MobileApp_Choice] ADD CONSTRAINT [FK_dbo.MobileApp_Choice_dbo.Attachments_Attachment_SolutionAttachmentId] FOREIGN KEY ([SolutionAttachmentId]) REFERENCES [dbo].[Attachments_Attachment] ([Id])
ALTER TABLE [dbo].[MobileApp_Choice] ADD CONSTRAINT [FK_dbo.MobileApp_Choice_dbo.MobileApp_Question_QuestionId] FOREIGN KEY ([QuestionId]) REFERENCES [dbo].[MobileApp_Question] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_ChoiceMap] ADD CONSTRAINT [FK_dbo.MobileApp_ChoiceMap_dbo.MobileApp_Choice_SourceId] FOREIGN KEY ([SourceId]) REFERENCES [dbo].[MobileApp_Choice] ([Id])
ALTER TABLE [dbo].[MobileApp_ChoiceMap] ADD CONSTRAINT [FK_dbo.MobileApp_ChoiceMap_dbo.MobileApp_Choice_TargetId] FOREIGN KEY ([TargetId]) REFERENCES [dbo].[MobileApp_Choice] ([Id])
ALTER TABLE [dbo].[MobileApp_QuestionFile] ADD CONSTRAINT [FK_dbo.MobileApp_QuestionFile_dbo.Attachments_Attachment_FileId] FOREIGN KEY ([FileId]) REFERENCES [dbo].[Attachments_Attachment] ([Id])
ALTER TABLE [dbo].[MobileApp_QuestionFile] ADD CONSTRAINT [FK_dbo.MobileApp_QuestionFile_dbo.MobileApp_Position_PositionId] FOREIGN KEY ([PositionId]) REFERENCES [dbo].[MobileApp_Position] ([Id])
ALTER TABLE [dbo].[MobileApp_QuestionFile] ADD CONSTRAINT [FK_dbo.MobileApp_QuestionFile_dbo.MobileApp_Question_QuestionId] FOREIGN KEY ([QuestionId]) REFERENCES [dbo].[MobileApp_Question] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_Solution] ADD CONSTRAINT [FK_dbo.MobileApp_Solution_dbo.Attachments_Attachment_AttachmentId] FOREIGN KEY ([AttachmentId]) REFERENCES [dbo].[Attachments_Attachment] ([Id])
ALTER TABLE [dbo].[MobileApp_Solution] ADD CONSTRAINT [FK_dbo.MobileApp_Solution_dbo.MobileApp_SolutionVideo_VideoId] FOREIGN KEY ([VideoId]) REFERENCES [dbo].[MobileApp_SolutionVideo] ([Id])
ALTER TABLE [dbo].[MobileApp_TryingExamCategorySectionLesson] ADD CONSTRAINT [FK_dbo.MobileApp_TryingExamCategorySectionLesson_dbo.MobileApp_AppLesson_LessonId] FOREIGN KEY ([LessonId]) REFERENCES [dbo].[MobileApp_AppLesson] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_TryingExamCategorySectionLesson] ADD CONSTRAINT [FK_dbo.MobileApp_TryingExamCategorySectionLesson_dbo.MobileApp_AppLesson_OrLessonId] FOREIGN KEY ([OrLessonId]) REFERENCES [dbo].[MobileApp_AppLesson] ([Id])
ALTER TABLE [dbo].[MobileApp_TryingExamCategorySectionLesson] ADD CONSTRAINT [FK_dbo.MobileApp_TryingExamCategorySectionLesson_dbo.MobileApp_TryingExamCategorySection_TryingExamCategorySectionId] FOREIGN KEY ([TryingExamCategorySectionId]) REFERENCES [dbo].[MobileApp_TryingExamCategorySection] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_LessonCoefficient] ADD CONSTRAINT [FK_dbo.MobileApp_LessonCoefficient_dbo.MobileApp_ScoreType_ScoreTypeId] FOREIGN KEY ([ScoreTypeId]) REFERENCES [dbo].[MobileApp_ScoreType] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_LessonCoefficient] ADD CONSTRAINT [FK_dbo.MobileApp_LessonCoefficient_dbo.MobileApp_TryingExamCategorySectionLesson_TryingExamCategorySectionLessonId] FOREIGN KEY ([TryingExamCategorySectionLessonId]) REFERENCES [dbo].[MobileApp_TryingExamCategorySectionLesson] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_TryingExamCategorySection] ADD CONSTRAINT [FK_dbo.MobileApp_TryingExamCategorySection_dbo.MobileApp_TryingExamCategory_TryingExamCategoryId] FOREIGN KEY ([TryingExamCategoryId]) REFERENCES [dbo].[MobileApp_TryingExamCategory] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_TryingExamCategory] ADD CONSTRAINT [FK_dbo.MobileApp_TryingExamCategory_dbo.MobileApp_TryingExamCategory_RelatedTryingExamCategoryId] FOREIGN KEY ([RelatedTryingExamCategoryId]) REFERENCES [dbo].[MobileApp_TryingExamCategory] ([Id])
ALTER TABLE [dbo].[MobileApp_TryingExamCategory] ADD CONSTRAINT [FK_dbo.MobileApp_TryingExamCategory_dbo.Omr_SheetTemplate_SheetTemplateId] FOREIGN KEY ([SheetTemplateId]) REFERENCES [dbo].[Omr_SheetTemplate] ([Id])
ALTER TABLE [dbo].[MobileApp_TryingExamCategoryClass] ADD CONSTRAINT [FK_dbo.MobileApp_TryingExamCategoryClass_dbo.Central_UserGroup_AppClassId] FOREIGN KEY ([AppClassId]) REFERENCES [dbo].[Central_UserGroup] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_TryingExamCategoryClass] ADD CONSTRAINT [FK_dbo.MobileApp_TryingExamCategoryClass_dbo.MobileApp_TryingExamCategory_TryingExamCategoryId] FOREIGN KEY ([TryingExamCategoryId]) REFERENCES [dbo].[MobileApp_TryingExamCategory] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_TryingExamCategoryScoreType] ADD CONSTRAINT [FK_dbo.MobileApp_TryingExamCategoryScoreType_dbo.MobileApp_ScoreType_ScoreTypeId] FOREIGN KEY ([ScoreTypeId]) REFERENCES [dbo].[MobileApp_ScoreType] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_TryingExamCategoryScoreType] ADD CONSTRAINT [FK_dbo.MobileApp_TryingExamCategoryScoreType_dbo.MobileApp_TryingExamCategory_TryingExamCategoryId] FOREIGN KEY ([TryingExamCategoryId]) REFERENCES [dbo].[MobileApp_TryingExamCategory] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_BookFile] ADD CONSTRAINT [FK_dbo.MobileApp_BookFile_dbo.MobileApp_AppBook_BookId] FOREIGN KEY ([BookId]) REFERENCES [dbo].[MobileApp_AppBook] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_BookFile] ADD CONSTRAINT [FK_dbo.MobileApp_BookFile_dbo.Attachments_Attachment_FileId] FOREIGN KEY ([FileId]) REFERENCES [dbo].[Attachments_Attachment] ([Id])
ALTER TABLE [dbo].[MobileApp_BookFileRole] ADD CONSTRAINT [FK_dbo.MobileApp_BookFileRole_dbo.MobileApp_BookFile_BookFileId] FOREIGN KEY ([BookFileId]) REFERENCES [dbo].[MobileApp_BookFile] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_BookFileRole] ADD CONSTRAINT [FK_dbo.MobileApp_BookFileRole_dbo.Central_Role_RoleId] FOREIGN KEY ([RoleId]) REFERENCES [dbo].[Central_Role] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_BookPage] ADD CONSTRAINT [FK_dbo.MobileApp_BookPage_dbo.Attachments_Attachment_AttachmentId] FOREIGN KEY ([AttachmentId]) REFERENCES [dbo].[Attachments_Attachment] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_BookPage] ADD CONSTRAINT [FK_dbo.MobileApp_BookPage_dbo.MobileApp_AppBook_BookId] FOREIGN KEY ([BookId]) REFERENCES [dbo].[MobileApp_AppBook] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[SmartBook_SmartBookVersion] ADD CONSTRAINT [FK_dbo.SmartBook_SmartBookVersion_dbo.Attachments_Attachment_AttachmentId] FOREIGN KEY ([AttachmentId]) REFERENCES [dbo].[Attachments_Attachment] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_TenantBook] ADD CONSTRAINT [FK_dbo.MobileApp_TenantBook_dbo.MobileApp_AppBook_BookId] FOREIGN KEY ([BookId]) REFERENCES [dbo].[MobileApp_AppBook] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_TenantBook] ADD CONSTRAINT [FK_dbo.MobileApp_TenantBook_dbo.Attachments_Attachment_CoverImageId] FOREIGN KEY ([CoverImageId]) REFERENCES [dbo].[Attachments_Attachment] ([Id])
ALTER TABLE [dbo].[MobileApp_TenantBook] ADD CONSTRAINT [FK_dbo.MobileApp_TenantBook_dbo.Central_Tenant_TenantId] FOREIGN KEY ([TenantId]) REFERENCES [dbo].[Central_Tenant] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_BookTheme] ADD CONSTRAINT [FK_dbo.MobileApp_BookTheme_dbo.MobileApp_AppBook_BookId] FOREIGN KEY ([BookId]) REFERENCES [dbo].[MobileApp_AppBook] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_BookTheme] ADD CONSTRAINT [FK_dbo.MobileApp_BookTheme_dbo.MobileApp_Theme_ThemeId] FOREIGN KEY ([ThemeId]) REFERENCES [dbo].[MobileApp_Theme] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_TryingExamPlan] ADD CONSTRAINT [FK_dbo.MobileApp_TryingExamPlan_dbo.Central_User_CreatorUserId] FOREIGN KEY ([CreatorUserId]) REFERENCES [dbo].[Central_User] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_TryingExamPlan] ADD CONSTRAINT [FK_dbo.MobileApp_TryingExamPlan_dbo.Central_School_SchoolId] FOREIGN KEY ([SchoolId]) REFERENCES [dbo].[Central_School] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_TryingExamPlan] ADD CONSTRAINT [FK_dbo.MobileApp_TryingExamPlan_dbo.MobileApp_AppBook_TryingExamId] FOREIGN KEY ([TryingExamId]) REFERENCES [dbo].[MobileApp_AppBook] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_TryingExamPlanClassRoom] ADD CONSTRAINT [FK_dbo.MobileApp_TryingExamPlanClassRoom_dbo.MobileApp_TryingExamPlan_PlanId] FOREIGN KEY ([PlanId]) REFERENCES [dbo].[MobileApp_TryingExamPlan] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[SmartBoardAdmin_SmartBookItemComment] ADD CONSTRAINT [FK_dbo.SmartBoardAdmin_SmartBookItemComment_dbo.Attachments_Attachment_CommentAttachmentId] FOREIGN KEY ([CommentAttachmentId]) REFERENCES [dbo].[Attachments_Attachment] ([Id])
ALTER TABLE [dbo].[SmartBoardAdmin_SmartBookItemComment] ADD CONSTRAINT [FK_dbo.SmartBoardAdmin_SmartBookItemComment_dbo.Central_User_CommentUserId] FOREIGN KEY ([CommentUserId]) REFERENCES [dbo].[Central_User] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[SmartBoardAdmin_SmartBookItemComment] ADD CONSTRAINT [FK_dbo.SmartBoardAdmin_SmartBookItemComment_dbo.SmartBoardAdmin_SmartBookItem_SmartBookItemId] FOREIGN KEY ([SmartBookItemId]) REFERENCES [dbo].[SmartBoardAdmin_SmartBookItem] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[SmartBook_SmBook] ADD CONSTRAINT [FK_dbo.SmartBook_SmBook_dbo.MobileApp_AppBook_AppBookId] FOREIGN KEY ([AppBookId]) REFERENCES [dbo].[MobileApp_AppBook] ([Id])
ALTER TABLE [dbo].[SmartBook_SmBook] ADD CONSTRAINT [FK_dbo.SmartBook_SmBook_dbo.Attachments_Attachment_AttachmentId] FOREIGN KEY ([AttachmentId]) REFERENCES [dbo].[Attachments_Attachment] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[SmartBook_SmBookContent] ADD CONSTRAINT [FK_dbo.SmartBook_SmBookContent_dbo.SmartBook_SmBookContent_ParentBookContentId] FOREIGN KEY ([ParentBookContentId]) REFERENCES [dbo].[SmartBook_SmBookContent] ([Id])
ALTER TABLE [dbo].[SmartBook_SmBookContent] ADD CONSTRAINT [FK_dbo.SmartBook_SmBookContent_dbo.SmartBook_SmBook_SmartBookId] FOREIGN KEY ([SmartBookId]) REFERENCES [dbo].[SmartBook_SmBook] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[SmartBook_SmPage] ADD CONSTRAINT [FK_dbo.SmartBook_SmPage_dbo.SmartBook_SmBook_SmBookId] FOREIGN KEY ([SmBookId]) REFERENCES [dbo].[SmartBook_SmBook] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[SmartBook_UserNotes] ADD CONSTRAINT [FK_dbo.SmartBook_UserNotes_dbo.Central_User_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Central_User] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[SmartBook_UserDrawings] ADD CONSTRAINT [FK_dbo.SmartBook_UserDrawings_dbo.Central_User_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Central_User] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[SmartBook_UsersEmptyPage] ADD CONSTRAINT [FK_dbo.SmartBook_UsersEmptyPage_dbo.Central_User_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Central_User] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[SmartBook_LibraryApp] ADD CONSTRAINT [FK_dbo.SmartBook_LibraryApp_dbo.Attachments_Attachment_AppAttachmentId] FOREIGN KEY ([AppAttachmentId]) REFERENCES [dbo].[Attachments_Attachment] ([Id])
ALTER TABLE [dbo].[SmartBook_LibraryApp] ADD CONSTRAINT [FK_dbo.SmartBook_LibraryApp_dbo.MobileApp_AppLesson_LessonId] FOREIGN KEY ([LessonId]) REFERENCES [dbo].[MobileApp_AppLesson] ([Id])
ALTER TABLE [dbo].[SmartBook_LibraryApp] ADD CONSTRAINT [FK_dbo.SmartBook_LibraryApp_dbo.Central_Tenant_TenantId] FOREIGN KEY ([TenantId]) REFERENCES [dbo].[Central_Tenant] ([Id])
ALTER TABLE [dbo].[TimeTable_TimeTableColumn] ADD CONSTRAINT [FK_dbo.TimeTable_TimeTableColumn_dbo.TimeTable_TimeTable_TimeTableId] FOREIGN KEY ([TimeTableId]) REFERENCES [dbo].[TimeTable_TimeTable] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[TimeTable_TimeTable] ADD CONSTRAINT [FK_dbo.TimeTable_TimeTable_dbo.MobileApp_AppClass_AppClassId] FOREIGN KEY ([AppClassId]) REFERENCES [dbo].[MobileApp_AppClass] ([Id])
ALTER TABLE [dbo].[TimeTable_TimeTableRow] ADD CONSTRAINT [FK_dbo.TimeTable_TimeTableRow_dbo.TimeTable_TimeTable_TimeTableId] FOREIGN KEY ([TimeTableId]) REFERENCES [dbo].[TimeTable_TimeTable] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[TimeTable_TimeTableItemLesson] ADD CONSTRAINT [FK_dbo.TimeTable_TimeTableItemLesson_dbo.MobileApp_BookContentLesson_BookContentLessonId] FOREIGN KEY ([BookContentLessonId]) REFERENCES [dbo].[MobileApp_BookContentLesson] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[TimeTable_UserLessonVideoStatistics] ADD CONSTRAINT [FK_dbo.TimeTable_UserLessonVideoStatistics_dbo.MobileApp_BookContentLesson_BookContentLessonId] FOREIGN KEY ([BookContentLessonId]) REFERENCES [dbo].[MobileApp_BookContentLesson] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[TimeTable_UserLessonVideoStatistics] ADD CONSTRAINT [FK_dbo.TimeTable_UserLessonVideoStatistics_dbo.Central_User_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Central_User] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MySchool_ClassRoom] ADD CONSTRAINT [FK_dbo.MySchool_ClassRoom_dbo.MobileApp_AppClass_AppClassId] FOREIGN KEY ([AppClassId]) REFERENCES [dbo].[MobileApp_AppClass] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MySchool_ClassRoom] ADD CONSTRAINT [FK_dbo.MySchool_ClassRoom_dbo.Central_School_SchoolId] FOREIGN KEY ([SchoolId]) REFERENCES [dbo].[Central_School] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MySchool_UserClassRoom] ADD CONSTRAINT [FK_dbo.MySchool_UserClassRoom_dbo.MySchool_ClassRoom_ClassRoomId] FOREIGN KEY ([ClassRoomId]) REFERENCES [dbo].[MySchool_ClassRoom] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MySchool_UserClassRoom] ADD CONSTRAINT [FK_dbo.MySchool_UserClassRoom_dbo.Central_User_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Central_User] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[ActivationCodes_ActivationCode] ADD CONSTRAINT [FK_dbo.ActivationCodes_ActivationCode_dbo.Central_User_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Central_User] ([Id])
ALTER TABLE [dbo].[ActivationCodes_UserActivationCode] ADD CONSTRAINT [FK_dbo.ActivationCodes_UserActivationCode_dbo.ActivationCodes_ActivationCode_ActivationCodeId] FOREIGN KEY ([ActivationCodeId]) REFERENCES [dbo].[ActivationCodes_ActivationCode] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[ActivationCodes_UserActivationCode] ADD CONSTRAINT [FK_dbo.ActivationCodes_UserActivationCode_dbo.Central_User_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Central_User] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[ActivationCodes_UserActivationCodeRequest] ADD CONSTRAINT [FK_dbo.ActivationCodes_UserActivationCodeRequest_dbo.Central_User_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Central_User] ([Id])
ALTER TABLE [dbo].[ActivationCodes_UserActivationCodeRequestUserGroup] ADD CONSTRAINT [FK_dbo.ActivationCodes_UserActivationCodeRequestUserGroup_dbo.ActivationCodes_UserActivationCodeRequest_UserActivationCodeReques] FOREIGN KEY ([UserActivationCodeRequestId]) REFERENCES [dbo].[ActivationCodes_UserActivationCodeRequest] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[ActivationCodes_UserActivationCodeRequestUserGroup] ADD CONSTRAINT [FK_dbo.ActivationCodes_UserActivationCodeRequestUserGroup_dbo.Central_UserGroup_UserGroupId] FOREIGN KEY ([UserGroupId]) REFERENCES [dbo].[Central_UserGroup] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[SolutionApp_UserQuestionDrawing] ADD CONSTRAINT [FK_dbo.SolutionApp_UserQuestionDrawing_dbo.Central_User_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Central_User] ([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])
ALTER TABLE [dbo].[Dealers_DealerSchool] ADD CONSTRAINT [FK_dbo.Dealers_DealerSchool_dbo.Central_School_SchoolId] FOREIGN KEY ([SchoolId]) REFERENCES [dbo].[Central_School] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Dealers_DealerSchool] ADD CONSTRAINT [FK_dbo.Dealers_DealerSchool_dbo.Dealers_Dealer_DealerId] FOREIGN KEY ([DealerId]) REFERENCES [dbo].[Dealers_Dealer] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Dealers_DealerUser] ADD CONSTRAINT [FK_dbo.Dealers_DealerUser_dbo.Central_User_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Central_User] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Dealers_DealerUser] ADD CONSTRAINT [FK_dbo.Dealers_DealerUser_dbo.Dealers_Dealer_DealerId] FOREIGN KEY ([DealerId]) REFERENCES [dbo].[Dealers_Dealer] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Dealers_DealerFile] ADD CONSTRAINT [FK_dbo.Dealers_DealerFile_dbo.Dealers_Dealer_DealerId] FOREIGN KEY ([DealerId]) REFERENCES [dbo].[Dealers_Dealer] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Dealers_DealerFile] ADD CONSTRAINT [FK_dbo.Dealers_DealerFile_dbo.Attachments_Attachment_FileId] FOREIGN KEY ([FileId]) REFERENCES [dbo].[Attachments_Attachment] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[QuestionPool_QuestionPoolTest] ADD CONSTRAINT [FK_dbo.QuestionPool_QuestionPoolTest_dbo.Attachments_Attachment_AttachmentId] FOREIGN KEY ([AttachmentId]) REFERENCES [dbo].[Attachments_Attachment] ([Id])
ALTER TABLE [dbo].[QuestionPool_QuestionPoolTest] ADD CONSTRAINT [FK_dbo.QuestionPool_QuestionPoolTest_dbo.MobileApp_Test_TestId] FOREIGN KEY ([TestId]) REFERENCES [dbo].[MobileApp_Test] ([Id])
ALTER TABLE [dbo].[QuestionPool_QuestionPoolTest] ADD CONSTRAINT [FK_dbo.QuestionPool_QuestionPoolTest_dbo.Central_User_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Central_User] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[QuestionPool_QuestionPoolCategoryClass] ADD CONSTRAINT [FK_dbo.QuestionPool_QuestionPoolCategoryClass_dbo.MobileApp_AppClass_ClassId] FOREIGN KEY ([ClassId]) REFERENCES [dbo].[MobileApp_AppClass] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[QuestionPool_QuestionPoolCategoryClass] ADD CONSTRAINT [FK_dbo.QuestionPool_QuestionPoolCategoryClass_dbo.QuestionPool_QuestionPoolCategory_QuestionPoolCategoryId] FOREIGN KEY ([QuestionPoolCategoryId]) REFERENCES [dbo].[QuestionPool_QuestionPoolCategory] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Gains_GainTopic] ADD CONSTRAINT [FK_dbo.Gains_GainTopic_dbo.MobileApp_AppClass_AppClassId] FOREIGN KEY ([AppClassId]) REFERENCES [dbo].[MobileApp_AppClass] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Gains_GainTopic] ADD CONSTRAINT [FK_dbo.Gains_GainTopic_dbo.MobileApp_AppLesson_AppLessonId] FOREIGN KEY ([AppLessonId]) REFERENCES [dbo].[MobileApp_AppLesson] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Gains_GainTopic] ADD CONSTRAINT [FK_dbo.Gains_GainTopic_dbo.Gains_GainTopic_ParentId] FOREIGN KEY ([ParentId]) REFERENCES [dbo].[Gains_GainTopic] ([Id])
ALTER TABLE [dbo].[Gains_GainTags] ADD CONSTRAINT [FK_dbo.Gains_GainTags_dbo.Gains_GainTopic_GainTopic_Id] FOREIGN KEY ([GainTopic_Id]) REFERENCES [dbo].[Gains_GainTopic] ([Id])
ALTER TABLE [dbo].[Gains_MebGain] ADD CONSTRAINT [FK_dbo.Gains_MebGain_dbo.Gains_GainTopic_GainTopicId] FOREIGN KEY ([GainTopicId]) REFERENCES [dbo].[Gains_GainTopic] ([Id])
ALTER TABLE [dbo].[Gains_MebGain] ADD CONSTRAINT [FK_dbo.Gains_MebGain_dbo.Gains_MebGain_ParentGainId] FOREIGN KEY ([ParentGainId]) REFERENCES [dbo].[Gains_MebGain] ([Id])
ALTER TABLE [dbo].[Gains_GainTopicTags] ADD CONSTRAINT [FK_dbo.Gains_GainTopicTags_dbo.Gains_GainTags_GainTagsId] FOREIGN KEY ([GainTagsId]) REFERENCES [dbo].[Gains_GainTags] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Gains_GainTopicTags] ADD CONSTRAINT [FK_dbo.Gains_GainTopicTags_dbo.Gains_GainTopic_GainTopicId] FOREIGN KEY ([GainTopicId]) REFERENCES [dbo].[Gains_GainTopic] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Gains_MebGainQuestion] ADD CONSTRAINT [FK_dbo.Gains_MebGainQuestion_dbo.Gains_MebGain_MebGainId] FOREIGN KEY ([MebGainId]) REFERENCES [dbo].[Gains_MebGain] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Gains_MebGainQuestion] ADD CONSTRAINT [FK_dbo.Gains_MebGainQuestion_dbo.MobileApp_Question_QuestionId] FOREIGN KEY ([QuestionId]) REFERENCES [dbo].[MobileApp_Question] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Counters_CounterUserGroup] ADD CONSTRAINT [FK_dbo.Counters_CounterUserGroup_dbo.Counters_Counter_CounterId] FOREIGN KEY ([CounterId]) REFERENCES [dbo].[Counters_Counter] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Counters_CounterUserGroup] ADD CONSTRAINT [FK_dbo.Counters_CounterUserGroup_dbo.Central_UserGroup_UserGroupId] FOREIGN KEY ([UserGroupId]) REFERENCES [dbo].[Central_UserGroup] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_RelatedLessonCoefficient] ADD CONSTRAINT [FK_dbo.MobileApp_RelatedLessonCoefficient_dbo.MobileApp_TryingExamCategorySectionLesson_RelatedTryingExamCategorySectionLessonId] FOREIGN KEY ([RelatedTryingExamCategorySectionLessonId]) REFERENCES [dbo].[MobileApp_TryingExamCategorySectionLesson] ([Id])
ALTER TABLE [dbo].[MobileApp_RelatedLessonCoefficient] ADD CONSTRAINT [FK_dbo.MobileApp_RelatedLessonCoefficient_dbo.MobileApp_ScoreType_ScoreTypeId] FOREIGN KEY ([ScoreTypeId]) REFERENCES [dbo].[MobileApp_ScoreType] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_RelatedLessonCoefficient] ADD CONSTRAINT [FK_dbo.MobileApp_RelatedLessonCoefficient_dbo.MobileApp_TryingExamCategory_TryingExamCategoryId] FOREIGN KEY ([TryingExamCategoryId]) REFERENCES [dbo].[MobileApp_TryingExamCategory] ([Id])
ALTER TABLE [dbo].[MobileApp_TryingExamResult] ADD CONSTRAINT [FK_dbo.MobileApp_TryingExamResult_dbo.MobileApp_AppBook_TryingExamId] FOREIGN KEY ([TryingExamId]) REFERENCES [dbo].[MobileApp_AppBook] ([Id])
ALTER TABLE [dbo].[MobileApp_TryingExamResult] ADD CONSTRAINT [FK_dbo.MobileApp_TryingExamResult_dbo.MobileApp_TryingExamCategory_TryingExamCategoryId] FOREIGN KEY ([TryingExamCategoryId]) REFERENCES [dbo].[MobileApp_TryingExamCategory] ([Id])
ALTER TABLE [dbo].[MobileApp_TryingExamResult] ADD CONSTRAINT [FK_dbo.MobileApp_TryingExamResult_dbo.Central_User_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Central_User] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_UserLessonStatistics] ADD CONSTRAINT [FK_dbo.MobileApp_UserLessonStatistics_dbo.MobileApp_AppLesson_AppLessonId] FOREIGN KEY ([AppLessonId]) REFERENCES [dbo].[MobileApp_AppLesson] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_UserLessonStatistics] ADD CONSTRAINT [FK_dbo.MobileApp_UserLessonStatistics_dbo.MobileApp_TryingExamResult_TryingExamResultId] FOREIGN KEY ([TryingExamResultId]) REFERENCES [dbo].[MobileApp_TryingExamResult] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_UserAnswer] ADD CONSTRAINT [FK_dbo.MobileApp_UserAnswer_dbo.MobileApp_Question_QuestionId] FOREIGN KEY ([QuestionId]) REFERENCES [dbo].[MobileApp_Question] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_UserAnswer] ADD CONSTRAINT [FK_dbo.MobileApp_UserAnswer_dbo.MobileApp_UserLessonStatistics_UserLessonStatistics_Id] FOREIGN KEY ([UserLessonStatistics_Id]) REFERENCES [dbo].[MobileApp_UserLessonStatistics] ([Id])
ALTER TABLE [dbo].[MobileApp_UserScores] ADD CONSTRAINT [FK_dbo.MobileApp_UserScores_dbo.MobileApp_ScoreType_ScoreTypeId] FOREIGN KEY ([ScoreTypeId]) REFERENCES [dbo].[MobileApp_ScoreType] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_UserScores] ADD CONSTRAINT [FK_dbo.MobileApp_UserScores_dbo.MobileApp_TryingExamResult_TryingExamResultId] FOREIGN KEY ([TryingExamResultId]) REFERENCES [dbo].[MobileApp_TryingExamResult] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_HomePageItemElement] ADD CONSTRAINT [FK_dbo.MobileApp_HomePageItemElement_dbo.MobileApp_HomePageItem_HomePageItemId] FOREIGN KEY ([HomePageItemId]) REFERENCES [dbo].[MobileApp_HomePageItem] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_UserEvent] ADD CONSTRAINT [FK_dbo.MobileApp_UserEvent_dbo.MobileApp_AppBook_BookId] FOREIGN KEY ([BookId]) REFERENCES [dbo].[MobileApp_AppBook] ([Id])
ALTER TABLE [dbo].[MobileApp_UserEvent] ADD CONSTRAINT [FK_dbo.MobileApp_UserEvent_dbo.Central_User_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Central_User] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_UserTestResult] ADD CONSTRAINT [FK_dbo.MobileApp_UserTestResult_dbo.MobileApp_Test_TestId] FOREIGN KEY ([TestId]) REFERENCES [dbo].[MobileApp_Test] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_UserTestResult] ADD CONSTRAINT [FK_dbo.MobileApp_UserTestResult_dbo.Central_User_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Central_User] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_UserTestAnswer] ADD CONSTRAINT [FK_dbo.MobileApp_UserTestAnswer_dbo.MobileApp_Question_QuestionId] FOREIGN KEY ([QuestionId]) REFERENCES [dbo].[MobileApp_Question] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_UserTestAnswer] ADD CONSTRAINT [FK_dbo.MobileApp_UserTestAnswer_dbo.MobileApp_UserTestResult_UserTestResultId] FOREIGN KEY ([UserTestResultId]) REFERENCES [dbo].[MobileApp_UserTestResult] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_UserBooks] ADD CONSTRAINT [FK_dbo.MobileApp_UserBooks_dbo.MobileApp_AppBook_AppBookId] FOREIGN KEY ([AppBookId]) REFERENCES [dbo].[MobileApp_AppBook] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_UserBooks] ADD CONSTRAINT [FK_dbo.MobileApp_UserBooks_dbo.Central_User_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Central_User] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_TeacherSolutions] ADD CONSTRAINT [FK_dbo.MobileApp_TeacherSolutions_dbo.Central_User_SolverUserId] FOREIGN KEY ([SolverUserId]) REFERENCES [dbo].[Central_User] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_TeacherSolutions] ADD CONSTRAINT [FK_dbo.MobileApp_TeacherSolutions_dbo.MobileApp_Test_TestId] FOREIGN KEY ([TestId]) REFERENCES [dbo].[MobileApp_Test] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_VideoComment] ADD CONSTRAINT [FK_dbo.MobileApp_VideoComment_dbo.MobileApp_SolutionVideo_SolutionVideoId] FOREIGN KEY ([SolutionVideoId]) REFERENCES [dbo].[MobileApp_SolutionVideo] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[MobileApp_BookContentLessonAreas] ADD CONSTRAINT [FK_dbo.MobileApp_BookContentLessonAreas_dbo.Attachments_Attachment_AttachmentId] FOREIGN KEY ([AttachmentId]) REFERENCES [dbo].[Attachments_Attachment] ([Id])
ALTER TABLE [dbo].[Omr_AnswerBlock] ADD CONSTRAINT [FK_dbo.Omr_AnswerBlock_dbo.Omr_SheetTemplate_SheetTemplateId] FOREIGN KEY ([SheetTemplateId]) REFERENCES [dbo].[Omr_SheetTemplate] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Omr_NumberBlock] ADD CONSTRAINT [FK_dbo.Omr_NumberBlock_dbo.Omr_SheetTemplate_SheetTemplateId] FOREIGN KEY ([SheetTemplateId]) REFERENCES [dbo].[Omr_SheetTemplate] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Omr_QrCodeBlock] ADD CONSTRAINT [FK_dbo.Omr_QrCodeBlock_dbo.Omr_SheetTemplate_SheetTemplateId] FOREIGN KEY ([SheetTemplateId]) REFERENCES [dbo].[Omr_SheetTemplate] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Slider_SliderImage] ADD CONSTRAINT [FK_dbo.Slider_SliderImage_dbo.Slider_MainSlider_SliderId] FOREIGN KEY ([SliderId]) REFERENCES [dbo].[Slider_MainSlider] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Slider_MainSlider] ADD CONSTRAINT [FK_dbo.Slider_MainSlider_dbo.Central_Tenant_TenantId] FOREIGN KEY ([TenantId]) REFERENCES [dbo].[Central_Tenant] ([Id])
ALTER TABLE [dbo].[Slider_SliderImageItem] ADD CONSTRAINT [FK_dbo.Slider_SliderImageItem_dbo.Attachments_Attachment_AttachmentId] FOREIGN KEY ([AttachmentId]) REFERENCES [dbo].[Attachments_Attachment] ([Id])
ALTER TABLE [dbo].[Slider_SliderImageItem] ADD CONSTRAINT [FK_dbo.Slider_SliderImageItem_dbo.Slider_SliderImage_SliderImageId] FOREIGN KEY ([SliderImageId]) REFERENCES [dbo].[Slider_SliderImage] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[ExamEvaluation_UserExam] ADD CONSTRAINT [FK_dbo.ExamEvaluation_UserExam_dbo.ExamEvaluation_OpticalFormTemplate_OpticalFormTemplateId] FOREIGN KEY ([OpticalFormTemplateId]) REFERENCES [dbo].[ExamEvaluation_OpticalFormTemplate] ([Id])
ALTER TABLE [dbo].[ExamEvaluation_UserExam] ADD CONSTRAINT [FK_dbo.ExamEvaluation_UserExam_dbo.MobileApp_TryingExamCategory_TryingExamCategoryId] FOREIGN KEY ([TryingExamCategoryId]) REFERENCES [dbo].[MobileApp_TryingExamCategory] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[ExamEvaluation_UserExam] ADD CONSTRAINT [FK_dbo.ExamEvaluation_UserExam_dbo.Central_User_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Central_User] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[ExamEvaluation_ExamQuestion] ADD CONSTRAINT [FK_dbo.ExamEvaluation_ExamQuestion_dbo.MobileApp_TryingExamCategorySectionLesson_SectionLessonId] FOREIGN KEY ([SectionLessonId]) REFERENCES [dbo].[MobileApp_TryingExamCategorySectionLesson] ([Id])
ALTER TABLE [dbo].[ExamEvaluation_ExamQuestion] ADD CONSTRAINT [FK_dbo.ExamEvaluation_ExamQuestion_dbo.ExamEvaluation_UserExam_UserExamId] FOREIGN KEY ([UserExamId]) REFERENCES [dbo].[ExamEvaluation_UserExam] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[ExamEvaluation_ExamQuestionGain] ADD CONSTRAINT [FK_dbo.ExamEvaluation_ExamQuestionGain_dbo.ExamEvaluation_ExamQuestion_ExamQuestionId] FOREIGN KEY ([ExamQuestionId]) REFERENCES [dbo].[ExamEvaluation_ExamQuestion] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[ExamEvaluation_ExamQuestionGain] ADD CONSTRAINT [FK_dbo.ExamEvaluation_ExamQuestionGain_dbo.Gains_MebGain_GainId] FOREIGN KEY ([GainId]) REFERENCES [dbo].[Gains_MebGain] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[ExamEvaluation_AreaInformation] ADD CONSTRAINT [FK_dbo.ExamEvaluation_AreaInformation_dbo.ExamEvaluation_OpticalFormTemplate_OpticalFormTemplateId] FOREIGN KEY ([OpticalFormTemplateId]) REFERENCES [dbo].[ExamEvaluation_OpticalFormTemplate] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[ExamEvaluation_ExamResult] ADD CONSTRAINT [FK_dbo.ExamEvaluation_ExamResult_dbo.Central_School_SchoolId] FOREIGN KEY ([SchoolId]) REFERENCES [dbo].[Central_School] ([Id])
ALTER TABLE [dbo].[ExamEvaluation_ExamResult] ADD CONSTRAINT [FK_dbo.ExamEvaluation_ExamResult_dbo.Central_User_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Central_User] ([Id])
ALTER TABLE [dbo].[ExamEvaluation_ExamResult] ADD CONSTRAINT [FK_dbo.ExamEvaluation_ExamResult_dbo.ExamEvaluation_UserExam_UserExamId] FOREIGN KEY ([UserExamId]) REFERENCES [dbo].[ExamEvaluation_UserExam] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[ExamEvaluation_ExamUserAnswer] ADD CONSTRAINT [FK_dbo.ExamEvaluation_ExamUserAnswer_dbo.ExamEvaluation_ExamQuestion_ExamQuestionId] FOREIGN KEY ([ExamQuestionId]) REFERENCES [dbo].[ExamEvaluation_ExamQuestion] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[ExamEvaluation_ExamUserAnswer] ADD CONSTRAINT [FK_dbo.ExamEvaluation_ExamUserAnswer_dbo.ExamEvaluation_ExamResult_ExamResultId] FOREIGN KEY ([ExamResultId]) REFERENCES [dbo].[ExamEvaluation_ExamResult] ([Id])
ALTER TABLE [dbo].[ExamEvaluation_ExamUserAnswer] ADD CONSTRAINT [FK_dbo.ExamEvaluation_ExamUserAnswer_dbo.ExamEvaluation_ExamUserLessonStats_ExamUserLessonStats_Id] FOREIGN KEY ([ExamUserLessonStats_Id]) REFERENCES [dbo].[ExamEvaluation_ExamUserLessonStats] ([Id])
ALTER TABLE [dbo].[ExamEvaluation_ExamUserLessonStats] ADD CONSTRAINT [FK_dbo.ExamEvaluation_ExamUserLessonStats_dbo.MobileApp_AppLesson_AppLessonId] FOREIGN KEY ([AppLessonId]) REFERENCES [dbo].[MobileApp_AppLesson] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[ExamEvaluation_ExamUserLessonStats] ADD CONSTRAINT [FK_dbo.ExamEvaluation_ExamUserLessonStats_dbo.ExamEvaluation_ExamResult_TryingExamResultId] FOREIGN KEY ([TryingExamResultId]) REFERENCES [dbo].[ExamEvaluation_ExamResult] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[ExamEvaluation_ExamUserScores] ADD CONSTRAINT [FK_dbo.ExamEvaluation_ExamUserScores_dbo.MobileApp_ScoreType_ScoreTypeId] FOREIGN KEY ([ScoreTypeId]) REFERENCES [dbo].[MobileApp_ScoreType] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[ExamEvaluation_ExamUserScores] ADD CONSTRAINT [FK_dbo.ExamEvaluation_ExamUserScores_dbo.ExamEvaluation_ExamResult_TryingExamResultId] FOREIGN KEY ([TryingExamResultId]) REFERENCES [dbo].[ExamEvaluation_ExamResult] ([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])
ALTER TABLE [dbo].[Examinations_Examination] ADD CONSTRAINT [FK_dbo.Examinations_Examination_dbo.Central_User_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Central_User] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Examinations_ExaminationTest] ADD CONSTRAINT [FK_dbo.Examinations_ExaminationTest_dbo.Examinations_Examination_ExaminationId] FOREIGN KEY ([ExaminationId]) REFERENCES [dbo].[Examinations_Examination] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Examinations_ExaminationTest] ADD CONSTRAINT [FK_dbo.Examinations_ExaminationTest_dbo.MobileApp_Test_TestId] FOREIGN KEY ([TestId]) REFERENCES [dbo].[MobileApp_Test] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Examinations_ExamTopicPattern] ADD CONSTRAINT [FK_dbo.Examinations_ExamTopicPattern_dbo.Examinations_Examination_ExaminationId] FOREIGN KEY ([ExaminationId]) REFERENCES [dbo].[Examinations_Examination] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Examinations_ExamTopicPattern] ADD CONSTRAINT [FK_dbo.Examinations_ExamTopicPattern_dbo.Gains_GainTopic_TopicId] FOREIGN KEY ([TopicId]) REFERENCES [dbo].[Gains_GainTopic] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[OnlineExam_ExamTopicDistrubition] ADD CONSTRAINT [FK_dbo.OnlineExam_ExamTopicDistrubition_dbo.MobileApp_TryingExamCategory_TryingExamCategoryId] FOREIGN KEY ([TryingExamCategoryId]) REFERENCES [dbo].[MobileApp_TryingExamCategory] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[OnlineExam_SectionTopicDistrubition] ADD CONSTRAINT [FK_dbo.OnlineExam_SectionTopicDistrubition_dbo.OnlineExam_ExamTopicDistrubition_ExamTopicDistrubitionId] FOREIGN KEY ([ExamTopicDistrubitionId]) REFERENCES [dbo].[OnlineExam_ExamTopicDistrubition] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[OnlineExam_SectionTopicDistrubition] ADD CONSTRAINT [FK_dbo.OnlineExam_SectionTopicDistrubition_dbo.Gains_GainTopic_GainTopicId] FOREIGN KEY ([GainTopicId]) REFERENCES [dbo].[Gains_GainTopic] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[OnlineLessons_OnlineLesson] ADD CONSTRAINT [FK_dbo.OnlineLessons_OnlineLesson_dbo.Central_User_CreatorUserId] FOREIGN KEY ([CreatorUserId]) REFERENCES [dbo].[Central_User] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[OnlineLessons_OnlineLesson] ADD CONSTRAINT [FK_dbo.OnlineLessons_OnlineLesson_dbo.MobileApp_AppLesson_LessonId] FOREIGN KEY ([LessonId]) REFERENCES [dbo].[MobileApp_AppLesson] ([Id])
ALTER TABLE [dbo].[OnlineLessons_OnlineLesson] ADD CONSTRAINT [FK_dbo.OnlineLessons_OnlineLesson_dbo.OnlineLessons_OnlineLesson_MainLessonId] FOREIGN KEY ([MainLessonId]) REFERENCES [dbo].[OnlineLessons_OnlineLesson] ([Id])
ALTER TABLE [dbo].[OnlineLessons_OnlineLessonAttendance] ADD CONSTRAINT [FK_dbo.OnlineLessons_OnlineLessonAttendance_dbo.OnlineLessons_OnlineLesson_OnlineLessonId] FOREIGN KEY ([OnlineLessonId]) REFERENCES [dbo].[OnlineLessons_OnlineLesson] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[OnlineLessons_OnlineLessonToClassRoom] ADD CONSTRAINT [FK_dbo.OnlineLessons_OnlineLessonToClassRoom_dbo.MySchool_ClassRoom_ClassRoomId] FOREIGN KEY ([ClassRoomId]) REFERENCES [dbo].[MySchool_ClassRoom] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[OnlineLessons_OnlineLessonToClassRoom] ADD CONSTRAINT [FK_dbo.OnlineLessons_OnlineLessonToClassRoom_dbo.OnlineLessons_OnlineLesson_OnlineLessonId] FOREIGN KEY ([OnlineLessonId]) REFERENCES [dbo].[OnlineLessons_OnlineLesson] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[OnlineLessons_MeetingSchoolAccount] ADD CONSTRAINT [FK_dbo.OnlineLessons_MeetingSchoolAccount_dbo.OnlineLessons_MeetingAccount_MeetingAccountId] FOREIGN KEY ([MeetingAccountId]) REFERENCES [dbo].[OnlineLessons_MeetingAccount] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[OnlineLessons_MeetingSchoolAccount] ADD CONSTRAINT [FK_dbo.OnlineLessons_MeetingSchoolAccount_dbo.Central_School_SchoolId] FOREIGN KEY ([SchoolId]) REFERENCES [dbo].[Central_School] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Assignments_Assignment] ADD CONSTRAINT [FK_dbo.Assignments_Assignment_dbo.MobileApp_Test_TestId] FOREIGN KEY ([TestId]) REFERENCES [dbo].[MobileApp_Test] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Assignments_AssignmentContent] ADD CONSTRAINT [FK_dbo.Assignments_AssignmentContent_dbo.Assignments_Assignment_AssignmentId] FOREIGN KEY ([AssignmentId]) REFERENCES [dbo].[Assignments_Assignment] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Assignments_AssignmentToClassRoom] ADD CONSTRAINT [FK_dbo.Assignments_AssignmentToClassRoom_dbo.Assignments_Assignment_AssignmentId] FOREIGN KEY ([AssignmentId]) REFERENCES [dbo].[Assignments_Assignment] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Assignments_AssignmentToClassRoom] ADD CONSTRAINT [FK_dbo.Assignments_AssignmentToClassRoom_dbo.MySchool_ClassRoom_ClassRoomId] FOREIGN KEY ([ClassRoomId]) REFERENCES [dbo].[MySchool_ClassRoom] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Assignments_AssignmentToUser] ADD CONSTRAINT [FK_dbo.Assignments_AssignmentToUser_dbo.Assignments_Assignment_AssignmentId] FOREIGN KEY ([AssignmentId]) REFERENCES [dbo].[Assignments_Assignment] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Assignments_AssignmentToUser] ADD CONSTRAINT [FK_dbo.Assignments_AssignmentToUser_dbo.Central_User_StudentId] FOREIGN KEY ([StudentId]) REFERENCES [dbo].[Central_User] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[PublicArea_WebPageTranslate] ADD CONSTRAINT [FK_dbo.PublicArea_WebPageTranslate_dbo.PublicArea_WebPage_PageId] FOREIGN KEY ([PageId]) REFERENCES [dbo].[PublicArea_WebPage] ([Id])
ALTER TABLE [dbo].[PublicArea_Company] ADD CONSTRAINT [FK_dbo.PublicArea_Company_dbo.Attachments_Attachment_AttachmentId] FOREIGN KEY ([AttachmentId]) REFERENCES [dbo].[Attachments_Attachment] ([Id])
ALTER TABLE [dbo].[PublicArea_Stories] ADD CONSTRAINT [FK_dbo.PublicArea_Stories_dbo.Attachments_Attachment_AttachmentId] FOREIGN KEY ([AttachmentId]) REFERENCES [dbo].[Attachments_Attachment] ([Id])
ALTER TABLE [dbo].[PublicArea_Stories] ADD CONSTRAINT [FK_dbo.PublicArea_Stories_dbo.PublicArea_Company_Company_Id] FOREIGN KEY ([Company_Id]) REFERENCES [dbo].[PublicArea_Company] ([Id])
ALTER TABLE [dbo].[PublicArea_Link] ADD CONSTRAINT [FK_dbo.PublicArea_Link_dbo.Attachments_Attachment_LinkImageId] FOREIGN KEY ([LinkImageId]) REFERENCES [dbo].[Attachments_Attachment] ([Id])
ALTER TABLE [dbo].[PublicArea_Catalog] ADD CONSTRAINT [FK_dbo.PublicArea_Catalog_dbo.Attachments_Attachment_CoverImageId] FOREIGN KEY ([CoverImageId]) REFERENCES [dbo].[Attachments_Attachment] ([Id])
ALTER TABLE [dbo].[PublicArea_Catalog] ADD CONSTRAINT [FK_dbo.PublicArea_Catalog_dbo.PublicArea_CatalogGroup_GroupId] FOREIGN KEY ([GroupId]) REFERENCES [dbo].[PublicArea_CatalogGroup] ([Id])
ALTER TABLE [dbo].[PublicArea_Catalog] ADD CONSTRAINT [FK_dbo.PublicArea_Catalog_dbo.Attachments_Attachment_PdfId] FOREIGN KEY ([PdfId]) REFERENCES [dbo].[Attachments_Attachment] ([Id])
ALTER TABLE [dbo].[PublicArea_CatalogPage] ADD CONSTRAINT [FK_dbo.PublicArea_CatalogPage_dbo.PublicArea_Catalog_CatalogId] FOREIGN KEY ([CatalogId]) REFERENCES [dbo].[PublicArea_Catalog] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[PublicArea_CatalogPage] ADD CONSTRAINT [FK_dbo.PublicArea_CatalogPage_dbo.Attachments_Attachment_ImageId] FOREIGN KEY ([ImageId]) REFERENCES [dbo].[Attachments_Attachment] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[ProductPackages_PackagesToProducts] ADD CONSTRAINT [FK_dbo.ProductPackages_PackagesToProducts_dbo.ProductPackages_Packages_PackagesId] FOREIGN KEY ([PackagesId]) REFERENCES [dbo].[ProductPackages_Packages] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[ProductPackages_PackagesUserPermission] ADD CONSTRAINT [FK_dbo.ProductPackages_PackagesUserPermission_dbo.ProductPackages_Packages_PackagesId] FOREIGN KEY ([PackagesId]) REFERENCES [dbo].[ProductPackages_Packages] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[ProductPackages_PackagesUserPermission] ADD CONSTRAINT [FK_dbo.ProductPackages_PackagesUserPermission_dbo.Central_User_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Central_User] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[VideoLessons_VideoLesson] ADD CONSTRAINT [FK_dbo.VideoLessons_VideoLesson_dbo.MobileApp_AppClass_AppClassId] FOREIGN KEY ([AppClassId]) REFERENCES [dbo].[MobileApp_AppClass] ([Id])
ALTER TABLE [dbo].[VideoLessons_VideoLesson] ADD CONSTRAINT [FK_dbo.VideoLessons_VideoLesson_dbo.MobileApp_AppLesson_AppLessonId] FOREIGN KEY ([AppLessonId]) REFERENCES [dbo].[MobileApp_AppLesson] ([Id])
ALTER TABLE [dbo].[VideoLessons_VideoLessonComments] ADD CONSTRAINT [FK_dbo.VideoLessons_VideoLessonComments_dbo.Central_User_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Central_User] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[VideoLessons_VideoLessonComments] ADD CONSTRAINT [FK_dbo.VideoLessons_VideoLessonComments_dbo.VideoLessons_VideoLesson_VideoLessonId] FOREIGN KEY ([VideoLessonId]) REFERENCES [dbo].[VideoLessons_VideoLesson] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[VideoLessons_VideoLessonContent] ADD CONSTRAINT [FK_dbo.VideoLessons_VideoLessonContent_dbo.VideoLessons_VideoLesson_VideoLessonId] FOREIGN KEY ([VideoLessonId]) REFERENCES [dbo].[VideoLessons_VideoLesson] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[VideoLessons_ContentVideos] ADD CONSTRAINT [FK_dbo.VideoLessons_ContentVideos_dbo.VideoLessons_VideoLessonContent_VideoLessonContentId] FOREIGN KEY ([VideoLessonContentId]) REFERENCES [dbo].[VideoLessons_VideoLessonContent] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[VideoLessons_ContentVideos] ADD CONSTRAINT [FK_dbo.VideoLessons_ContentVideos_dbo.VideoLessons_VideoLessonItem_VideoLessonItemId] FOREIGN KEY ([VideoLessonItemId]) REFERENCES [dbo].[VideoLessons_VideoLessonItem] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[VideoLessons_VideoLessonItem] ADD CONSTRAINT [FK_dbo.VideoLessons_VideoLessonItem_dbo.Attachments_Attachment_AttachmentId] FOREIGN KEY ([AttachmentId]) REFERENCES [dbo].[Attachments_Attachment] ([Id])
ALTER TABLE [dbo].[VideoLessons_VideoLessonItem] ADD CONSTRAINT [FK_dbo.VideoLessons_VideoLessonItem_dbo.VideoLessons_VideoLessonAuthor_VideoLessonAuthorId] FOREIGN KEY ([VideoLessonAuthorId]) REFERENCES [dbo].[VideoLessons_VideoLessonAuthor] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[VideoLessons_VideoLessonDocument] ADD CONSTRAINT [FK_dbo.VideoLessons_VideoLessonDocument_dbo.Attachments_Attachment_AttachmentId] FOREIGN KEY ([AttachmentId]) REFERENCES [dbo].[Attachments_Attachment] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[VideoLessons_VideoLessonDocument] ADD CONSTRAINT [FK_dbo.VideoLessons_VideoLessonDocument_dbo.VideoLessons_VideoLessonItem_VideoLessonItemId] FOREIGN KEY ([VideoLessonItemId]) REFERENCES [dbo].[VideoLessons_VideoLessonItem] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[VideoLessons_VideoLessonItemNotes] ADD CONSTRAINT [FK_dbo.VideoLessons_VideoLessonItemNotes_dbo.Central_User_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Central_User] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[VideoLessons_VideoLessonItemNotes] ADD CONSTRAINT [FK_dbo.VideoLessons_VideoLessonItemNotes_dbo.VideoLessons_VideoLessonItem_VideoLessonItemId] FOREIGN KEY ([VideoLessonItemId]) REFERENCES [dbo].[VideoLessons_VideoLessonItem] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[VideoLessons_UserViewCounts] ADD CONSTRAINT [FK_dbo.VideoLessons_UserViewCounts_dbo.Central_User_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Central_User] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[VideoLessons_UserViewCounts] ADD CONSTRAINT [FK_dbo.VideoLessons_UserViewCounts_dbo.VideoLessons_VideoLessonItem_VideoLessonItemId] FOREIGN KEY ([VideoLessonItemId]) REFERENCES [dbo].[VideoLessons_VideoLessonItem] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[VideoLessons_VideoLessonUserPermission] ADD CONSTRAINT [FK_dbo.VideoLessons_VideoLessonUserPermission_dbo.Central_User_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Central_User] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[VideoLessons_VideoLessonUserPermission] ADD CONSTRAINT [FK_dbo.VideoLessons_VideoLessonUserPermission_dbo.VideoLessons_VideoLesson_VideoLessonId] FOREIGN KEY ([VideoLessonId]) REFERENCES [dbo].[VideoLessons_VideoLesson] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[VideoLessons_VideoLessonItemsBugReports] ADD CONSTRAINT [FK_dbo.VideoLessons_VideoLessonItemsBugReports_dbo.Central_User_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Central_User] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[VideoLessons_VideoLessonItemsBugReports] ADD CONSTRAINT [FK_dbo.VideoLessons_VideoLessonItemsBugReports_dbo.VideoLessons_VideoLessonItem_VideoLessonItemId] FOREIGN KEY ([VideoLessonItemId]) REFERENCES [dbo].[VideoLessons_VideoLessonItem] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[DevApp_Notifications_Notification] ADD CONSTRAINT [FK_dbo.DevApp_Notifications_Notification_dbo.Central_User_Sender_Id] FOREIGN KEY ([Sender_Id]) REFERENCES [dbo].[Central_User] ([Id])
ALTER TABLE [dbo].[DevApp_Notifications_NotificationRecipient] ADD CONSTRAINT [FK_dbo.DevApp_Notifications_NotificationRecipient_dbo.DevApp_Notifications_Notification_NotificationId] FOREIGN KEY ([NotificationId]) REFERENCES [dbo].[DevApp_Notifications_Notification] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[DevApp_Notifications_NotificationRecipient] ADD CONSTRAINT [FK_dbo.DevApp_Notifications_NotificationRecipient_dbo.Central_User_RecipientId] FOREIGN KEY ([RecipientId]) REFERENCES [dbo].[Central_User] ([Id])
ALTER TABLE [dbo].[DevApp_Notifications_NotificationRecipient] ADD CONSTRAINT [FK_dbo.DevApp_Notifications_NotificationRecipient_dbo.Central_Role_RecipientRoleId] FOREIGN KEY ([RecipientRoleId]) REFERENCES [dbo].[Central_Role] ([Id])
ALTER TABLE [dbo].[Central_UserGroupToUser] ADD CONSTRAINT [FK_dbo.Central_UserGroupToUser_dbo.Central_UserGroup_UserGroupId] FOREIGN KEY ([UserGroupId]) REFERENCES [dbo].[Central_UserGroup] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Central_UserGroupToUser] ADD CONSTRAINT [FK_dbo.Central_UserGroupToUser_dbo.Central_User_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[Central_User] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[NewsTagNewsItems] ADD CONSTRAINT [FK_dbo.NewsTagNewsItems_dbo.News_NewsTag_NewsTag_Id] FOREIGN KEY ([NewsTag_Id]) REFERENCES [dbo].[News_NewsTag] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[NewsTagNewsItems] ADD CONSTRAINT [FK_dbo.NewsTagNewsItems_dbo.News_NewsItem_NewsItem_Id] FOREIGN KEY ([NewsItem_Id]) REFERENCES [dbo].[News_NewsItem] ([Id]) ON DELETE CASCADE
ALTER TABLE [dbo].[Central_UserScore] ADD CONSTRAINT [FK_dbo.Central_UserScore_dbo.Central_UserData_Id] FOREIGN KEY ([Id]) REFERENCES [dbo].[Central_UserData] ([Id])
CREATE TABLE [dbo].[__MigrationHistory] (
[MigrationId] [nvarchar](150) NOT NULL,
[ContextKey] [nvarchar](300) NOT NULL,
[Model] [varbinary](max) NOT NULL,
[ProductVersion] [nvarchar](32) NOT NULL,
CONSTRAINT [PK_dbo.__MigrationHistory] PRIMARY KEY ([MigrationId], [ContextKey])
)