IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[mps_warehouse_operation_detail]') AND type = 'U')
CREATE TABLE [dbo].[mps_warehouse_operation_detail]
(
    [whopd_whopid] bigint NOT NULL DEFAULT((0)),
    [whopd_whgid] bigint NOT NULL DEFAULT((0)),
    [whopd_amount] decimal(18, 4) NULL DEFAULT((0)),
    [whopd_fee] decimal(18, 4) NULL DEFAULT((0)),
    [whopd_operation] int NULL DEFAULT((1)),
    [whopd_baseamount] decimal(18, 4) NULL DEFAULT((0)),
    CONSTRAINT [PK_mps_warehouse_operation_detail] PRIMARY KEY ([whopd_whgid] ASC)
    CONSTRAINT [PK_mps_warehouse_operation_detail] PRIMARY KEY ([whopd_whopid] ASC)
)