USE [testUML1]
GO
/****** Object:  Table [dbo].[M_ORDER]    Script Date: 05/16/2013 21:13:57 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[M_ORDER](
	[ID] [bigint] NOT NULL,
	[CODE] [nvarchar](30) NOT NULL,
	[ORDERDATE] [date] NULL,
	[DELIVERYDATE] [date] NULL,
 CONSTRAINT [PK_M_ORDER] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[ORDER_LINE]    Script Date: 05/16/2013 21:13:57 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[ORDER_LINE](
	[ID] [bigint] NOT NULL,
	[ORDER_ID] [bigint] NOT NULL,
	[NUM_LINE] [int] NOT NULL,
	[PRODUCT_CODE] [varchar](30) NOT NULL,
 CONSTRAINT [PK_ORDER_LINE] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Default [DF_M_ORDER_CODE]    Script Date: 05/16/2013 21:13:57 ******/
ALTER TABLE [dbo].[M_ORDER] ADD  CONSTRAINT [DF_M_ORDER_CODE]  DEFAULT ((0)) FOR [CODE]
GO
/****** Object:  Default [DF_ORDER_LINE_PRODUCT_CODE]    Script Date: 05/16/2013 21:13:57 ******/
ALTER TABLE [dbo].[ORDER_LINE] ADD  CONSTRAINT [DF_ORDER_LINE_PRODUCT_CODE]  DEFAULT ('ALPHA') FOR [PRODUCT_CODE]
GO
/****** Object:  ForeignKey [FK_ORDERLINE_MORDER]    Script Date: 05/16/2013 21:13:57 ******/
ALTER TABLE [dbo].[ORDER_LINE]  WITH CHECK ADD  CONSTRAINT [FK_ORDERLINE_MORDER] FOREIGN KEY([ORDER_ID])
REFERENCES [dbo].[M_ORDER] ([ID])
GO
ALTER TABLE [dbo].[ORDER_LINE] CHECK CONSTRAINT [FK_ORDERLINE_MORDER]
GO
