﻿CREATE TABLE [dbo].[mfr__steps] (
    [Id]                  BIGINT         NOT NULL,
    [MobileId]            BIGINT         NULL,
    [Version]             INT            NOT NULL,
    [Name]                NVARCHAR (255) NULL,
    [IsDone]              BIT            NOT NULL,
    [HasError]            BIT            NOT NULL,
    [TrackingId]          NVARCHAR (255) NULL,
    [Type]                NVARCHAR (255) NULL,
    [SortOrder]           INT            NOT NULL,
    [Data]                NVARCHAR (MAX) NULL,
    [DateModifiedOffline] DATETIME       NULL,
    [ServiceRequestId]    BIGINT         NULL,
    [Description]         NVARCHAR (MAX) NULL,
    [Comment]             NVARCHAR (MAX) NULL,
    [InternalComment]     NVARCHAR (MAX) NULL,
    [ServiceObjectId]     BIGINT         NULL,
    [StepListTemplateId]  BIGINT         NULL,
    [ParentId]            BIGINT         NULL,
    CONSTRAINT [PK_mfr__step] PRIMARY KEY CLUSTERED ([Id] ASC)
);


GO
CREATE NONCLUSTERED INDEX [mfr__steps__ix1]
    ON [dbo].[mfr__steps]([ServiceRequestId] ASC)
    INCLUDE([MobileId], [Version], [Name], [IsDone], [HasError], [TrackingId], [Type], [SortOrder], [Data], [DateModifiedOffline], [Description], [Comment], [InternalComment], [ServiceObjectId], [StepListTemplateId], [ParentId]);

