Skip to content

Commit

Permalink
init image jewelry
Browse files Browse the repository at this point in the history
  • Loading branch information
phuuthanh-dev committed Jun 13, 2024
1 parent efabdbb commit 94a0786
Showing 1 changed file with 106 additions and 33 deletions.
139 changes: 106 additions & 33 deletions db/init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,17 @@ CREATE TABLE [dbo].[user]
[ward] [nvarchar](50) NOT NULL,
[year_of_birth] [varchar](4) NOT NULL,
[bank_id] [int] NULL
)
)

-- Insert data into the user table
INSERT INTO [dbo].[user]
INSERT INTO [dbo].[user]
([cccd], [address], [avatar], [city], [email], [first_name], [last_name], [password], [phone], [district], [ward],
[state], [username], [year_of_birth], [role], [bank_id], [bank_account_number], [bank_account_name])
VALUES ('011234567890', N'1 Lý Thường Kiệt',
'https://scontent.fsgn2-7.fna.fbcdn.net/v/t39.30808-6/438275285_1101091104487039_4035794765477072253_n.jpg?_nc_cat=108&ccb=1-7&_nc_sid=5f2048&_nc_ohc=7MHTOamLKXgQ7kNvgGdad4i&_nc_ht=scontent.fsgn2-7.fna&oh=00_AYDZ0L0Y3_1M_tK5YBX-b1PhjuTPFeLod8Jz1UhW3t_Gkg&oe=6665416E',
N'Lâm Đồng', '[email protected]', N'Phùng', N'Thành',
'$2a$12$j/1n5Pjv4JgzG76ZG0hyH.MD6ftohJNbjuZjRHQFt31Ta/jViwKQ2', '0912345670', N'Hà Nội', N'Hoang', 'ACTIVE',
'phuuthanh2003', 1985, 'ADMIN', 7, '1030293193991', 'PHUNG HUU THANH');
[state], [username], [year_of_birth], [role], [bank_id], [bank_account_number], [bank_account_name])
VALUES ('011234567890', N'1 Lý Thường Kiệt',
'https://scontent.fsgn2-7.fna.fbcdn.net/v/t39.30808-6/438275285_1101091104487039_4035794765477072253_n.jpg?_nc_cat=108&ccb=1-7&_nc_sid=5f2048&_nc_ohc=7MHTOamLKXgQ7kNvgGdad4i&_nc_ht=scontent.fsgn2-7.fna&oh=00_AYDZ0L0Y3_1M_tK5YBX-b1PhjuTPFeLod8Jz1UhW3t_Gkg&oe=6665416E',
N'Lâm Đồng', '[email protected]', N'Phùng', N'Thành',
'$2a$12$j/1n5Pjv4JgzG76ZG0hyH.MD6ftohJNbjuZjRHQFt31Ta/jViwKQ2', '0912345670', N'Hà Nội', N'Hoang', 'ACTIVE',
'phuuthanh2003', 1985, 'ADMIN', 7, '1030293193991', 'PHUNG HUU THANH');


CREATE TABLE [dbo].[jewelry]
Expand All @@ -106,18 +106,18 @@ CREATE TABLE [dbo].[jewelry]
[weight] [float] NOT NULL,
[category_id] [int] NULL,
[user_id] [int] NULL,
)
)

INSERT INTO [dbo].[jewelry]
INSERT INTO [dbo].[jewelry]
([brand], [description], [material], [name], [price], [state], [weight], [category_id], [user_id])
VALUES (N'DOJI', N'Nhẫn đính hôn bằng kim cương.', N'Bạc', N'NHẪN ĐÍNH HÔN KIM CƯƠNG ENR3111W', 44500000, 'ACTIVE',
15.5, 2, 1),
(N'DOJI', N'Nhẫn đính hôn bằng kim cương.', N'Bạc', N'NHẪN CƯỚI KIM CƯƠNG IWR163', 5000000, 'ACTIVE', 8.2, 2,
1),
(N'DOJI', N'Nhẫn đính hôn bằng kim cương.', N'Bạc', N'NHẪN KIM CƯƠNG FDR0257', 41130000, 'ACTIVE', 20.1, 2, 1),
(N'DOJI', N'Nhẫn đính hôn bằng kim cương.', N'Bạc', N'NHẪN KIM CƯƠNG DJR397-22', 37000000, 'ACTIVE', 10.0, 2,
1),
(N'Fine Jewelry', N'Dây chuyền kim cương', N'Vàng', N'Dây chuyền kim cương Y', 18000000, 'ACTIVE', 6.9, 1, 15);
VALUES (N'DOJI', N'Nhẫn đính hôn bằng kim cương.', N'Bạc', N'NHẪN ĐÍNH HÔN KIM CƯƠNG ENR3111W', 44500000, 'ACTIVE',
15.5, 2, 1),
(N'DOJI', N'Nhẫn đính hôn bằng kim cương.', N'Bạc', N'NHẪN CƯỚI KIM CƯƠNG IWR163', 5000000, 'ACTIVE', 8.2, 2,
1),
(N'DOJI', N'Nhẫn đính hôn bằng kim cương.', N'Bạc', N'NHẪN KIM CƯƠNG FDR0257', 41130000, 'ACTIVE', 20.1, 2, 1),
(N'DOJI', N'Nhẫn đính hôn bằng kim cương.', N'Bạc', N'NHẪN KIM CƯƠNG DJR397-22', 37000000, 'ACTIVE', 10.0, 2,
1),
(N'Fine Jewelry', N'Dây chuyền kim cương', N'Vàng', N'Dây chuyền kim cương Y', 18000000, 'ACTIVE', 6.9, 1, 15);

CREATE TABLE [dbo].[auction]
(
Expand All @@ -134,15 +134,15 @@ CREATE TABLE [dbo].[auction]
[state] [varchar](255) NULL,
[jewelry_id] [int] NULL,
[staff_id] [int] NULL
)
)

INSERT INTO [dbo].[auction]
INSERT INTO [dbo].[auction]
([deposit], [description], [first_price], [end_date], [last_price], [name], [participation_fee], [price_step],
[start_date], [state], [jewelry_id], [staff_id])
VALUES (10000000, N'NHẪN ĐÍNH HÔN KIM CƯƠNG ENR3111W', 44500000, '2023-05-19 14:00:00', 70500000,
N'Đấu giá nhẫn kim cương ENR3111W', 500000, 1000000, '2023-05-19 10:00:00', 'FINISHED', 1, 1),
(10000000, N'NHẪN CƯỚI KIM CƯƠNG IWR163', 5000000, '2024-05-25 21:00:00', NULL,
N'Đấu giá NHẪN CƯỚI KIM CƯƠNG IWR163', 100000, 2000000, '2024-05-25 22:00:00', 'ONGOING', 2, 1);
[start_date], [state], [jewelry_id], [staff_id])
VALUES (10000000, N'NHẪN ĐÍNH HÔN KIM CƯƠNG ENR3111W', 44500000, '2023-05-19 14:00:00', 70500000,
N'Đấu giá nhẫn kim cương ENR3111W', 500000, 1000000, '2023-05-19 10:00:00', 'FINISHED', 1, 1),
(10000000, N'NHẪN CƯỚI KIM CƯƠNG IWR163', 5000000, '2024-05-25 21:00:00', NULL,
N'Đấu giá NHẪN CƯỚI KIM CƯƠNG IWR163', 100000, 2000000, '2024-05-25 22:00:00', 'ONGOING', 2, 1);


CREATE TABLE [dbo].[auction_history]
Expand All @@ -154,17 +154,17 @@ CREATE TABLE [dbo].[auction_history]
[user_id] [int] NULL,
[bid_code] [varchar](20) NOT NULL,
[state] [varchar](255) NULL,
);
);

INSERT INTO [dbo].[auction_history]
( [price_given]
, [time]
, [auction_id]
, [user_id]
, [bid_code]
, [state])
, [time]
, [auction_id]
, [user_id]
, [bid_code]
, [state])
VALUES (2550750, '2024-05-01 17:30:00', 1, 1, 'BAS12', 'ACTIVE'),
(1000750, '2024-05-12 19:30:00', 2, 1, 'BAS22', 'ACTIVE');
(1000750, '2024-05-12 19:30:00', 2, 1, 'BAS22', 'ACTIVE');


CREATE TABLE [dbo].[token]
Expand All @@ -179,4 +179,77 @@ CREATE TABLE [dbo].[token]
[token] [varchar](255) NULL,
[token_type] [varchar](255) NULL,
[user_id] [int] NULL
)
)

CREATE TABLE [dbo].[image]
(
[id] [int] IDENTITY(1,1) NOT NULL,
[data] [varchar](max) NULL,
[icon] [bit] NULL,
[link] [varchar](255) NULL,
[jewelry_id] [int] NULL
)

INSERT INTO [dbo].[image] ([data], [icon], [link], [jewelry_id])
VALUES
('https://raw.githubusercontent.com/phuuthanh2003/FE_Deploy/main/public/assets/images/product/small-size/1.jpg', 1, '', 1),
('https://raw.githubusercontent.com/phuuthanh2003/FE_Deploy/main/public/assets/images/product/small-size/2.jpg', 0, '', 1),
('https://raw.githubusercontent.com/phuuthanh2003/FE_Deploy/main/public/assets/images/product/small-size/2-1.jpg', 1, '', 2),
('https://raw.githubusercontent.com/phuuthanh2003/FE_Deploy/main/public/assets/images/product/small-size/2-2.jpg', 0, '', 2),
('https://raw.githubusercontent.com/phuuthanh2003/FE_Deploy/main/public/assets/images/product/small-size/6-1.jpg', 1, '', 3),
('https://raw.githubusercontent.com/phuuthanh2003/FE_Deploy/main/public/assets/images/product/small-size/9-1.jpg', 1, '', 4);

CREATE TABLE [dbo].[transaction](
[id] [int] IDENTITY(1,1) NOT NULL,
[create_date] [datetime2](6) NOT NULL,
[fees_incurred] [float] NOT NULL,
[payment_method] [varchar](20) NULL,
[payment_time] [datetime2](6) NULL,
[transaction_state] [varchar](255) NOT NULL,
[total_price] [float] NOT NULL,
[transaction_type] [varchar](255) NOT NULL,
[auction_id] [int] NULL,
[user_id] [int] NULL
)

INSERT INTO [dbo].[transaction] ([create_date], [fees_incurred], [payment_method], [payment_time], [transaction_state], [total_price], [transaction_type], [auction_id], [user_id])
VALUES
('2024-05-01 17:30:00', 100000, 'BANKING', '2024-05-01 17:30:00', 'SUCCEED', 1000000, 'REGISTRATION', 1, 1),
('2024-05-12 19:30:00', 200000, 'BANKING', '2024-05-12 19:30:00', 'SUCCEED', 2000000, 'REGISTRATION', 2, 1);



CREATE TABLE [dbo].[auction_registration]
(
[id] [int] IDENTITY(1,1) NOT NULL,
[auction_registration_state] [varchar](255) NOT NULL,
[registration_date] [datetime2](6) NOT NULL,
[registration_fee] [float] NOT NULL,
[auction_id] [int] NULL,
[transaction_id] [int] NULL,
[user_id] [int] NULL
)

INSERT INTO [dbo].[auction_registration] ([auction_registration_state], [registration_date], [registration_fee], [auction_id], [transaction_id], [user_id])
VALUES
('VALID', '2024-05-01 17:30:00', 1000000, 1, 1, 1),
('VALID', '2024-05-12 19:30:00', 2000000, 2, 1, 1);

CREATE TABLE [dbo].[request_approval](
[id] [int] IDENTITY(1,1) NOT NULL,
[desired_price] [float] NOT NULL,
[is_confirm] [bit] NULL,
[note] [nvarchar](255) NULL,
[request_time] [datetime2](6) NOT NULL,
[response_time] [datetime2](6) NULL,
[state] [varchar](255) NULL,
[valuation] [float] NULL,
[jewelry_id] [int] NULL,
[user_id_respond] [int] NULL,
[user_id_send] [int] NULL,
[staff_id] [int] NULL
)

INSERT INTO [dbo].[request_approval] ([desired_price], [is_confirm], [note], [request_time], [response_time], [state], [valuation], [jewelry_id], [user_id_respond], [user_id_send], [staff_id])
VALUES
(1000000, 1, 'Nhẫn kim cương', '2024-05-01 17:30:00', '2024-05-01 17:30:00', 'ACTIVE', 1000000, 1, 1, 2, 1);

0 comments on commit 94a0786

Please sign in to comment.