forked from shalithasuranga/Ebuy-Network
-
Notifications
You must be signed in to change notification settings - Fork 0
/
EbuyNetwork.sql
116 lines (111 loc) · 6.27 KB
/
EbuyNetwork.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
USE [ebuynetwork]
GO
/****** Object: Table [dbo].[Category] Script Date: 10/15/2017 3:14:27 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Category](
[id] [int] IDENTITY(1,1) NOT NULL,
[name] [varchar](200) NULL,
[item_count] [int] NULL,
CONSTRAINT [PK_Category] 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: Table [dbo].[Item] Script Date: 10/15/2017 3:14:27 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Item](
[id] [int] IDENTITY(1,1) NOT NULL,
[category_id] [int] NULL,
[user_id] [int] NULL,
[name] [varchar](100) NULL,
[description] [varchar](2000) NULL,
[price] [decimal](18, 2) NULL,
[imagefile] [varchar](500) NULL,
[sold] [int] NULL CONSTRAINT [DF_Item_sold] DEFAULT ((0)),
[delivered] [int] NULL CONSTRAINT [DF_Item_delivered] DEFAULT ((0)),
CONSTRAINT [PK_Item] 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: Table [dbo].[Message] Script Date: 10/15/2017 3:14:27 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Message](
[id] [int] IDENTITY(1,1) NOT NULL,
[user_id] [int] NULL,
[item_id] [int] NULL,
[message_type] [varchar](10) NULL,
[added_time] [datetime] NULL,
CONSTRAINT [PK_Message] 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: Table [dbo].[Order] Script Date: 10/15/2017 3:14:27 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Order](
[id] [int] IDENTITY(1,1) NOT NULL,
[user_id] [int] NULL,
[item_id] [int] NULL,
[ordered_time] [datetime] NULL,
[payment_code] [varchar](50) NULL,
CONSTRAINT [PK_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
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[User] Script Date: 10/15/2017 3:14:27 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[User](
[id] [int] IDENTITY(1,1) NOT NULL,
[email] [varchar](100) NULL,
[password] [varchar](100) NULL,
[firstname] [varchar](100) NULL,
[lastname] [varchar](100) NULL,
[address] [varchar](500) NULL,
[bankdetails] [varchar](100) NULL,
CONSTRAINT [PK_User] 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