From 43c1309bb2f9d8674c5494bf7c49f34dcb83fa21 Mon Sep 17 00:00:00 2001 From: yooonwodyd Date: Thu, 7 Nov 2024 15:10:01 +0900 Subject: [PATCH] feat:[#84]- add sql MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit data.sql 추가 --- src/main/resources/data.sql | 169 ++++++++++++++++++++---------------- 1 file changed, 95 insertions(+), 74 deletions(-) diff --git a/src/main/resources/data.sql b/src/main/resources/data.sql index f765a99..3e8c706 100644 --- a/src/main/resources/data.sql +++ b/src/main/resources/data.sql @@ -1,81 +1,102 @@ -INSERT INTO users (nickname, email, birthdate, phone, address, created_at) +-- users 테이블 초기 데이터 +INSERT INTO users (nickname, user_image_url, name, email, birthdate, phone, address, created_date, modified_date) VALUES - ('JohnDoe', 'johndoe@example.com', '1990-01-15', '010-1234-5678', 'Seoul, South Korea', '2024-09-23T12:00:00'), - ('JaneSmith', 'janesmith@example.com', '1985-05-23', '010-9876-5432', 'Busan, South Korea', '2024-09-23T12:00:00'), - ('MikeJohnson', 'mikejohnson@example.com', '1992-03-10', '010-5678-1234', 'Incheon, South Korea', '2024-09-23T12:00:00'), - ('EmilyDavis', 'emilydavis@example.com', '1988-08-17', '010-8765-4321', 'Daegu, South Korea', '2024-09-23T12:00:00'), - ('DavidWilson', 'davidwilson@example.com', '1995-07-07', '010-1111-2222', 'Daejeon, South Korea', '2024-09-23T12:00:00'), - ('SophiaMiller', 'sophiamiller@example.com', '1989-02-25', '010-3333-4444', 'Gwangju, South Korea', '2024-09-23T12:00:00'), - ('JamesBrown', 'jamesbrown@example.com', '1993-11-30', '010-5555-6666', 'Ulsan, South Korea', '2024-09-23T12:00:00'), - ('OliviaTaylor', 'oliviataylor@example.com', '1996-05-05', '010-7777-8888', 'Jeonju, South Korea', '2024-09-23T12:00:00'), - ('BenjaminLee', 'benjaminlee@example.com', '1987-09-15', '010-9999-0000', 'Cheongju, South Korea', '2024-09-23T12:00:00'), - ('IsabellaClark', 'isabellaclark@example.com', '1991-12-12', '010-1122-3344', 'Suwon, South Korea', '2024-09-23T12:00:00'), - ('HenryWhite', 'henrywhite@example.com', '1986-04-18', '010-2233-4455', 'Seongnam, South Korea', '2024-09-23T12:00:00'), - ('MiaHarris', 'miaharris@example.com', '1994-10-10', '010-3344-5566', 'Pohang, South Korea', '2024-09-23T12:00:00'), - ('LucasMartin', 'lucasmartin@example.com', '1997-06-06', '010-4455-6677', 'Changwon, South Korea', '2024-09-23T12:00:00'), - ('EllaYoung', 'ellayoung@example.com', '1998-03-03', '010-5566-7788', 'Yeosu, South Korea', '2024-09-23T12:00:00'), - ('WilliamKing', 'williamking@example.com', '1983-08-08', '010-6677-8899', 'Jeju, South Korea', '2024-09-23T12:00:00'), - ('AmeliaScott', 'ameliascott@example.com', '1990-07-17', '010-7788-9900', 'Gimhae, South Korea', '2024-09-23T12:00:00'), - ('JackMoore', 'jackmoore@example.com', '1984-02-02', '010-8899-0011', 'Ansan, South Korea', '2024-09-23T12:00:00'), - ('AvaWalker', 'avawalker@example.com', '1999-11-11', '010-9900-1122', 'Guri, South Korea', '2024-09-23T12:00:00'), - ('DanielPerez', 'danielperez@example.com', '1992-05-21', '010-0011-2233', 'Yangsan, South Korea', '2024-09-23T12:00:00'), - ('LilyHall', 'lilyhall@example.com', '1991-01-01', '010-1122-3344', 'Iksan, South Korea', '2024-09-23T12:00:00'); --- User 1 (JohnDoe) -INSERT INTO user_hashtags (user_id, hash_tags) VALUES (1, 'DREAMLIKE'); - --- User 2 (JaneSmith) -INSERT INTO user_hashtags (user_id, hash_tags) VALUES (2, 'DREAMLIKE'); - --- User 3 (MikeJohnson) -INSERT INTO user_hashtags (user_id, hash_tags) VALUES (3, 'DREAMLIKE'); - --- User 4 (EmilyDavis) -INSERT INTO user_hashtags (user_id, hash_tags) VALUES (4, 'DREAMLIKE'); - --- User 5 (DavidWilson) -INSERT INTO user_hashtags (user_id, hash_tags) VALUES (5, 'DREAMLIKE'); - --- User 6 (SophiaMiller) -INSERT INTO user_hashtags (user_id, hash_tags) VALUES (6, 'DREAMLIKE'); - --- User 7 (JamesBrown) -INSERT INTO user_hashtags (user_id, hash_tags) VALUES (7, 'DREAMLIKE'); - --- User 8 (OliviaTaylor) -INSERT INTO user_hashtags (user_id, hash_tags) VALUES (8, 'DREAMLIKE'); - --- User 9 (BenjaminLee) -INSERT INTO user_hashtags (user_id, hash_tags) VALUES (9, 'DREAMLIKE'); - --- User 10 (IsabellaClark) -INSERT INTO user_hashtags (user_id, hash_tags) VALUES (10, 'DREAMLIKE'); - --- User 11 (HenryWhite) -INSERT INTO user_hashtags (user_id, hash_tags) VALUES (11, 'DREAMLIKE'); - --- User 12 (MiaHarris) -INSERT INTO user_hashtags (user_id, hash_tags) VALUES (12, 'DREAMLIKE'); - --- User 13 (LucasMartin) -INSERT INTO user_hashtags (user_id, hash_tags) VALUES (13, 'DREAMLIKE'); - --- User 14 (EllaYoung) -INSERT INTO user_hashtags (user_id, hash_tags) VALUES (14, 'DREAMLIKE'); + ('johndoe1', 'https://example.com/johndoe1.jpg', 'John Doe 1', 'john.doe1@example.com', '1990-01-01', '123-456-7890', '123 Main St, City, Country', NOW(), NOW()), + ('johndoe2', 'https://example.com/johndoe2.jpg', 'John Doe 2', 'john.doe2@example.com', '1991-01-01', '123-456-7891', '124 Main St, City, Country', NOW(), NOW()), + ('johndoe3', 'https://example.com/johndoe3.jpg', 'John Doe 3', 'john.doe3@example.com', '1992-01-01', '123-456-7892', '125 Main St, City, Country', NOW(), NOW()), + ('johndoe4', 'https://example.com/johndoe4.jpg', 'John Doe 4', 'john.doe4@example.com', '1993-01-01', '123-456-7893', '126 Main St, City, Country', NOW(), NOW()), + ('johndoe5', 'https://example.com/johndoe5.jpg', 'John Doe 5', 'john.doe5@example.com', '1994-01-01', '123-456-7894', '127 Main St, City, Country', NOW(), NOW()), + ('janedoe1', 'https://example.com/janedoe1.jpg', 'Jane Doe 1', 'jane.doe1@example.com', '1990-02-01', '987-654-3210', '223 Main St, City, Country', NOW(), NOW()), + ('janedoe2', 'https://example.com/janedoe2.jpg', 'Jane Doe 2', 'jane.doe2@example.com', '1991-02-01', '987-654-3211', '224 Main St, City, Country', NOW(), NOW()), + ('janedoe3', 'https://example.com/janedoe3.jpg', 'Jane Doe 3', 'jane.doe3@example.com', '1992-02-01', '987-654-3212', '225 Main St, City, Country', NOW(), NOW()), + ('janedoe4', 'https://example.com/janedoe4.jpg', 'Jane Doe 4', 'jane.doe4@example.com', '1993-02-01', '987-654-3213', '226 Main St, City, Country', NOW(), NOW()), + ('janedoe5', 'https://example.com/janedoe5.jpg', 'Jane Doe 5', 'jane.doe5@example.com', '1994-02-01', '987-654-3214', '227 Main St, City, Country', NOW(), NOW()); + +-- user_hashtags 테이블 초기 데이터 +INSERT INTO user_hashtags (user_id, hash_tags) +VALUES + (1, 'SERENITY'), + (1, 'JOYFUL'), + (2, 'MELANCHOLY'), + (2, 'NOSTALGIA'), + (3, 'VIBRANCE'), + (3, 'WONDER'), + (4, 'DREAMLIKE'), + (5, 'CONTEMPLATION'), + (6, 'JOYFUL'), + (7, 'LONELINESS'), + (8, 'MYSTERY'), + (9, 'SERENITY'), + (10, 'NOSTALGIA'); + +-- artist_info 테이블 초기 데이터 +INSERT INTO artist_info (user_id, nickname, artist_image_url, artist_type, total_followers, total_likes, about) +VALUES + (1, 'ArtistJohn1', 'https://example.com/artistjohn1.jpg', 'BUSINESS', 100, 200, 'About Artist John 1'), + (2, 'ArtistJohn2', 'https://example.com/artistjohn2.jpg', 'STUDENT', 150, 300, 'About Artist John 2'), + (3, 'ArtistJane1', 'https://example.com/artistjane1.jpg', 'BUSINESS', 120, 220, 'About Artist Jane 1'), + (4, 'ArtistJane2', 'https://example.com/artistjane2.jpg', 'STUDENT', 130, 250, 'About Artist Jane 2'); --- User 15 (WilliamKing) -INSERT INTO user_hashtags (user_id, hash_tags) VALUES (15, 'DREAMLIKE'); +-- business_artist 테이블 초기 데이터 +INSERT INTO business_artist (artist_info_id, business_number, open_date, head_name) +VALUES + (1, 'B123456789', '2000-01-01', 'John Head 1'), + (3, 'B987654321', '2005-02-01', 'Jane Head 1'); --- User 16 (AmeliaScott) -INSERT INTO user_hashtags (user_id, hash_tags) VALUES (16, 'DREAMLIKE'); +-- student_artist 테이블 초기 데이터 +INSERT INTO student_artist (artist_info_id, school_email, school_name, major) +VALUES + (2, 'john2@university.com', 'University A', 'Fine Arts'), + (4, 'jane2@university.com', 'University B', 'Visual Arts'); --- User 17 (JackMoore) -INSERT INTO user_hashtags (user_id, hash_tags) VALUES (17, 'DREAMLIKE'); +-- social 테이블 초기 데이터 +INSERT INTO social (follower_id, following_id) +VALUES + (1, 2), + (1, 3), + (2, 4), + (3, 1), + (4, 2); + +-- product 테이블 초기 데이터 삽입 +INSERT INTO product (name, category, size, price, description, preferred_location, thumbnail_url, artist_info_id, created_date, modified_date) +VALUES + ('Mountain Landscape', 'PICTURE', '100x150', 1500000, 'Beautiful mountain landscape painting.', 'Seoul, South Korea', 'https://example.com/thumbnail1.jpg', 1, NOW(), NOW()), + ('Modern Sculpture', 'PIECE', '50x80', 2500000, 'Modern art sculpture made of steel.', 'New York, USA', 'https://example.com/thumbnail2.jpg', 3, NOW(), NOW()), + ('Oriental Artwork', 'ORIENTAL', '120x180', 2000000, 'Traditional oriental painting.', 'Beijing, China', 'https://example.com/thumbnail3.jpg', 2, NOW(), NOW()); --- User 18 (AvaWalker) -INSERT INTO user_hashtags (user_id, hash_tags) VALUES (18, 'DREAMLIKE'); +-- product_hashtags 테이블 초기 데이터 삽입 +INSERT INTO product_hashtags (product_id, hash_tags) +VALUES + (1, 'SERENITY'), + (1, 'VIBRANCE'), + (2, 'CONTEMPLATION'), + (3, 'MYSTERY'), + (3, 'DREAMLIKE'); + +-- product_image 테이블 초기 데이터 삽입 +INSERT INTO product_image (photo_url, product_id, uuid) +VALUES + ('https://example.com/product1_image1.jpg', 1, 'uuid-1234'), + ('https://example.com/product1_image2.jpg', 1, 'uuid-5678'), + ('https://example.com/product2_image1.jpg', 2, 'uuid-91011'), + ('https://example.com/product3_image1.jpg', 3, 'uuid-121314'); --- User 19 (DanielPerez) -INSERT INTO user_hashtags (user_id, hash_tags) VALUES (19, 'DREAMLIKE'); +-- likes 테이블 초기 데이터 삽입 +INSERT INTO likes (user_id, product_id) +VALUES + (1, 1), + (2, 1), + (3, 2), + (4, 3), + (5, 3); + +-- orders 테이블 초기 데이터 삽입 +INSERT INTO orders (user_id, product_id, status) +VALUES + (1, 1, 'ORDER'), + (2, 2, 'ORDER'), + (3, 3, 'CANCEL'), + (4, 1, 'ORDER'), + (5, 2, 'CANCEL'); --- User 20 (LilyHall) -INSERT INTO user_hashtags (user_id, hash_tags) VALUES (20, 'DREAMLIKE');