Sie sind auf Seite 1von 17

Ministère de l'éducation de la République de Moldova

Université technique de Moldavie

Faculté d'Informatique et de Microélectronique

Compte Rendu
Travail de laboratoire nr. 2
Thème: Diagramme de classe

Il a fait: st. gr. FI-171


Lupei Nicolae

Il a vérifié: lec. asist., Marin Cazac

Chişinău 2019
Le but du papier: Diagramme de classe

Tâches de travail:
 Identifier les classes pour chaque cas d'utilisation
 Construire le diagramme de classes
 Créez le code SQL pour ces classes
 Création du diagramme relationnel

Le diagramme de classes créé dans Rational Rose:

Liste des classes ordonnées verticalement:


Schéma de relation des tables :

Fragment de base de données plus volumineux


Conclusition :

À la suite des travaux pratiques, j'ai appris à créer des diagrammes de classes pour voir comment les liens
entre les classes et les interfaces sont établis. Nous avons créé du code SQL pour le diagramme de classes,
nous avons créé le diagramme relationnel de la base de données. Nous avons les compétences pour créer une
architecture pour certains projets.

Anexe 1 Fragment du code SQL:

-- Create database [ModifiedBy] nvarchar(max) [ConcurrencyStamp]


CREATE DATABASE NULL, nvarchar(max) NULL,
AMOOA; [Changed] datetime2 NOT [Author] nvarchar(max)
-- Use database NULL, NULL,
USE AMOOA; [IsDeleted] bit NOT NULL, [Created] datetime2 NOT
-- Create Identity schema [Version] int NOT NULL, NULL,
IF [TenantId] uniqueidentifier [ModifiedBy] nvarchar(max)
SCHEMA_ID(N'Identity') IS NULL, NULL,
NULL EXEC(N'CREATE [PermissionName] [Changed] datetime2 NOT
SCHEMA [Identity];'); nvarchar(100) NULL, NULL,
-- Create entity schema [ClientId] int NOT NULL, [IsDeleted] bit NOT NULL,
IF SCHEMA_ID(N'Entities') IS [Description] nvarchar(300) [ClientId] int NOT NULL,
NULL EXEC(N'CREATE NULL, [Title] nvarchar(max) NULL,
SCHEMA [Entities];'); [PermissionKey] [IsNoEditable] bit NOT
-- Create processes schema nvarchar(100) NULL, NULL,
IF CONSTRAINT [Name] nvarchar(256)
SCHEMA_ID(N'Processes') IS [PK_Permissions] PRIMARY NULL,
NULL EXEC(N'CREATE KEY ([Id]) [TenantId] uniqueidentifier
SCHEMA [Processes];'); ); NULL,
CONSTRAINT [PK_Roles]
-- Create Identity tables CREATE TABLE PRIMARY KEY ([Id])
CREATE TABLE [Identity].[Profiles] ( );
[Identity].[AuthGroups] ( [Id] uniqueidentifier NOT
[Id] uniqueidentifier NOT NULL, CREATE TABLE
NULL, [Author] nvarchar(max) [Identity].[Tenants] (
[Author] nvarchar(max) NULL, [Id] uniqueidentifier NOT
NULL, [Created] datetime2 NOT NULL,
[Created] datetime2 NOT NULL, [Author] nvarchar(max)
NULL, [ModifiedBy] nvarchar(max) NULL,
[ModifiedBy] nvarchar(max) NULL, [Created] datetime2 NOT
NULL, [Changed] datetime2 NOT NULL,
[Changed] datetime2 NOT NULL, [ModifiedBy] nvarchar(max)
NULL, [IsDeleted] bit NOT NULL, NULL,
[IsDeleted] bit NOT NULL, [Version] int NOT NULL, [Changed] datetime2 NOT
[Version] int NOT NULL, [TenantId] uniqueidentifier NULL,
[TenantId] uniqueidentifier NULL, [IsDeleted] bit NOT NULL,
NULL, [ProfileName] nvarchar(max) [Name] nvarchar(max) NOT
[Name] nvarchar(max) NOT NULL, NULL,
NULL, [IsSystem] bit NOT NULL, [MachineName]
CONSTRAINT [EntityId] uniqueidentifier nvarchar(max) NOT NULL,
[PK_AuthGroups] PRIMARY NOT NULL, [Description] nvarchar(max)
KEY ([Id]) CONSTRAINT NULL,
); [PK_Profiles] PRIMARY KEY [SiteWeb] nvarchar(max)
([Id]) NULL,
CREATE TABLE ); [Address] nvarchar(max)
[Identity].[Permissions] ( NULL,
[Id] uniqueidentifier NOT CREATE TABLE CONSTRAINT
NULL, [Identity].[Roles] ( [PK_Tenants] PRIMARY KEY
[Author] nvarchar(max) [Id] nvarchar(450) NOT ([Id])
NULL, NULL, );
[Created] datetime2 NOT [NormalizedName]
NULL, nvarchar(256) NULL,
CREATE TABLE [Changed] datetime2 NOT CONSTRAINT
[Identity].[TrackAudits] ( NULL, [PK_RoleClaims] PRIMARY
[Id] uniqueidentifier NOT [Created] datetime2 NOT KEY ([Id]),
NULL, NULL, CONSTRAINT
[Author] nvarchar(max) [IsDeleted] bit NOT NULL, [FK_RoleClaims_Roles_RoleId]
NULL, [IsEditable] bit NOT NULL, FOREIGN KEY ([RoleId])
[Created] datetime2 NOT [ModifiedBy] nvarchar(max) REFERENCES [Identity].[Roles]
NULL, NULL, ([Id]) ON DELETE CASCADE
[ModifiedBy] nvarchar(max) [UserPhoto] varbinary(max) );
NULL, NULL,
[Changed] datetime2 NOT [AuthenticationType] int CREATE TABLE
NULL, NOT NULL, [Identity].[RolePermissions] (
[IsDeleted] bit NOT NULL, [TenantId] uniqueidentifier [Id] uniqueidentifier NOT
[UserName] nvarchar(max) NULL, NULL,
NULL, CONSTRAINT [PK_Users] [Author] nvarchar(max)
[TrackEventType] int NOT PRIMARY KEY ([Id]) NULL,
NULL, ); [Created] datetime2 NOT
[RecordId] uniqueidentifier NULL,
NOT NULL, CREATE TABLE [ModifiedBy] nvarchar(max)
[TypeFullName] [Identity].[GroupPermissions] ( NULL,
nvarchar(max) NULL, [Id] uniqueidentifier NOT [Changed] datetime2 NOT
[Version] int NOT NULL, NULL, NULL,
[TenantId] uniqueidentifier [Author] nvarchar(max) [IsDeleted] bit NOT NULL,
NULL, NULL, [Version] int NOT NULL,
CONSTRAINT [Created] datetime2 NOT [TenantId] uniqueidentifier
[PK_TrackAudits] PRIMARY NULL, NULL,
KEY ([Id]) [ModifiedBy] nvarchar(max) [RoleId] nvarchar(450)
); NULL, NULL,
[Changed] datetime2 NOT [PermissionCode]
CREATE TABLE NULL, nvarchar(max) NOT NULL,
[Identity].[Users] ( [IsDeleted] bit NOT NULL, [PermissionId]
[Id] nvarchar(450) NOT [Version] int NOT NULL, uniqueidentifier NOT NULL,
NULL, [TenantId] uniqueidentifier CONSTRAINT
[UserName] nvarchar(256) NULL, [PK_RolePermissions]
NULL, [GroupId] uniqueidentifier PRIMARY KEY ([Id]),
[NormalizedUserName] NOT NULL, CONSTRAINT
nvarchar(256) NULL, [AuthGroupId] [FK_RolePermissions_Permission
[Email] nvarchar(256) uniqueidentifier NULL, s_PermissionId] FOREIGN KEY
NULL, [PermissionCode] ([PermissionId]) REFERENCES
[NormalizedEmail] nvarchar(max) NOT NULL, [Identity].[Permissions] ([Id]) ON
nvarchar(256) NULL, CONSTRAINT DELETE CASCADE,
[EmailConfirmed] bit NOT [PK_GroupPermissions] CONSTRAINT
NULL, PRIMARY KEY ([Id]), [FK_RolePermissions_Roles_Rol
[PasswordHash] CONSTRAINT eId] FOREIGN KEY ([RoleId])
nvarchar(max) NULL, [FK_GroupPermissions_AuthGro REFERENCES [Identity].[Roles]
[SecurityStamp] ups_AuthGroupId] FOREIGN ([Id]) ON DELETE NO ACTION
nvarchar(max) NULL, KEY ([AuthGroupId]) );
[ConcurrencyStamp] REFERENCES
nvarchar(max) NULL, [Identity].[AuthGroups] ([Id]) ON CREATE TABLE
[PhoneNumber] DELETE NO ACTION [Identity].[RoleProfiles] (
nvarchar(max) NULL, ); [ProfileId] uniqueidentifier
[PhoneNumberConfirmed] NOT NULL,
bit NOT NULL, CREATE TABLE [ApplicationRoleId]
[TwoFactorEnabled] bit NOT [Identity].[RoleClaims] ( nvarchar(450) NOT NULL,
NULL, [Id] int NOT NULL, CONSTRAINT
[LockoutEnd] datetimeoffset [RoleId] nvarchar(450) NOT [PK_RoleProfiles] PRIMARY
NULL, NULL, KEY ([ApplicationRoleId],
[LockoutEnabled] bit NOT [ClaimType] nvarchar(max) [ProfileId]),
NULL, NULL, CONSTRAINT
[AccessFailedCount] int [ClaimValue] nvarchar(max) [FK_RoleProfiles_Roles_Applicat
NOT NULL, NULL, ionRoleId] FOREIGN KEY
[Author] nvarchar(max) ([ApplicationRoleId])
NULL,
REFERENCES [Identity].[Roles] ); [UserId] nvarchar(450) NOT
([Id]) ON DELETE CASCADE, NULL,
CONSTRAINT [RoleId] nvarchar(450) NOT
[FK_RoleProfiles_Profiles_Profile CREATE TABLE NULL,
Id] FOREIGN KEY ([ProfileId]) [Identity].[UserGroups] ( CONSTRAINT
REFERENCES [AuthGroupId] [PK_UserRoles] PRIMARY KEY
[Identity].[Profiles] ([Id]) ON uniqueidentifier NOT NULL, ([UserId], [RoleId]),
DELETE CASCADE [UserId] nvarchar(450) NOT CONSTRAINT
); NULL, [FK_UserRoles_Roles_RoleId]
[Id] uniqueidentifier NOT FOREIGN KEY ([RoleId])
CREATE TABLE NULL, REFERENCES [Identity].[Roles]
[Identity].[TrackAuditDetails] ( [Author] nvarchar(max) ([Id]) ON DELETE CASCADE,
[Id] uniqueidentifier NOT NULL, CONSTRAINT
NULL, [Created] datetime2 NOT [FK_UserRoles_Users_UserId]
[Author] nvarchar(max) NULL, FOREIGN KEY ([UserId])
NULL, [ModifiedBy] nvarchar(max) REFERENCES [Identity].[Users]
[Created] datetime2 NOT NULL, ([Id]) ON DELETE CASCADE
NULL, [Changed] datetime2 NOT );
[ModifiedBy] nvarchar(max) NULL,
NULL, [IsDeleted] bit NOT NULL, CREATE TABLE
[Changed] datetime2 NOT [Version] int NOT NULL, [Identity].[UserTokens] (
NULL, [TenantId] uniqueidentifier [UserId] nvarchar(450) NOT
[IsDeleted] bit NOT NULL, NULL, NULL,
[TrackAuditId] CONSTRAINT [LoginProvider]
uniqueidentifier NOT NULL, [PK_UserGroups] PRIMARY nvarchar(450) NOT NULL,
[PropertyName] KEY ([AuthGroupId], [UserId]), [Name] nvarchar(450) NOT
nvarchar(max) NULL, CONSTRAINT NULL,
[PropertyType] [FK_UserGroups_AuthGroups_A [Value] nvarchar(max)
nvarchar(max) NULL, uthGroupId] FOREIGN KEY NULL,
[Value] nvarchar(max) ([AuthGroupId]) REFERENCES CONSTRAINT
NULL, [Identity].[AuthGroups] ([Id]) ON [PK_UserTokens] PRIMARY
[TenantId] uniqueidentifier DELETE CASCADE, KEY ([UserId], [LoginProvider],
NULL, CONSTRAINT [Name]),
CONSTRAINT [FK_UserGroups_Users_UserId] CONSTRAINT
[PK_TrackAuditDetails] FOREIGN KEY ([UserId]) [FK_UserTokens_Users_UserId]
PRIMARY KEY ([Id]), REFERENCES [Identity].[Users] FOREIGN KEY ([UserId])
CONSTRAINT ([Id]) ON DELETE CASCADE REFERENCES [Identity].[Users]
[FK_TrackAuditDetails_TrackAu ); ([Id]) ON DELETE CASCADE
dits_TrackAuditId] FOREIGN );
KEY ([TrackAuditId]) CREATE TABLE
REFERENCES [Identity].[UserLogins] ( -- Create indexes
[Identity].[TrackAudits] ([Id]) ON [LoginProvider]
DELETE CASCADE nvarchar(450) NOT NULL, CREATE INDEX
); [ProviderKey] nvarchar(450) [IX_AuthGroups_TenantId] ON
NOT NULL, [Identity].[AuthGroups]
[ProviderDisplayName] ([TenantId]);
CREATE TABLE nvarchar(max) NULL, CREATE INDEX
[Identity].[UserClaims] ( [UserId] nvarchar(450) NOT [IX_GroupPermissions_AuthGrou
[Id] int NOT NULL, NULL, pId] ON
[UserId] nvarchar(450) NOT CONSTRAINT [Identity].[GroupPermissions]
NULL, [PK_UserLogins] PRIMARY ([AuthGroupId]);
[ClaimType] nvarchar(max) KEY ([LoginProvider], CREATE INDEX
NULL, [ProviderKey]), [IX_Permissions_TenantId] ON
[ClaimValue] nvarchar(max) CONSTRAINT [Identity].[Permissions]
NULL, [FK_UserLogins_Users_UserId] ([TenantId]);
CONSTRAINT FOREIGN KEY ([UserId]) CREATE INDEX
[PK_UserClaims] PRIMARY REFERENCES [Identity].[Users] [IX_Profiles_TenantId] ON
KEY ([Id]), ([Id]) ON DELETE CASCADE [Identity].[Profiles] ([TenantId]);
CONSTRAINT ); CREATE INDEX
[FK_UserClaims_Users_UserId] [IX_RoleClaims_RoleId] ON
FOREIGN KEY ([UserId]) CREATE TABLE [Identity].[RoleClaims]
REFERENCES [Identity].[Users] [Identity].[UserRoles] ( ([RoleId]);
([Id]) ON DELETE CASCADE
CREATE INDEX [Changed] datetime2 NOT [Order] int NOT NULL,
[IX_RolePermissions_PermissionI NULL, CONSTRAINT
d] ON [IsDeleted] bit NOT NULL, [PK_ColumnFields] PRIMARY
[Identity].[RolePermissions] [Version] int NOT NULL, KEY ([Id])
([PermissionId]); [TenantId] uniqueidentifier );
CREATE INDEX NULL,
[IX_RolePermissions_RoleId] ON [ClassName] nvarchar(max) CREATE TABLE
[Identity].[RolePermissions] NULL, [Entities].[Configs] (
([RoleId]); [Required] bit NOT NULL, [Id] uniqueidentifier NOT
CREATE INDEX [Type] nvarchar(max) NULL,
[IX_RoleProfiles_ProfileId] ON NULL, [Author] nvarchar(max)
[Identity].[RoleProfiles] [Value] nvarchar(max) NULL,
([ProfileId]); NULL, [Created] datetime2 NOT
CREATE UNIQUE INDEX CONSTRAINT [PK_Attrs] NULL,
[RoleNameIndex] ON PRIMARY KEY ([Id]) [ModifiedBy] nvarchar(max)
[Identity].[Roles] ); NULL,
([NormalizedName]); [Changed] datetime2 NOT
CREATE INDEX CREATE TABLE NULL,
[IX_Roles_TenantId] ON [Entities].[BlockCateries] ( [IsDeleted] bit NOT NULL,
[Identity].[Roles] ([TenantId]); [Id] uniqueidentifier NOT [Version] int NOT NULL,
CREATE INDEX NULL, [TenantId] uniqueidentifier
[IX_TrackAuditDetails_TrackAud [Author] nvarchar(max) NULL,
itId] ON NULL, [Fieldset] bit NOT NULL,
[Identity].[TrackAuditDetails] [Created] datetime2 NOT [Legend] nvarchar(max)
([TrackAuditId]); NULL, NULL,
CREATE INDEX [ModifiedBy] nvarchar(max) [InputGroup] bit NOT
[IX_UserClaims_UserId] ON NULL, NULL,
[Identity].[UserClaims] [Changed] datetime2 NOT [Width] nvarchar(max)
([UserId]); NULL, NULL,
CREATE INDEX [IsDeleted] bit NOT NULL, [Label] nvarchar(max)
[IX_UserGroups_UserId] ON [Version] int NOT NULL, NULL,
[Identity].[UserGroups] [TenantId] uniqueidentifier [HideLabel] bit NOT NULL,
([UserId]); NULL, [Editable] bit NOT NULL,
CREATE INDEX [Name] nvarchar(max) CONSTRAINT
[IX_UserLogins_UserId] ON NULL, [PK_Configs] PRIMARY KEY
[Identity].[UserLogins] ([UserId]); [Description] nvarchar(max) ([Id])
CREATE INDEX NULL, );
[IX_UserRoles_RoleId] ON CONSTRAINT
[Identity].[UserRoles] ([RoleId]); [PK_BlockCateries] PRIMARY CREATE TABLE
CREATE INDEX [EmailIndex] KEY ([Id]) [Entities].[EntityTypes] (
ON [Identity].[Users] ); [Id] uniqueidentifier NOT
([NormalizedEmail]); NULL,
CREATE UNIQUE INDEX [Author] nvarchar(max)
[UserNameIndex] ON CREATE TABLE NULL,
[Identity].[Users] [Entities].[ColumnFields] ( [Created] datetime2 NOT
([NormalizedUserName]); [Id] uniqueidentifier NOT NULL,
CREATE INDEX NULL, [ModifiedBy] nvarchar(max)
[IX_Users_TenantId] ON [Author] nvarchar(max) NULL,
[Identity].[Users] ([TenantId]); NULL, [Changed] datetime2 NOT
[Created] datetime2 NOT NULL,
NULL, [IsDeleted] bit NOT NULL,
-- Create entity tables [ModifiedBy] nvarchar(max) [Version] int NOT NULL,
NULL, [TenantId] uniqueidentifier
CREATE TABLE [Changed] datetime2 NOT NULL,
[Entities].[Attrs] ( NULL, [Name] nvarchar(max)
[Id] uniqueidentifier NOT [IsDeleted] bit NOT NULL, NULL,
NULL, [Version] int NOT NULL, [MachineName]
[Author] nvarchar(max) [TenantId] uniqueidentifier nvarchar(max) NULL,
NULL, NULL, [IsSystem] bit NOT NULL,
[Created] datetime2 NOT [ColumnId] uniqueidentifier [Description] nvarchar(max)
NULL, NOT NULL, NULL,
[ModifiedBy] nvarchar(max) [FieldId] uniqueidentifier
NULL, NOT NULL,
CONSTRAINT [Author] nvarchar(max) [Changed] datetime2 NOT
[PK_EntityTypes] PRIMARY NULL, NULL,
KEY ([Id]) [Created] datetime2 NOT [IsDeleted] bit NOT NULL,
); NULL, [Version] int NOT NULL,
[ModifiedBy] nvarchar(max) [TenantId] uniqueidentifier
NULL, NULL,
CREATE TABLE [Changed] datetime2 NOT [RowId] uniqueidentifier
[Entities].[FormTypes] ( NULL, NOT NULL,
[Id] uniqueidentifier NOT [IsDeleted] bit NOT NULL, [ColumnId] uniqueidentifier
NULL, [Version] int NOT NULL, NOT NULL,
[Author] nvarchar(max) [TenantId] uniqueidentifier CONSTRAINT
NULL, NULL, [PK_RowColumns] PRIMARY
[Created] datetime2 NOT [Name] nvarchar(max) KEY ([Id])
NULL, NULL, );
[ModifiedBy] nvarchar(max) [Title] nvarchar(max) NULL,
NULL, [Description] nvarchar(max)
[Changed] datetime2 NOT NULL, CREATE TABLE
NULL, [Icon] nvarchar(max) NULL, [Entities].[Settings] (
[IsDeleted] bit NOT NULL, [PhysicPath] nvarchar(max) [Id] uniqueidentifier NOT
[Version] int NOT NULL, NULL, NULL,
[TenantId] uniqueidentifier CONSTRAINT [Author] nvarchar(max)
NULL, [PK_PageSettings] PRIMARY NULL,
[Name] nvarchar(max) KEY ([Id]) [Created] datetime2 NOT
NULL, ); NULL,
[Description] nvarchar(max) [ModifiedBy] nvarchar(max)
NULL, CREATE TABLE NULL,
[Code] char(4) NULL, [Entities].[PageTypes] ( [Changed] datetime2 NOT
[IsSystem] bit NOT NULL, [Id] uniqueidentifier NOT NULL,
CONSTRAINT NULL, [IsDeleted] bit NOT NULL,
[PK_FormTypes] PRIMARY [Author] nvarchar(max) [Version] int NOT NULL,
KEY ([Id]) NULL, [TenantId] uniqueidentifier
); [Created] datetime2 NOT NULL,
NULL, CONSTRAINT
[ModifiedBy] nvarchar(max) [PK_Settings] PRIMARY KEY
CREATE TABLE NULL, ([Id])
[Entities].[Meta] ( [Changed] datetime2 NOT );
[Id] uniqueidentifier NOT NULL,
NULL, [IsDeleted] bit NOT NULL,
[Author] nvarchar(max) [Version] int NOT NULL,
NULL, [TenantId] uniqueidentifier CREATE TABLE
[Created] datetime2 NOT NULL, [Entities].[StageRows] (
NULL, [Name] nvarchar(max) NOT [Id] uniqueidentifier NOT
[ModifiedBy] nvarchar(max) NULL, NULL,
NULL, [Description] nvarchar(max) [Author] nvarchar(max)
[Changed] datetime2 NOT NULL, NULL,
NULL, [IsSystem] bit NOT NULL, [Created] datetime2 NOT
[IsDeleted] bit NOT NULL, CONSTRAINT NULL,
[Version] int NOT NULL, [PK_PageTypes] PRIMARY KEY [ModifiedBy] nvarchar(max)
[TenantId] uniqueidentifier ([Id]) NULL,
NULL, ); [Changed] datetime2 NOT
[Group] nvarchar(max) NULL,
NULL, [IsDeleted] bit NOT NULL,
[Icon] nvarchar(max) NULL, CREATE TABLE [Version] int NOT NULL,
CONSTRAINT [PK_Meta] [Entities].[RowColumns] ( [TenantId] uniqueidentifier
PRIMARY KEY ([Id]) [Id] uniqueidentifier NOT NULL,
); NULL, [StageId] uniqueidentifier
[Author] nvarchar(max) NOT NULL,
NULL, [RowId] uniqueidentifier
CREATE TABLE [Created] datetime2 NOT NOT NULL,
[Entities].[PageSettings] ( NULL, CONSTRAINT
[Id] uniqueidentifier NOT [ModifiedBy] nvarchar(max) [PK_StageRows] PRIMARY
NULL, NULL, KEY ([Id])
);
[Content] nvarchar(max) igId] FOREIGN KEY
NULL, ([ConfigId]) REFERENCES
CREATE TABLE CONSTRAINT [Entities].[Configs] ([Id]) ON
[Entities].[Table] ( [PK_Templates] PRIMARY KEY DELETE CASCADE
[Id] uniqueidentifier NOT ([Id]) );
NULL, );
[Author] nvarchar(max)
NULL, CREATE TABLE
[Created] datetime2 NOT CREATE TABLE [Entities].[Pages] (
NULL, [Entities].[TrackAudits] ( [Id] uniqueidentifier NOT
[ModifiedBy] nvarchar(max) [Id] uniqueidentifier NOT NULL,
NULL, NULL, [Author] nvarchar(max)
[Changed] datetime2 NOT [Author] nvarchar(max) NULL,
NULL, NULL, [Created] datetime2 NOT
[IsDeleted] bit NOT NULL, [Created] datetime2 NOT NULL,
[Version] int NOT NULL, NULL, [ModifiedBy] nvarchar(max)
[TenantId] uniqueidentifier [ModifiedBy] nvarchar(max) NULL,
NULL, NULL, [Changed] datetime2 NOT
[Name] nvarchar(max) [Changed] datetime2 NOT NULL,
NULL, NULL, [IsDeleted] bit NOT NULL,
[EntityType] nvarchar(max) [IsDeleted] bit NOT NULL, [Version] int NOT NULL,
NULL, [UserName] nvarchar(max) [TenantId] uniqueidentifier
[Description] nvarchar(max) NULL, NULL,
NULL, [TrackEventType] int NOT [PageTypeId]
[IsSystem] bit NOT NULL, NULL, uniqueidentifier NOT NULL,
[IsPartOfDbContext] bit [RecordId] uniqueidentifier [SettingsId] uniqueidentifier
NOT NULL, NOT NULL, NULL,
CONSTRAINT [PK_Table] [TypeFullName] [Path] nvarchar(max) NULL,
PRIMARY KEY ([Id]) nvarchar(max) NULL, [IsSystem] bit NOT NULL,
); [Version] int NOT NULL, [IsLayout] bit NOT NULL,
[TenantId] uniqueidentifier [LayoutId] uniqueidentifier
NULL, NULL,
CONSTRAINT CONSTRAINT [PK_Pages]
CREATE TABLE [PK_TrackAudits] PRIMARY PRIMARY KEY ([Id]),
[Entities].[TableFieldGroups] ( KEY ([Id]) CONSTRAINT
[Id] uniqueidentifier NOT ); [FK_Pages_Pages_LayoutId]
NULL, FOREIGN KEY ([LayoutId])
[GroupName] nvarchar(max) REFERENCES [Entities].[Pages]
NULL, CREATE TABLE ([Id]) ON DELETE NO ACTION,
[Description] nvarchar(max) [Entities].[DisabledAttrs] ( CONSTRAINT
NULL, [Id] uniqueidentifier NOT [FK_Pages_PageTypes_PageType
CONSTRAINT NULL, Id] FOREIGN KEY
[PK_TableFieldGroups] [Author] nvarchar(max) ([PageTypeId]) REFERENCES
PRIMARY KEY ([Id]) NULL, [Entities].[PageTypes] ([Id]) ON
); [Created] datetime2 NOT DELETE CASCADE,
NULL, CONSTRAINT
[ModifiedBy] nvarchar(max) [FK_Pages_PageSettings_Settings
CREATE TABLE NULL, Id] FOREIGN KEY ([SettingsId])
[Entities].[Templates] ( [Changed] datetime2 NOT REFERENCES
[Id] uniqueidentifier NOT NULL, [Entities].[PageSettings] ([Id]) ON
NULL, [IsDeleted] bit NOT NULL, DELETE NO ACTION
[Author] nvarchar(max) [Version] int NOT NULL, );
NULL, [TenantId] uniqueidentifier
[Created] datetime2 NOT NULL,
NULL, [Name] nvarchar(max) CREATE TABLE
[ModifiedBy] nvarchar(max) NULL, [Entities].[Blocks] (
NULL, [ConfigId] uniqueidentifier [Id] uniqueidentifier NOT
[Changed] datetime2 NOT NOT NULL, NULL,
NULL, CONSTRAINT [Author] nvarchar(max)
[IsDeleted] bit NOT NULL, [PK_DisabledAttrs] PRIMARY NULL,
[Version] int NOT NULL, KEY ([Id]), [Created] datetime2 NOT
[TenantId] uniqueidentifier CONSTRAINT NULL,
NULL, [FK_DisabledAttrs_Configs_Conf
[ModifiedBy] nvarchar(max) [SettingsId] uniqueidentifier [Id] uniqueidentifier NOT
NULL, NOT NULL, NULL,
[Changed] datetime2 NOT [RedirectUrl] nvarchar(max) [Name] nvarchar(max)
NULL, NULL, NULL,
[IsDeleted] bit NOT NULL, [PostUrl] nvarchar(max) [DataType] nvarchar(max)
[Version] int NOT NULL, NULL, NULL,
[TenantId] uniqueidentifier CONSTRAINT [PK_Forms] [Code] char(2) NULL,
NULL, PRIMARY KEY ([Id]), [TableFieldGroupsId]
[Name] nvarchar(max) CONSTRAINT uniqueidentifier NOT NULL,
NULL, [FK_Forms_Settings_SettingsId] CONSTRAINT
[Description] nvarchar(max) FOREIGN KEY ([SettingsId]) [PK_TableFieldTypes]
NULL, REFERENCES PRIMARY KEY ([Id]),
[BlockCateryId] [Entities].[Settings] ([Id]) ON CONSTRAINT
uniqueidentifier NOT NULL, DELETE CASCADE, [FK_TableFieldTypes_TableField
[FaIcon] nvarchar(max) CONSTRAINT Groups_TableFieldGroupsId]
NULL, [FK_Forms_Table_TableId] FOREIGN KEY
[HtmlCode] nvarchar(max) FOREIGN KEY ([TableId]) ([TableFieldGroupsId])
NULL, REFERENCES [Entities].[Table] REFERENCES
[CssCode] nvarchar(max) ([Id]) ON DELETE CASCADE, [Entities].[TableFieldGroups]
NULL, CONSTRAINT ([Id]) ON DELETE CASCADE
[TableModelId] [FK_Forms_FormTypes_TypeId] );
uniqueidentifier NULL, FOREIGN KEY ([TypeId])
CONSTRAINT [PK_Blocks] REFERENCES
PRIMARY KEY ([Id]), [Entities].[FormTypes] ([Id]) ON
CONSTRAINT DELETE NO ACTION CREATE TABLE
[FK_Blocks_BlockCateries_Block ); [Entities].[TrackAuditDetails] (
CateryId] FOREIGN KEY [Id] uniqueidentifier NOT
([BlockCateryId]) REFERENCES NULL,
[Entities].[BlockCateries] ([Id]) CREATE TABLE [Author] nvarchar(max)
ON DELETE CASCADE, [Entities].[ViewModels] ( NULL,
CONSTRAINT [Id] uniqueidentifier NOT [Created] datetime2 NOT
[FK_Blocks_Table_TableModelId NULL, NULL,
] FOREIGN KEY [Author] nvarchar(max) [ModifiedBy] nvarchar(max)
([TableModelId]) REFERENCES NULL, NULL,
[Entities].[Table] ([Id]) ON [Created] datetime2 NOT [Changed] datetime2 NOT
DELETE NO ACTION NULL, NULL,
); [ModifiedBy] nvarchar(max) [IsDeleted] bit NOT NULL,
NULL, [TrackAuditId]
[Changed] datetime2 NOT uniqueidentifier NOT NULL,
CREATE TABLE NULL, [PropertyName]
[Entities].[Forms] ( [IsDeleted] bit NOT NULL, nvarchar(max) NULL,
[Id] uniqueidentifier NOT [Version] int NOT NULL, [PropertyType]
NULL, [TenantId] uniqueidentifier nvarchar(max) NULL,
[Author] nvarchar(max) NULL, [Value] nvarchar(max)
NULL, [TableModelId] NULL,
[Created] datetime2 NOT uniqueidentifier NOT NULL, [TenantId] uniqueidentifier
NULL, [Name] nvarchar(max) NULL,
[ModifiedBy] nvarchar(max) NULL, CONSTRAINT
NULL, CONSTRAINT [PK_TrackAuditDetails]
[Changed] datetime2 NOT [PK_ViewModels] PRIMARY PRIMARY KEY ([Id]),
NULL, KEY ([Id]), CONSTRAINT
[IsDeleted] bit NOT NULL, CONSTRAINT [FK_TrackAuditDetails_TrackAu
[Version] int NOT NULL, [FK_ViewModels_Table_TableM dits_TrackAuditId] FOREIGN
[TenantId] uniqueidentifier odelId] FOREIGN KEY KEY ([TrackAuditId])
NULL, ([TableModelId]) REFERENCES REFERENCES
[Name] nvarchar(max) [Entities].[Table] ([Id]) ON [Entities].[TrackAudits] ([Id]) ON
NULL, DELETE CASCADE DELETE CASCADE
[Description] nvarchar(max) ); );
NULL,
[TableId] uniqueidentifier
NOT NULL, CREATE TABLE
[TypeId] uniqueidentifier CREATE TABLE [Entities].[PageScripts] (
NOT NULL, [Entities].[TableFieldTypes] (
[Id] uniqueidentifier NOT CREATE TABLE CONSTRAINT
NULL, [Entities].[BlockAttributes] ( [FK_Stages_Settings_SettingsId]
[Author] nvarchar(max) [Id] uniqueidentifier NOT FOREIGN KEY ([SettingsId])
NULL, NULL, REFERENCES
[Created] datetime2 NOT [Author] nvarchar(max) [Entities].[Settings] ([Id]) ON
NULL, NULL, DELETE NO ACTION
[ModifiedBy] nvarchar(max) [Created] datetime2 NOT );
NULL, NULL,
[Changed] datetime2 NOT [ModifiedBy] nvarchar(max)
NULL, NULL, CREATE TABLE
[IsDeleted] bit NOT NULL, [Changed] datetime2 NOT [Entities].[TableFieldConfigs] (
[Version] int NOT NULL, NULL, [Id] uniqueidentifier NOT
[TenantId] uniqueidentifier [IsDeleted] bit NOT NULL, NULL,
NULL, [Version] int NOT NULL, [Name] nvarchar(max)
[PageId] uniqueidentifier [TenantId] uniqueidentifier NULL,
NOT NULL, NULL, [Description] nvarchar(max)
[Script] nvarchar(max) [Name] nvarchar(max) NULL,
NULL, NULL, [Type] nvarchar(max)
[Order] int NOT NULL, [Value] nvarchar(max) NULL,
CONSTRAINT NULL, [Code] char(4) NULL,
[PK_PageScripts] PRIMARY [DefaultValue] [TableFieldTypeId]
KEY ([Id]), nvarchar(max) NULL, uniqueidentifier NOT NULL,
CONSTRAINT [BlockId] uniqueidentifier CONSTRAINT
[FK_PageScripts_Pages_PageId] NOT NULL, [PK_TableFieldConfigs]
FOREIGN KEY ([PageId]) CONSTRAINT PRIMARY KEY ([Id]),
REFERENCES [Entities].[Pages] [PK_BlockAttributes] PRIMARY CONSTRAINT
([Id]) ON DELETE CASCADE KEY ([Id]), [FK_TableFieldConfigs_TableFiel
); CONSTRAINT dTypes_TableFieldTypeId]
[FK_BlockAttributes_Blocks_Blo FOREIGN KEY
ckId] FOREIGN KEY ([BlockId]) ([TableFieldTypeId])
CREATE TABLE REFERENCES [Entities].[Blocks] REFERENCES
[Entities].[PageStyles] ( ([Id]) ON DELETE CASCADE [Entities].[TableFieldTypes] ([Id])
[Id] uniqueidentifier NOT ); ON DELETE CASCADE
NULL, );
[Author] nvarchar(max)
NULL, CREATE TABLE
[Created] datetime2 NOT [Entities].[Stages] ( CREATE TABLE
NULL, [Id] uniqueidentifier NOT [Entities].[TableFields] (
[ModifiedBy] nvarchar(max) NULL, [Id] uniqueidentifier NOT
NULL, [Author] nvarchar(max) NULL,
[Changed] datetime2 NOT NULL, [Author] nvarchar(max)
NULL, [Created] datetime2 NOT NULL,
[IsDeleted] bit NOT NULL, NULL, [Created] datetime2 NOT
[Version] int NOT NULL, [ModifiedBy] nvarchar(max) NULL,
[TenantId] uniqueidentifier NULL, [ModifiedBy] nvarchar(max)
NULL, [Changed] datetime2 NOT NULL,
[PageId] uniqueidentifier NULL, [Changed] datetime2 NOT
NOT NULL, [IsDeleted] bit NOT NULL, NULL,
[Script] nvarchar(max) [Version] int NOT NULL, [IsDeleted] bit NOT NULL,
NULL, [TenantId] uniqueidentifier [Version] int NOT NULL,
[Order] int NOT NULL, NULL, [TenantId] uniqueidentifier
CONSTRAINT [SettingsId] uniqueidentifier NULL,
[PK_PageStyles] PRIMARY KEY NULL, [AllowNull] bit NOT NULL,
([Id]), [FormId] uniqueidentifier [DataType] nvarchar(max)
CONSTRAINT NOT NULL, NULL,
[FK_PageStyles_Pages_PageId] CONSTRAINT [PK_Stages] [Description] nvarchar(max)
FOREIGN KEY ([PageId]) PRIMARY KEY ([Id]), NULL,
REFERENCES [Entities].[Pages] CONSTRAINT [Name] nvarchar(max)
([Id]) ON DELETE CASCADE [FK_Stages_Forms_FormId] NULL,
); FOREIGN KEY ([FormId]) [DisplayName]
REFERENCES [Entities].[Forms] nvarchar(max) NULL,
([Id]) ON DELETE CASCADE, [Synchronized] bit NOT
NULL,
[IsSystem] bit NOT NULL, REFERENCES [Entities].[Forms] [TableModelFieldsId]
[TableId] uniqueidentifier ([Id]) ON DELETE CASCADE, uniqueidentifier NULL,
NOT NULL, CONSTRAINT [Translate] nvarchar(max)
[TableFieldTypeId] [FK_Rows_Stages_StageId] NULL,
uniqueidentifier NOT NULL, FOREIGN KEY ([StageId]) [Template] nvarchar(max)
CONSTRAINT REFERENCES [Entities].[Stages] NULL,
[PK_TableFields] PRIMARY ([Id]) ON DELETE NO ACTION [Order] int NOT NULL,
KEY ([Id]), ); CONSTRAINT
CONSTRAINT [PK_ViewModelFields]
[FK_TableFields_TableFieldType PRIMARY KEY ([Id]),
s_TableFieldTypeId] FOREIGN CREATE TABLE CONSTRAINT
KEY ([TableFieldTypeId]) [Entities].[TableFieldConfigValue [FK_ViewModelFields_TableFiel
REFERENCES s] ( ds_TableModelFieldsId]
[Entities].[TableFieldTypes] ([Id]) [TableModelFieldId] FOREIGN KEY
ON DELETE NO ACTION, uniqueidentifier NOT NULL, ([TableModelFieldsId])
CONSTRAINT [TableFieldConfigId] REFERENCES
[FK_TableFields_Table_TableId] uniqueidentifier NOT NULL, [Entities].[TableFields] ([Id]) ON
FOREIGN KEY ([TableId]) [Value] nvarchar(max) DELETE NO ACTION,
REFERENCES [Entities].[Table] NULL, CONSTRAINT
([Id]) ON DELETE CASCADE CONSTRAINT [FK_ViewModelFields_ViewMod
); [PK_TableFieldConfigValues] els_ViewModelId] FOREIGN
PRIMARY KEY KEY ([ViewModelId])
([TableModelFieldId], REFERENCES
CREATE TABLE [TableFieldConfigId]), [Entities].[ViewModels] ([Id]) ON
[Entities].[Rows] ( CONSTRAINT DELETE CASCADE
[Id] uniqueidentifier NOT [FK_TableFieldConfigValues_Ta );
NULL, bleFieldConfigs_TableFieldConfi
[Author] nvarchar(max) gId] FOREIGN KEY
NULL, ([TableFieldConfigId]) CREATE TABLE
[Created] datetime2 NOT REFERENCES [Entities].[Columns] (
NULL, [Entities].[TableFieldConfigs] [Id] uniqueidentifier NOT
[ModifiedBy] nvarchar(max) ([Id]) ON DELETE CASCADE, NULL,
NULL, CONSTRAINT [Author] nvarchar(max)
[Changed] datetime2 NOT [FK_TableFieldConfigValues_Ta NULL,
NULL, bleFields_TableModelFieldId] [Created] datetime2 NOT
[IsDeleted] bit NOT NULL, FOREIGN KEY NULL,
[Version] int NOT NULL, ([TableModelFieldId]) [ModifiedBy] nvarchar(max)
[TenantId] uniqueidentifier REFERENCES NULL,
NULL, [Entities].[TableFields] ([Id]) ON [Changed] datetime2 NOT
[ConfigId] uniqueidentifier DELETE CASCADE NULL,
NOT NULL, ); [IsDeleted] bit NOT NULL,
[AttrsId] uniqueidentifier [Version] int NOT NULL,
NOT NULL, [TenantId] uniqueidentifier
[FormId] uniqueidentifier CREATE TABLE NULL,
NOT NULL, [Entities].[ViewModelFields] ( [ConfigId] uniqueidentifier
[StageId] uniqueidentifier [Id] uniqueidentifier NOT NOT NULL,
NULL, NULL, [ClassName] nvarchar(max)
CONSTRAINT [PK_Rows] [Author] nvarchar(max) NULL,
PRIMARY KEY ([Id]), NULL, [FormId] uniqueidentifier
CONSTRAINT [Created] datetime2 NOT NOT NULL,
[FK_Rows_Attrs_AttrsId] NULL, [RowId] uniqueidentifier
FOREIGN KEY ([AttrsId]) [ModifiedBy] nvarchar(max) NULL,
REFERENCES [Entities].[Attrs] NULL, CONSTRAINT
([Id]) ON DELETE CASCADE, [Changed] datetime2 NOT [PK_Columns] PRIMARY KEY
CONSTRAINT NULL, ([Id]),
[FK_Rows_Configs_ConfigId] [IsDeleted] bit NOT NULL, CONSTRAINT
FOREIGN KEY ([ConfigId]) [Version] int NOT NULL, [FK_Columns_Configs_ConfigId]
REFERENCES [TenantId] uniqueidentifier FOREIGN KEY ([ConfigId])
[Entities].[Configs] ([Id]) ON NULL, REFERENCES
DELETE CASCADE, [Name] nvarchar(max) [Entities].[Configs] ([Id]) ON
CONSTRAINT NULL, DELETE CASCADE,
[FK_Rows_Forms_FormId] [ViewModelId] CONSTRAINT
FOREIGN KEY ([FormId]) uniqueidentifier NOT NULL, [FK_Columns_Forms_FormId]
FOREIGN KEY ([FormId]) CONSTRAINT CREATE INDEX
REFERENCES [Entities].[Forms] [FK_Fields_Forms_FormId] [IX_BlockAttributes_BlockId]
([Id]) ON DELETE CASCADE, FOREIGN KEY ([FormId]) ON [Entities].[BlockAttributes]
CONSTRAINT REFERENCES [Entities].[Forms] ([BlockId]);
[FK_Columns_Rows_RowId] ([Id]) ON DELETE CASCADE, CREATE INDEX
FOREIGN KEY ([RowId]) CONSTRAINT [IX_BlockCateries_TenantId] ON
REFERENCES [Entities].[Rows] [FK_Fields_Meta_MetaId] [Entities].[BlockCateries]
([Id]) ON DELETE NO ACTION FOREIGN KEY ([MetaId]) ([TenantId]);
); REFERENCES [Entities].[Meta] CREATE INDEX
([Id]) ON DELETE CASCADE, [IX_Blocks_BlockCateryId] ON
CREATE TABLE CONSTRAINT [Entities].[Blocks]
[Entities].[Fields] ( [FK_Fields_TableFields_TableFie ([BlockCateryId]);
[Id] uniqueidentifier NOT ldId] FOREIGN KEY CREATE INDEX
NULL, ([TableFieldId]) REFERENCES [IX_Blocks_TableModelId] ON
[Author] nvarchar(max) [Entities].[TableFields] ([Id]) ON [Entities].[Blocks]
NULL, DELETE NO ACTION ([TableModelId]);
[Created] datetime2 NOT ); CREATE INDEX
NULL, [IX_Blocks_TenantId] ON
[ModifiedBy] nvarchar(max) [Entities].[Blocks] ([TenantId]);
NULL, CREATE TABLE CREATE INDEX
[Changed] datetime2 NOT [Entities].[Options] ( [IX_Columns_ConfigId] ON
NULL, [Id] uniqueidentifier NOT [Entities].[Columns] ([ConfigId]);
[IsDeleted] bit NOT NULL, NULL, CREATE INDEX
[Version] int NOT NULL, [Author] nvarchar(max) [IX_Columns_FormId] ON
[TenantId] uniqueidentifier NULL, [Entities].[Columns] ([FormId]);
NULL, [Created] datetime2 NOT CREATE INDEX
[Tag] nvarchar(max) NULL, NULL, [IX_Columns_RowId] ON
[AttrsId] uniqueidentifier [ModifiedBy] nvarchar(max) [Entities].[Columns] ([RowId]);
NOT NULL, NULL, CREATE INDEX
[ConfigId] uniqueidentifier [Changed] datetime2 NOT [IX_DisabledAttrs_ConfigId] ON
NOT NULL, NULL, [Entities].[DisabledAttrs]
[FMap] nvarchar(max) [IsDeleted] bit NOT NULL, ([ConfigId]);
NULL, [Version] int NOT NULL, CREATE INDEX
[Content] nvarchar(max) [TenantId] uniqueidentifier [IX_EntityTypes_TenantId] ON
NULL, NULL, [Entities].[EntityTypes]
[MetaId] uniqueidentifier [Label] nvarchar(max) ([TenantId]);
NOT NULL, NULL, CREATE INDEX
[FormId] uniqueidentifier [Value] nvarchar(max) [IX_Fields_AttrsId] ON
NOT NULL, NULL, [Entities].[Fields] ([AttrsId]);
[Order] int NOT NULL, [Selected] bit NOT NULL, CREATE INDEX
[TableFieldId] [FieldId] uniqueidentifier [IX_Fields_ColumnId] ON
uniqueidentifier NULL, NOT NULL, [Entities].[Fields] ([ColumnId]);
[ColumnId] uniqueidentifier [TypeValue] nvarchar(max) CREATE INDEX
NULL, NULL, [IX_Fields_ConfigId] ON
CONSTRAINT [PK_Fields] [TypeLabel] nvarchar(max) [Entities].[Fields] ([ConfigId]);
PRIMARY KEY ([Id]), NULL, CREATE INDEX
CONSTRAINT [ClassName] nvarchar(max) [IX_Fields_FormId] ON
[FK_Fields_Attrs_AttrsId] NULL, [Entities].[Fields] ([FormId]);
FOREIGN KEY ([AttrsId]) CONSTRAINT CREATE INDEX
REFERENCES [Entities].[Attrs] [PK_Options] PRIMARY KEY [IX_Fields_MetaId] ON
([Id]) ON DELETE CASCADE, ([Id]), [Entities].[Fields] ([MetaId]);
CONSTRAINT CONSTRAINT CREATE INDEX
[FK_Fields_Columns_ColumnId] [FK_Options_Fields_FieldId] [IX_Fields_TableFieldId] ON
FOREIGN KEY ([ColumnId]) FOREIGN KEY ([FieldId]) [Entities].[Fields]
REFERENCES REFERENCES [Entities].[Fields] ([TableFieldId]);
[Entities].[Columns] ([Id]) ON ([Id]) ON DELETE CASCADE CREATE INDEX
DELETE NO ACTION, ); [IX_Forms_SettingsId] ON
CONSTRAINT [Entities].[Forms] ([SettingsId]);
[FK_Fields_Configs_ConfigId] CREATE INDEX
FOREIGN KEY ([ConfigId]) -- Create entity indexes [IX_Forms_TableId] ON
REFERENCES [Entities].[Forms] ([TableId]);
[Entities].[Configs] ([Id]) ON
DELETE CASCADE,
CREATE INDEX CREATE INDEX [Synchronized] bit NOT
[IX_Forms_TenantId] ON [IX_TableFields_TableId] ON NULL,
[Entities].[Forms] ([TenantId]); [Entities].[TableFields] [Title] nvarchar(max) NOT
CREATE INDEX ([TableId]); NULL,
[IX_Forms_TypeId] ON CREATE INDEX [Version] int NOT NULL,
[Entities].[Forms] ([TypeId]); [IX_TableFields_TenantId] ON [InitialSchemaId]
CREATE INDEX [Entities].[TableFields] uniqueidentifier NULL,
[IX_Options_FieldId] ON ([TenantId]); CONSTRAINT
[Entities].[Options] ([FieldId]); CREATE INDEX [PK_ProcessSchemas] PRIMARY
CREATE INDEX [IX_TableFieldTypes_TableField KEY ([Id]),
[IX_Pages_LayoutId] ON GroupsId] ON CONSTRAINT
[Entities].[Pages] ([LayoutId]); [Entities].[TableFieldTypes] [FK_ProcessSchemas_ProcessSch
CREATE INDEX ([TableFieldGroupsId]); emas_InitialSchemaId] FOREIGN
[IX_Pages_PageTypeId] ON CREATE INDEX KEY ([InitialSchemaId])
[Entities].[Pages] ([PageTypeId]); [IX_TrackAuditDetails_TrackAud REFERENCES
CREATE INDEX itId] ON [Processes].[ProcessSchemas]
[IX_Pages_SettingsId] ON [Entities].[TrackAuditDetails] ([Id]) ON DELETE NO ACTION
[Entities].[Pages] ([SettingsId]); ([TrackAuditId]); );
CREATE INDEX CREATE INDEX
[IX_Pages_TenantId] ON [IX_ViewModelFields_TableMod
[Entities].[Pages] ([TenantId]); elFieldsId] ON CREATE TABLE
CREATE INDEX [Entities].[ViewModelFields] [Processes].[TrackAudits] (
[IX_PageScripts_PageId] ON ([TableModelFieldsId]); [Id] uniqueidentifier NOT
[Entities].[PageScripts] CREATE INDEX NULL,
([PageId]); [IX_ViewModelFields_TenantId] [Author] nvarchar(max)
CREATE INDEX ON [Entities].[ViewModelFields] NULL,
[IX_PageStyles_PageId] ON ([TenantId]); [Created] datetime2 NOT
[Entities].[PageStyles] ([PageId]); CREATE INDEX NULL,
CREATE INDEX [IX_ViewModelFields_ViewMod [ModifiedBy] nvarchar(max)
[IX_Rows_AttrsId] ON elId] ON NULL,
[Entities].[Rows] ([AttrsId]); [Entities].[ViewModelFields] [Changed] datetime2 NOT
CREATE INDEX ([ViewModelId]); NULL,
[IX_Rows_ConfigId] ON CREATE INDEX [IsDeleted] bit NOT NULL,
[Entities].[Rows] ([ConfigId]); [IX_ViewModels_TableModelId] [UserName] nvarchar(max)
CREATE INDEX ON [Entities].[ViewModels] NULL,
[IX_Rows_FormId] ON ([TableModelId]); [TrackEventType] int NOT
[Entities].[Rows] ([FormId]); CREATE INDEX NULL,
CREATE INDEX [IX_ViewModels_TenantId] ON [RecordId] uniqueidentifier
[IX_Rows_StageId] ON [Entities].[ViewModels] NOT NULL,
[Entities].[Rows] ([StageId]); ([TenantId]); [TypeFullName]
CREATE INDEX nvarchar(max) NULL,
[IX_Stages_FormId] ON [Version] int NOT NULL,
[Entities].[Stages] ([FormId]); -- Create Processes tables [TenantId] uniqueidentifier
CREATE INDEX NULL,
[IX_Stages_SettingsId] ON CREATE TABLE CONSTRAINT
[Entities].[Stages] ([SettingsId]); [Processes].[ProcessSchemas] ( [PK_TrackAudits] PRIMARY
CREATE INDEX [Id] uniqueidentifier NOT KEY ([Id])
[IX_Table_TenantId] ON NULL, );
[Entities].[Table] ([TenantId]); [Author] nvarchar(max)
CREATE INDEX NULL, CREATE TABLE
[IX_TableFieldConfigs_TableFiel [Created] datetime2 NOT [Processes].[Processes] (
dTypeId] ON NULL, [Id] uniqueidentifier NOT
[Entities].[TableFieldConfigs] [ModifiedBy] nvarchar(max) NULL,
([TableFieldTypeId]); NULL, [Author] nvarchar(max)
CREATE INDEX [Changed] datetime2 NOT NULL,
[IX_TableFieldConfigValues_Tab NULL, [Created] datetime2 NOT
leFieldConfigId] ON [IsDeleted] bit NOT NULL, NULL,
[Entities].[TableFieldConfigValue [TenantId] uniqueidentifier [ModifiedBy] nvarchar(max)
s] ([TableFieldConfigId]); NULL, NULL,
CREATE INDEX [Diagram] nvarchar(max) [Changed] datetime2 NOT
[IX_TableFields_TableFieldTypeI NOT NULL, NULL,
d] ON [Entities].[TableFields] [Description] nvarchar(50) [IsDeleted] bit NOT NULL,
([TableFieldTypeId]); NULL,
[TenantId] uniqueidentifier [Processes].[TrackAudits] ([Id]) CONSTRAINT
NULL, ON DELETE CASCADE [PK_ProcessTransitions]
[Name] nvarchar(max) NOT ); PRIMARY KEY ([Id]),
NULL, CONSTRAINT
[ProcessSchemaId] CREATE TABLE [FK_ProcessTransitions_Processe
uniqueidentifier NOT NULL, [Processes].[ProcessInstances] ( s_ProcessId] FOREIGN KEY
[Version] int NOT NULL, [Id] uniqueidentifier NOT ([ProcessId]) REFERENCES
[IntitialProcessId] NULL, [Processes].[Processes] ([Id]) ON
uniqueidentifier NULL, [Author] nvarchar(max) DELETE CASCADE
[ProcessSettings] NULL, );
nvarchar(max) NULL, [Created] datetime2 NOT
CONSTRAINT NULL,
[PK_Processes] PRIMARY KEY [ModifiedBy] nvarchar(max) CREATE TABLE
([Id]), NULL, [Processes].[IncomingTransitions]
CONSTRAINT [Changed] datetime2 NOT (
[FK_Processes_Processes_Intitial NULL, [ProcessTransitionId]
ProcessId] FOREIGN KEY [IsDeleted] bit NOT NULL, uniqueidentifier NOT NULL,
([IntitialProcessId]) [Version] int NOT NULL, [IncomingTransitionId]
REFERENCES [TenantId] uniqueidentifier uniqueidentifier NOT NULL,
[Processes].[Processes] ([Id]) ON NULL, CONSTRAINT
DELETE NO ACTION, [StartedBy] uniqueidentifier [PK_IncomingTransitions]
CONSTRAINT NOT NULL, PRIMARY KEY
[FK_Processes_ProcessSchemas_ [ProcessId] uniqueidentifier ([ProcessTransitionId],
ProcessSchemaId] FOREIGN NOT NULL, [IncomingTransitionId]),
KEY ([ProcessSchemaId]) [InstanceState] int NOT CONSTRAINT
REFERENCES NULL, [FK_IncomingTransitions_Proces
[Processes].[ProcessSchemas] [Progress] float NOT NULL, sTransitions_IncomingTransitionI
([Id]) ON DELETE CASCADE CONSTRAINT d] FOREIGN KEY
); [PK_ProcessInstances] ([IncomingTransitionId])
PRIMARY KEY ([Id]), REFERENCES
CONSTRAINT [Processes].[ProcessTransitions]
CREATE TABLE [FK_ProcessInstances_Processes_ ([Id]) ON DELETE CASCADE
[Processes].[TrackAuditDetails] ( ProcessId] FOREIGN KEY );
[Id] uniqueidentifier NOT ([ProcessId]) REFERENCES
NULL, [Processes].[Processes] ([Id]) ON
[Author] nvarchar(max) DELETE CASCADE CREATE TABLE
NULL, ); [Processes].[OutGoingTransitions
[Created] datetime2 NOT ](
NULL, CREATE TABLE [ProcessTransitionId]
[ModifiedBy] nvarchar(max) [Processes].[ProcessTransitions] ( uniqueidentifier NOT NULL,
NULL, [Id] uniqueidentifier NOT [OutgoingTransitionId]
[Changed] datetime2 NOT NULL, uniqueidentifier NOT NULL,
NULL, [Author] nvarchar(max) CONSTRAINT
[IsDeleted] bit NOT NULL, NULL, [PK_OutGoingTransitions]
[TrackAuditId] [Created] datetime2 NOT PRIMARY KEY
uniqueidentifier NOT NULL, NULL, ([ProcessTransitionId],
[PropertyName] [ModifiedBy] nvarchar(max) [OutgoingTransitionId]),
nvarchar(max) NULL, NULL, CONSTRAINT
[PropertyType] [Changed] datetime2 NOT [FK_OutGoingTransitions_Proces
nvarchar(max) NULL, NULL, sTransitions_OutgoingTransitionI
[Value] nvarchar(max) [IsDeleted] bit NOT NULL, d] FOREIGN KEY
NULL, [Version] int NOT NULL, ([OutgoingTransitionId])
[TenantId] uniqueidentifier [TenantId] uniqueidentifier REFERENCES
NULL, NULL, [Processes].[ProcessTransitions]
CONSTRAINT [Name] nvarchar(max) NOT ([Id]) ON DELETE CASCADE
[PK_TrackAuditDetails] NULL, );
PRIMARY KEY ([Id]), [TransitionType] int NOT
CONSTRAINT NULL,
[FK_TrackAuditDetails_TrackAu [ProcessId] uniqueidentifier CREATE TABLE
dits_TrackAuditId] FOREIGN NOT NULL, [Processes].[ProcessInstanceHisto
KEY ([TrackAuditId]) [TransitionSettings] ries] (
REFERENCES nvarchar(max) NULL, [ProcessInstanceId]
uniqueidentifier NOT NULL,
[ProcessTransitionId] [Processes].[ProcessTransitions] CONSTRAINT
uniqueidentifier NOT NULL, ([Id]) ON DELETE CASCADE [PK_UserProcessTasks]
[TransitionState] int NOT ); PRIMARY KEY ([Id]),
NULL, CONSTRAINT
CONSTRAINT [FK_UserProcessTasks_ProcessT
[PK_ProcessInstanceHistories] CREATE TABLE asks_ProcessTaskId] FOREIGN
PRIMARY KEY [Processes].[TransitionActors] ( KEY ([ProcessTaskId])
([ProcessTransitionId], [Id] uniqueidentifier NOT REFERENCES
[ProcessInstanceId]), NULL, [Processes].[ProcessTasks] ([Id])
CONSTRAINT [Author] nvarchar(max) ON DELETE CASCADE
[FK_ProcessInstanceHistories_Pr NULL, );
ocessInstances_ProcessInstanceId] [Created] datetime2 NOT
FOREIGN KEY NULL,
([ProcessInstanceId]) [ModifiedBy] nvarchar(max) -- Create indexes for
REFERENCES NULL, processes
[Processes].[ProcessInstances] [Changed] datetime2 NOT
([Id]) ON DELETE NO ACTION, NULL,
CONSTRAINT [IsDeleted] bit NOT NULL, CREATE INDEX
[FK_ProcessInstanceHistories_Pr [Version] int NOT NULL, [IX_IncomingTransitions_Incomi
ocessTransitions_ProcessTransitio [TenantId] uniqueidentifier ngTransitionId] ON
nId] FOREIGN KEY NULL, [Processes].[IncomingTransitions]
([ProcessTransitionId]) [Name] nvarchar(max) NOT ([IncomingTransitionId]);
REFERENCES NULL, CREATE INDEX
[Processes].[ProcessTransitions] [RoleId] uniqueidentifier [IX_OutGoingTransitions_Outgoi
([Id]) ON DELETE NO ACTION NOT NULL, ngTransitionId] ON
); [ProcessTransitionId] [Processes].[OutGoingTransitions
uniqueidentifier NOT NULL, ] ([OutgoingTransitionId]);
CREATE TABLE [ActorSettings] CREATE INDEX
[Processes].[ProcessTasks] ( nvarchar(max) NULL, [IX_Processes_IntitialProcessId]
[Id] uniqueidentifier NOT CONSTRAINT ON [Processes].[Processes]
NULL, [PK_TransitionActors] ([IntitialProcessId]);
[Author] nvarchar(max) PRIMARY KEY ([Id]), CREATE INDEX
NULL, CONSTRAINT [IX_Processes_ProcessSchemaId]
[Created] datetime2 NOT [FK_TransitionActors_ProcessTra ON [Processes].[Processes]
NULL, nsitions_ProcessTransitionId] ([ProcessSchemaId]);
[ModifiedBy] nvarchar(max) FOREIGN KEY CREATE INDEX
NULL, ([ProcessTransitionId]) [IX_ProcessInstanceHistories_Pro
[Changed] datetime2 NOT REFERENCES cessInstanceId] ON
NULL, [Processes].[ProcessTransitions] [Processes].[ProcessInstanceHisto
[IsDeleted] bit NOT NULL, ([Id]) ON DELETE CASCADE ries] ([ProcessInstanceId]);
[Version] int NOT NULL, ); CREATE INDEX
[TenantId] uniqueidentifier [IX_ProcessInstances_ProcessId]
NULL, ON [Processes].[ProcessInstances]
[Name] nvarchar(max) NOT CREATE TABLE ([ProcessId]);
NULL, [Processes].[UserProcessTasks] ( CREATE INDEX
[Description] nvarchar(max) [Id] uniqueidentifier NOT [IX_ProcessSchemas_InitialSche
NULL, NULL, maId] ON
[ProcessTaskState] int NOT [Author] nvarchar(max) [Processes].[ProcessSchemas]
NULL, NULL, ([InitialSchemaId]);
[Life] int NOT NULL, [Created] datetime2 NOT CREATE INDEX
[Assigned] uniqueidentifier NULL, [IX_ProcessTasks_ProcessTransiti
NULL, [ModifiedBy] nvarchar(max) onId] ON
[ProcessTransitionId] NULL, [Processes].[ProcessTasks]
uniqueidentifier NOT NULL, [Changed] datetime2 NOT ([ProcessTransitionId]);
CONSTRAINT NULL, CREATE INDEX
[PK_ProcessTasks] PRIMARY [IsDeleted] bit NOT NULL, [IX_ProcessTransitions_ProcessId
KEY ([Id]), [Version] int NOT NULL, ] ON
CONSTRAINT [TenantId] uniqueidentifier [Processes].[ProcessTransitions]
[FK_ProcessTasks_ProcessTransit NULL, ([ProcessId]);
ions_ProcessTransitionId] [ProcessTaskId] CREATE INDEX
FOREIGN KEY uniqueidentifier NOT NULL, [IX_TrackAuditDetails_TrackAud
([ProcessTransitionId]) [UserId] uniqueidentifier itId] ON
REFERENCES NOT NULL,
[Processes].[TrackAuditDetails] [Processes].[TransitionActors] [Processes].[UserProcessTasks]
([TrackAuditId]); ([ProcessTransitionId]); ([ProcessTaskId]);
CREATE INDEX CREATE INDEX
[IX_TransitionActors_ProcessTra [IX_UserProcessTasks_ProcessTa
nsitionId] ON skId] ON

SELECT
f.Name AS [Form Name]
,f.Description
,t.Name AS [TABLE NAME]
,ft.Name AS FormType
,RedirectUrl
,PostUrl
,(SELECT COUNT(*) FROM Entities.Fields AS ff WHERE ff.FormId = f.Id) AS Fields
FROM Entities.Forms AS f, Entities.FormTypes AS ft, Entities.[Table] AS t
WHERE f.TypeId = ft.Id
AND f.TableId = t.Id
AND t.Name = 'Chandler1991';