Hexo deploy시 github.com 인증 오류

에러

hexo deploy를 실행하니 다음과 같이 에러 발생.

1
fatal: Authentication failed for ~~

SSH Key 생성

1
ssh-keygen -t rsa -C "Github 계정 e-mail"

file 물어보는데 그냥 엔터 입력 (이 디렉토리를 바꾸면 동작하지 않으니 주의할 것!)
passphrase는 GitHub의 패스워드 아님 (그냥 엔터 눌러도 됨)

생성 예제

1
2
3
4
5
6
7
8
9
# ssh-keygen -t rsa -C "계정 e-mail"
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256: ~~~

GitHub.com 로그인

  • Settings로 이동
  • SSH & GPG Keys 선택
  • New SSH Key 버튼 클릭
  • Title에는 식별할 수 있는 이름 입력하고, Key에 아까 엔터친 파일명 뒤에 .pub를 붙인 파일의 내용 복붙
    1
    cat /root/.ssh/id_rsa.pub
  • Add SSH Key 버튼 클릭

등록 확인

1
2
# ssh -T git@github.com
Hi (GitHub ID)! You've successfully authenticated, but GitHub does not provide shell

Hexo Config 파일 변경

  • _config.yml 파일 변경
  • Before
    1
    2
    3
    4
    5
    6
    # Deployment
    ## Docs: https://hexo.io/docs/one-command-deployment
    deploy:
    type: git
    repo: https://github.com/(GitHub ID)/(GitHub ID).github.io.git
    branch: master
  • After
    1
    2
    3
    4
    5
    6
    # Deployment
    ## Docs: https://hexo.io/docs/one-command-deployment
    deploy:
    type: git
    repo: git@github.com:(GitHub ID)/(GitHub ID).github.io.git
    branch: master

윈도우즈 10 꺼야할 기능

컴퓨터 성능 저하 주범

  • H/W 개발자들이 컴퓨터 속도를 엄청 빠르게 만들면, Microsoft에서 운영체제로 컴퓨터 속도를 다시 엄청 느리게 만들어서 30년 전이나 지금이나 빨라진 걸 느끼지 못하게 만든다는 유머가 있다.
  • 1980년대 PC가 4.77MHz 였고 2021년엔 4GHz쯤 되니 800배 이상이 빨라졌어야 하는데…

Cortana

  • 우리말 지원 되지도 않으면서 각종 성능 저하 유발
  • 폴더 들어갈 때 속도도 저하된다고 함
  • 검색해서 반드시 끌 것

Microsoft Compatibility Telemetry

  • 마이크로소프트로 피드백 진단 데이터를 보낸다고 하는데 리소스(특히 CPU) 많이 잡아 먹으니 꺼야함
  • 설정에서 피드백 찾아서 “안 함”으로 바꿔줘야 함
  • 검색을 해보니 이 것만 가지고 안되는지 레지스트리까지 건드려야 한다고 되어 있었음

Flask MySQL JSON 한글

Flask에서 MySQL 접속시 발생한 에러

  • TypeError: Object of type Decimal is not JSON serializable
  • MySQL에서 utf8을 사용하도록 처리했지만 한글 출력 문제 발생
  • jsonify() 및 json.dumps() 문제들
  • JSON에서 객체 대신 배열로 값들이 들어가는 문제
  • DB의 애트리뷰트 순서와 다르게 JSON에서 정렬되는 문제

해결 방법

  • simplejson 설치

    apt-get install libmysqlclient-dev
    pip install simplejson flask-mysqldb

    • simplejson 설치해 두면 자동으로 jsonify에서 사용함
  • 커서로 DictCursor를 사용하도록 지정

    app.config[‘MYSQL_CURSORCLASS’] = ‘DictCursor’

  • JSON에서 sort하지 않도록 지정

    app.config[‘JSON_SORT_KEYS’] = False

  • Header 사용
    • jsonify()는 자체 헤더 포함
    • json.dumps()는 헤더 포함하지 않음
1
2
3
4
5
6
7
8
@app.route("/", methods=["GET"])
def index():
query = 'select * from 테이블 이름'
cur = db.connection.cursor()
cur.execute(query)
r = Response(response=json.dumps(cur.fetchall()))
r.headers["Content-Type"] = "application/json; charset=utf-8"
return r

소스 코드

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
from flask import Flask, jsonify
from flask_mysqldb import MySQL
# mysqlclient, flask-mysqldb, simplejson 설치 필요함
# apt-get install libmysqlclient-dev
# pip install simplejson flask-mysqldb
# simplejson은 설치만 해두면 jsonify에서 사용함

app = Flask(__name__)

app.config['MYSQL_HOST'] = 'localhost'
app.config['MYSQL_USER'] = 'root'
app.config['MYSQL_PASSWORD'] = '패스워드'
app.config['MYSQL_DB'] = '데이터베이스 이름'
app.config['MYSQL_CURSORCLASS'] = 'DictCursor'
app.config['JSON_SORT_KEYS'] = False
db = MySQL(app)


@app.route("/", methods=["GET"])
def index():
query = 'select * from 테이블 이름'
cur = db.connection.cursor()
cur.execute(query)
return jsonify(cur.fetchall())


# @app.route("/", methods=["GET"])
# def index():
# query = 'select * from 테이블 이름'
# cur = db.connection.cursor()
# cur.execute(query)
# r = Response(response=json.dumps(cur.fetchall()))
# r.headers["Content-Type"] = "application/json; charset=utf-8"
# return r


if __name__ == "__main__":
app.run(host='0.0.0.0', port=80, debug=True)

관련 강의

https://colab.research.google.com/drive/1BAbJdJ8O5LH9EIFf9qjf2brTpaPn5iv-
https://bit.ly/2Y5xH7P

https://bwoh.github.io/2021/01/10/dbex/Chap-13-Flask/

Chap.02. DDL

CoLab

https://colab.research.google.com/drive/1wts3NIBojdz2mBUfBott6vAA0kqfsMq2

https://bit.ly/39G3WzN

Create Table

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
DROP DATABASE IF EXISTS `gunpladb` ;

CREATE DATABASE IF NOT EXISTS `gunpladb`
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;

USE `gunpladb` ;

CREATE TABLE `mechanic` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(255) NOT NULL,
`model` VARCHAR(100) NOT NULL,
`manufacturer` VARCHAR(255) NULL,
`armor` VARCHAR(255) NULL,
`height` DECIMAL(7,2) NULL,
`weight` DECIMAL(7,2) NULL,
PRIMARY KEY (`id`)
) ENGINE = InnoDB
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;

Referential Integrity: Set Null

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
DROP DATABASE IF EXISTS `ridb` ;
CREATE DATABASE IF NOT EXISTS `ridb`;
USE `ridb` ;
CREATE TABLE `mechanic` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE = InnoDB;
CREATE TABLE `gunpla` (
`id` INT NOT NULL AUTO_INCREMENT,
`mid` INT,
`grade` VARCHAR(45) NOT NULL,
PRIMARY KEY (`id`),
FOREIGN KEY (`mid`) REFERENCES `mechanic` (`id`)
ON DELETE SET NULL ON UPDATE SET NULL
) ENGINE = InnoDB;
INSERT INTO mechanic (id, name) VALUES
(1, 'Gundam'),
(2, 'Gun Cannon'),
(3, 'Gun Tank');
INSERT INTO gunpla (id, mid, grade) VALUES
(1, 1, 'MG'),
(2, 2, 'SD'),
(3, 3, 'HGUC');
select * from gunpla;
delete from mechanic where name='Gundam';
select * from gunpla;

Referential Integrity: Cascade

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
DROP DATABASE IF EXISTS `ridb` ;
CREATE DATABASE IF NOT EXISTS `ridb`;
USE `ridb` ;
CREATE TABLE `mechanic` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE = InnoDB;
CREATE TABLE `gunpla` (
`id` INT NOT NULL AUTO_INCREMENT,
`mid` INT,
`grade` VARCHAR(45) NOT NULL,
PRIMARY KEY (`id`),
FOREIGN KEY (`mid`) REFERENCES `mechanic` (`id`)
ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB;
INSERT INTO mechanic (id, name) VALUES
(1, 'Gundam'),
(2, 'Gun Cannon'),
(3, 'Gun Tank');
INSERT INTO gunpla (id, mid, grade) VALUES
(1, 1, 'MG'),
(2, 2, 'SD'),
(3, 3, 'HGUC');
select * from gunpla;
delete from mechanic where name='Gundam';
select * from gunpla;

Alter Table

1
2
3
4
5
6
7
alter table mechanic add designer varchar(10);

alter table mechanic modify column designer varchar(100);

alter table mechanic change column designer artist varchar(100);

alter table mechanic drop designer;

Create View

1
2
3
4
5
6
create view simple as
select name, model from mechanic;

describe mechanic;

select * from mechanic;

Chap.03. DML

CoLab

https://colab.research.google.com/drive/1AWSHGjC8EOM6K1yaGtEFTShhYYafWM-e

https://bit.ly/2LzNM2K

데이터베이스 구축

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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
DROP DATABASE IF EXISTS `gunpladb` ;

CREATE DATABASE IF NOT EXISTS `gunpladb`
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;

USE `gunpladb` ;

CREATE TABLE `mechanic` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(255) NOT NULL,
`model` VARCHAR(100) NOT NULL,
`manufacturer` VARCHAR(255) NULL,
`armor` VARCHAR(255) NULL,
`height` DECIMAL(7,2) NULL,
`weight` DECIMAL(7,2) NULL,
PRIMARY KEY (`id`)
) ENGINE = InnoDB
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;

CREATE TABLE `gunpla` (
`id` INT NOT NULL AUTO_INCREMENT,
`mechanic_id` INT NOT NULL,
`grade` VARCHAR(45) NOT NULL,
`date` DATE NULL,
`price` INT(11) NULL,
`title` VARCHAR(255) NULL,
`boxart` VARCHAR(2083) NULL,
PRIMARY KEY (`id`),
INDEX (`mechanic_id`),
FOREIGN KEY (`mechanic_id`) REFERENCES `mechanic` (`id`)
ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;

CREATE TABLE `image` (
`id` INT NOT NULL AUTO_INCREMENT,
`gunpla_id` INT NOT NULL,
`filename` VARCHAR(255) NOT NULL,
`description` TEXT NULL,
PRIMARY KEY (`id`),
INDEX (`gunpla_id`),
FOREIGN KEY (`gunpla_id`) REFERENCES `gunpla` (`id`)
ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;

CREATE TABLE `armament` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(255) NULL,
`description` TEXT NULL,
`image` VARCHAR(2083) NULL,
PRIMARY KEY (`id`)
) ENGINE = InnoDB
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;

CREATE TABLE `equipment` (
`mechanic_id` INT NOT NULL,
`armaments_id` INT NOT NULL,
PRIMARY KEY (`mechanic_id`, `armaments_id`),
INDEX (`armaments_id`),
FOREIGN KEY (`mechanic_id`) REFERENCES `mechanic` (`id`)
ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY (`armaments_id`) REFERENCES `armament` (`id`)
ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;

CREATE TABLE `pilot` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(255) NOT NULL,
`alias` VARCHAR(255) NULL,
`type` VARCHAR(100) NULL,
`nationality` VARCHAR(100) NULL,
`image` VARCHAR(2083) NULL,
PRIMARY KEY (`id`)
) ENGINE = InnoDB
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;

CREATE TABLE `boarding` (
`mechanic_id` INT NOT NULL,
`pilot_id` INT NOT NULL,
PRIMARY KEY (`mechanic_id`, `pilot_id`),
INDEX (`pilot_id`),
FOREIGN KEY (`mechanic_id`) REFERENCES `mechanic` (`id`)
ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY (`pilot_id`) REFERENCES `pilot` (`id`)
ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;


###############################################

INSERT INTO mechanic (id, name, model, manufacturer, armor, height, weight) VALUES
(1, '건담', 'RX-78-2', 'Earth Federation', 'Luna Titanium', 18.0, 43.4),
(2, '건캐논', 'RX-77-2', 'Earth Federation', 'Luna Titanium', 17.5, 51.0),
(3, '건탱크', 'RX-75', 'Earth Federation', 'Luna Titanium', 15.0, 56.0),
(4, '짐', 'RGM-79', 'Earth Federation Forces', 'Titanium Alloy', 18.0, 41.2),
(5, '자쿠 II', 'MS-06F', 'Zeonic Company', 'Super Hard Steel Alloy', 17.5, 58.1),
(6, '샤아 전용 자쿠 II', 'MS-06S', 'Zeonic Company', 'Super Hard Steel Alloy', 17.5, 56.5),
(7, '돔', 'MS-09B', 'Zimmad Company', 'Super Hard Steel Alloy', 18.6, 62.6),
(8, '릭 돔', 'MS-09R', 'Zimmad Company', 'Super Hard Steel Alloy', 18.6, 43.8),
(9, '즈고크 E', 'MSM-07E', 'MIP Company', 'Titanium Alloy Ceramic Composite', 18.4, 69.5),
(10, '씨그', 'ZGMF-515', 'Zodiac Alliance of Freedom Treaty', null, 21.43, 80.22),
(11, '거너 자쿠 워리어', 'ZGMF-1000/A1', 'Integrated Design Bureau', null, 20.50, 91.11),
(12, '건담 5호기', 'RX-78-5', 'Earth Federation', 'Luna Titanium', 18.0, 42.9),
(13, '건담 Mk-II', 'RX-178', 'Titans', 'Titanium Alloy Ceramic Composite', 18.5, 33.4),
(14, '겔구그', 'MS-14A/C', 'Zeonic Company', 'Super Hard Steel Alloy', 19.2, 42.1),
(15, '겔구그 예거', 'MS-14Jg', 'Zeonic Company', 'Titanium Alloy Ceramic Composite', 19.2, 40.5),
(16, '고그', 'MSM-03', 'Zimmad Company', 'Super High Tensile Steel', 18.3, 82.4),
(17, '네모', 'MSA-003', 'Anaheim Electronics', 'Gundarium α Alloy', 18.5, 36.2),
(18, '뉴건담', 'RX-93', 'Anaheim Electronics', 'Gundarium α Alloy', 18.5, 36.2),
(19, '레전드 건담', 'ZGMF-X666S', 'Zodiac Alliance of Freedom Treaty', 'Variable Phase Shift armor', 18.66, 86.02),
(20, '릭디아스', 'RMS-099', 'Anaheim Electronics', 'Gundarium γ Alloy', 18.0, 32.2),
(21, '마라사이', 'RMS-108', 'Anaheim Electronics', 'Gundarium Alloy', 17.5, 33.1),
(22, '베르데 버스터 건담', 'GAT-X103AP', 'Actaeon Industries', 'Variable Phase Shift Armor', 18.46, 99.36),
(23, '블레이즈 자쿠 팬텀', 'ZGMF-1001/M', 'Integrated Design Bureau', null, 20.4, 91.2),
(24, '스트라이크 건담', 'GAT-X105', 'Earth Alliance', 'Phase Shift Armor', 17.72, 64.8),
(25, '건담 아스트레이 레드 프레임', 'MBF-P02', 'Morgenroete, Inc.', 'Foaming metal', 17.53, 49.8),
(26, '알렉스', 'RX-78NT-1', 'Earth Federation', 'Luna Titanium', 18.0, 40.0),
(27, '주다', 'EMS-10', 'Zimmad Company', 'Hardened Steel', 17.3, 61.0),
(28, '캠퍼', 'MS-18E', 'Zeonic Company', 'Titanium Alloy Ceramic Composite', 17.7, 43.5),
(29, '파워드 짐', 'RGM-79', 'Earth Federation', 'Titanium Ceramic Composite', 18.0, 46.6),
(30, '프리덤 건담', 'ZGMF-X10A', 'Integrated Design Bureau', 'Phase Shift Armor', 18.03, 71.5);

INSERT INTO gunpla (id, mechanic_id, grade, date, price, title, boxart) VALUES
(1, 1, 'MG', '2005-03-01', 3200, 'RX-78-2 Gundam ver. O.Y.W 0079 (PS2 soft)', 'http://ipsumimage.appspot.com/200x150,dfdfdf?s=24&l=RX-78-2%20Gundam%7Cver.%20O.Y.W%200079%7C(PS2%20soft)'),
(2, 2, 'SD', '2001-11-01', 500, 'Gun Cannon', 'http://ipsumimage.appspot.com/200x150,ffff3f?s=24&l=Gun%20Cannon'),
(3, 3, 'SD', '2001-08-01', 500, 'Gun Tank', 'http://ipsumimage.appspot.com/200x150,ffff72?s=24&l=Gun%20Tank'),
(4, 4, 'SD', '2001-04-01', 700, 'GM', 'http://ipsumimage.appspot.com/200x150,ffffd7?s=24&l=GM'),
(5, 5, 'MG', '2002-09-01', 3000, 'MS-06F2 Zaku II F2 : EFSF 연방군형', 'http://ipsumimage.appspot.com/200x150,3fef3f?s=24&l=%7CMS-06F2%7CZaku%20II%20F2%7CEFSF%20%EC%97%B0%EB%B0%A9%EA%B5%B0%ED%98%95'),
(6, 6, 'RG', '2010-11-01', 2500, "MS-06S Char's Zaku II", 'http://ipsumimage.appspot.com/200x150,7f7fff?s=24&l=MS-06S%7CChar%27s%20Zaku%20II'),
(7, 7, 'HGUC', '2006-01-01', 1700, 'MS-09/MS-09R Dom/Rick-Dom', 'http://ipsumimage.appspot.com/200x150,9f7fd2?s=24&l=MS-09%7CMS-09R%20Dom%7CRick-Dom'),
(8, 8, 'MG', '1999-10-01', 4000, 'MS-09R Rick-Dom', 'http://ipsumimage.appspot.com/200x150,ff7fd2?s=24&l=MS-09R%7CRick-Dom'),
(9, 9, 'HGUC', '2003-08-01', 1200, "MSM-07E Z'gok Experiment", 'http://ipsumimage.appspot.com/200x150,6f7fff?s=24&l=MSM-07E%7CZ%27gok%20Experiment'),
(10, 10, 'SEED HG', '2004-04-01', 1200, 'ZGMF-515 Mobile Cgue', 'http://ipsumimage.appspot.com/200x150,afafaf?s=24&l=ZGMF-515%7CMobile%20Cgue'),
(11, 11, 'SEED 1/100', '2005-03-01', 2300, 'ZGMF-1000/A1 Gunner Zaku Warrior - 루나마리아 전용', 'http://ipsumimage.appspot.com/200x150,ff4f4f?s=24&l=ZGMF-1000/A1%7CGunner%20Zaku%7CWarrior%7C%EB%A3%A8%EB%82%98%EB%A7%88%EB%A6%AC%EC%95%84%7C%EC%A0%84%EC%9A%A9'),
(12, 12, 'MG', '2003-08-01', 2800, 'RX-78-5 Gundam 5호기', 'http://ipsumimage.appspot.com/200x150,ffff4f?s=24&l=RX-78-5%7CGundam%205%ED%98%B8%EA%B8%B0'),
(13, 13, 'MG', '2005-10-01', 4000, 'RX-178 Gundam Mk-II v2.0', 'http://ipsumimage.appspot.com/200x150,8f8fff?s=24&l=RX-178%7CGundam%20Mk-II%7Cv2.0'),
(14, 14, 'HGUC', '2007-03-01', 1600, 'MS-14A/C Gelgoog/Gelgoog Cannon', 'http://ipsumimage.appspot.com/200x150,8f8f2f?s=24&l=MS-14A/C%7CGelgoog/%7CGelgoog%20Cannon'),
(15, 15, 'HGUC', '2004-04-01', 1200, 'MS-14JG Gelgoog J', 'http://ipsumimage.appspot.com/200x150,ff8f2f?s=24&l=MS-14JG%7CGelgoog%20J'),
(16, 16, 'SD', '2000-02-01', 500, 'Gogg/Acguy/Zock', 'http://ipsumimage.appspot.com/200x150,8f7fff?s=24&l=Gogg%7CAcguy%7CZock'),
(17, 17, 'MG', '2006-02-01', 2800, 'MSA-003 Nemo', 'http://ipsumimage.appspot.com/200x150,7fff8f?s=24&l=MSA-003%20Nemo'),
(18, 18, 'SD', '2000-08-01', 500, 'Nu Gundam', 'http://ipsumimage.appspot.com/200x150,ffffaf?s=24&l=Nu%20Gundam'),
(19, 19, 'SEED 1/100', '2006-06-01', 2600, 'ZGMF-X666S Legend Gundam', 'http://ipsumimage.appspot.com/200x150,dfdfef?s=24&l=ZGMF-X666S%7CLegend%20Gundam'),
(20, 20, 'HGUC', '2002-08-01', 1200, 'RMS-099 Rick Dias - 샤아전용', 'http://ipsumimage.appspot.com/200x150,df2f3f?s=24&l=RMS-099%7CRick%20Dias%20%EC%83%A4%EC%95%84%EC%A0%84%EC%9A%A9'),
(21, 21, 'HGUC', '2005-01-01', 1400, 'RMS-108 Marasai', 'http://ipsumimage.appspot.com/200x150,ff5f5f?s=24&l=RMS-108%7CMarasai'),
(22, 22, 'SEED HG', '2006-08-01', 1600, 'GAT-X103AP Verde Buster Gundam', 'http://ipsumimage.appspot.com/200x150,7fffaf?s=24&l=GAT-X103AP%7CVerde%20Buster%7CGundam'),
(23, 23, 'SEED 1/100', '2005-06-01', 2600, 'ZGMF-1001/M Blaze Zaku Phantom - 하이네 전용기', 'http://ipsumimage.appspot.com/200x150,dfdf3f?s=24&l=%7CZGMF-1001/M%7CBlaze%20Zaku%7CPhantom%7C%ED%95%98%EC%9D%B4%EB%84%A4%20%EC%A0%84%EC%9A%A9%EA%B8%B0'),
(24, 24, 'SD', '2003-02-01', 500, 'Strike Gundam', 'http://ipsumimage.appspot.com/200x150,dfdfdf?s=24&l=Strike%20Gundam'),
(25, 25, 'SD', '2003-04-01', 500, 'Gundam Astray - Red Frame', 'http://ipsumimage.appspot.com/200x150,df6f4f?s=24&l=Gundam%20Astray%7CRed%20Frame'),
(26, 26, 'SD', '2004-11-01', 500, 'Gundam NT-1', 'http://ipsumimage.appspot.com/200x150,4f4fdf?s=24&l=Gundam%20NT-1'),
(27, 27, 'HGUC', '2006-06-01', 1400, 'EMS-10 Zudah', 'http://ipsumimage.appspot.com/200x150,bfbfef?s=24&l=EMS-10%7CZudah'),
(28, 28, 'MG', '2001-01-01', 4000, 'MS-18E Kämpfer', 'http://ipsumimage.appspot.com/200x150,3f3fef?s=24&l=EMS-18E%7CK%C3%A4mpfer'),
(29, 29, 'HGUC', '2006-08-01', 1200, 'RGM-79 Powered GM', 'http://ipsumimage.appspot.com/200x150,ff8f4f?s=24&l=RGM-79%7CPowered%20GM'),
(30, 30, 'SD', '2003-11-01', 500, 'Freedom Gundam', 'http://ipsumimage.appspot.com/200x150,dfdfff?s=24&l=Freedom%20Gundam'),

(31, 1, 'SD', '1999-10-01', 500, 'RX-78 Gundam', 'http://ipsumimage.appspot.com/200x150,dfdfdf?s=24&l=RX-78%7CGundam'),
(32, 5, 'HGUC', '2003-09-01', 1000, 'MS-06 Zaku II - 양산형', 'http://ipsumimage.appspot.com/200x150,3fef3f?s=24&l=%7CMS-06%7CZaku%20II%7C%EC%96%91%EC%82%B0%ED%98%95g'),
(33, 5, 'SD', '2001-07-01', 500, 'MS-06F Zaku II', 'http://ipsumimage.appspot.com/200x150,2fff2f?s=24&l=MS-06F%7CZaku%20II'),
(34, 6, 'SD', '2002-03-01', 500, 'MS-06S Zaku II 샤아전용', 'http://ipsumimage.appspot.com/200x150,ff2f2f?s=24&l=%7CMS-06S%7CZaku%20II%7C%EC%83%A4%EC%95%84%EC%A0%84%EC%9A%A9'),
(35, 7, 'SD', '2000-05-01', 400, 'Dom', 'http://ipsumimage.appspot.com/200x150,3f3f3f?s=24&l=Dom'),
(36, 11, 'SD', '2005-07-01', 600, 'Gunner Zaku Warrior', 'http://ipsumimage.appspot.com/200x150,ff3f3f?s=24&l=Gunner%20Zaku%7CWarrior'),
(37, 13, 'SD', '2001-06-01', 500, 'Gundam Mk-II Titans', 'http://ipsumimage.appspot.com/200x150,3f3fff?s=24&l=Gundam%20Mk-II%7CTitans'),
(38, 18, 'HGUC', '2008-03-01', 2500, 'RX-93 υ Gundam', 'http://ipsumimage.appspot.com/200x150,dfdf33?s=24&l=RX-93%7C%CF%85%20Gundam'),
(39, 22, 'SD', '2007-04-01', 600, 'Verde Buster Gundam', 'http://ipsumimage.appspot.com/200x150,7fff6f?s=24&l=Verde%20Buster%7CGundam'),
(40, 23, 'SD', '2007-07-01', 600, 'Blaze Zaku Phantom (Heine Custom)', 'http://ipsumimage.appspot.com/200x150,ffff2f?s=24&l=Blaze%20Zaku%7CPhantom%7C(Heine%20Custom)'),
(41, 25, 'SEED HG', '2003-11-01', 1200, 'MBF-P02 Gundam Astray Red Frame', 'http://ipsumimage.appspot.com/200x150,ff4f2f?s=24&l=MBF-P02%7CGundam%20Astray%7CRed%20Frame');


INSERT INTO image (id, gunpla_id, filename, description) VALUES
(null, 1, 'gundam.png', '세로로 긴 이미지'),
(null, 31, '건담.jpg', '귀여운 SD'),
(null, 1, '건담mg.jpg', '파스텔 톤 좋아'),
(null, 1, '건담mg2.jpg', '옆 모습도 멋지군'),
(null, 1, '건담mg3.jpg', '멋있는 MG'),
(null, 1, '건담mg4.jpg', 'mg3 파일을 세로로 길게 crop'),
(null, 2, '건캐논.jpg', 'SD의 위용'),
(null, 2, '건캐논2.jpg', '앙증맞은 SD'),
(null, 3, '건탱크.jpg', 'SD에 투명 파츠까지'),
(null, 3, '건탱크2.jpg', 'SD 위화감이 없어'),
(null, 4, '짐mini.jpg', '어 이거 SD 아닌데'),
(null, 5, '자쿠IImg.jpg', '육중한 위압감'),
(null, 5, '자쿠IImg2.jpg', '구 버전이라도 멋지다'),
(null, 5, '자쿠IImg3.jpg', '역시 모노아이'),
(null, 32, '자쿠II.jpg', 'HGUC 자쿠II'),
(null, 33, '자쿠IIsd.jpg', 'SD지만 육중함은 그대로'),
(null, 6, '자쿠II샤아전용.jpg', '3배 빠른 자쿠'),
(null, 34, '자쿠II샤아전용sd.jpg', '귀엽고 3배 빠른 자쿠'),
(null, 7, '돔.jpg', '튼튼한 돔'),
(null, 35, '릭돔sd.jpg', '이거 릭돔이 아니고 돔이었구나'),
(null, 8, '릭돔.jpg', '릭돔은 볼륨감이 좋아서 전체 샷이 멋진데'),
(null, 9, '즈고크E.jpg', '카리스마 짱'),
(null, 9, '즈고크E.jpg', '숨겨진 보물같은 킷'),
(null, 10, '모빌씨그.jpg', '전설의 야수와 같은 모습'),
(null, 11, '건너자쿠워리어.jpg', '독일군 헬멧'),
(null, 36, '건너자쿠워리어sd.jpg', 'SD가 더 근엄한 듯'),
(null, 36, '건너자쿠워리어sd2.jpg', 'SD지만 전투력이 높을 듯'),
(null, 36, '건너자쿠워리어sd3.jpg', '의기 양양'),
(null, 12, '건담5호기.jpg', '알록달록 이쁘다'),
(null, 12, '건담5호기2.jpg', '기대하지 않았는데 만족도가 높았던 킷'),
(null, 12, '건담5호기3.jpg', '얼굴도 알록달록'),
(null, 12, '건담5호기4.jpg', '너무 멋져~'),
(null, 13, '건담Mk-II에우고.jpg', '강렬한 눈빛'),
(null, 13, '건담Mk-II에우고2.jpg', '헤드폰 착용샷'),
(null, 37, '건담Mk-II티탄즈.jpg', 'SD에서 박력이 느껴져'),
(null, 37, '건담Mk-II티탄즈2.jpg', '흔치 않은 컬러'),
(null, 37, '건담Mk-II티탄즈미니.jpg', '이건 SD 아닌데'),
(null, 14, '겔구그.jpg', '멧돼지'),
(null, 15, '겔구그예거.jpg', '울퉁불퉁 멋진 킷'),
(null, 15, '겔구그예거2.jpg', '전투력 높을 것 같아'),
(null, 16, '고그.jpg', '해산물 3종 세트 중 하나. 너무 귀여워'),
(null, 17, '네모.jpg', '만족도 엄청 높았던 킷. 또 하나의 숨겨진 보물'),
(null, 18, '뉴건담sd.jpg', '인기 높은 뉴건담. 뉴건담이야 누 건담이야'),
(null, 18, '뉴건담sd2.jpg', '체구에 비해 큰 백팩'),
(null, 38, '뉴건담.jpg', '먹선을 너무 흐리게 넣었나'),
(null, 19, '레전드건담.jpg', '무등급이지만 박력있는 백팩'),
(null, 20, '릭디아스샤아전용.jpg', '사진빨 안받네'),
(null, 21, '마라사이.jpg', '이 킷도 좋았음'),
(null, 22, '베르데버스터건담.jpg', '그저 그런'),
(null, 39, '베르데버스터건담sd.jpg', 'SD가 HGUC보다 박력있다'),
(null, 23, '블레이즈자쿠팬텀.jpg', '무등급이지만 좋다'),
(null, 40, '블레이즈자쿠팬텀sd.jpg', '먹선 안 넣어도 멋져'),
(null, 40, '블레이즈자쿠팬텀sd2.jpg', '쌍도끼. 어쎄신 크리드 발할라 찍냐'),
(null, 24, '스트라이크건담.jpg', '스트라이크 건담은 모든 등급이 다 잘 뽑힌듯'),
(null, 24, '스트라이크건담2.jpg', '너무 가까워'),
(null, 24, '스트라이크건담3.jpg', 'SD치고는 롱다리'),
(null, 25, '아스트레이레드sd.jpg', 'SD 얼굴 귀여워'),
(null, 41, '아스트레이레드.jpg', '독특한 근육 몸매. 가동률 좋음'),
(null, 26, '알렉스.jpg', '주머니 속의 전쟁 주인공 기체'),
(null, 26, '알렉스2.jpg', '개틀링 건도 장착 가능'),
(null, 27, '주다.jpg', '개성 만점. 강추'),
(null, 28, '캠퍼.jpg', '건담이 아닌 다른 애니메이션에 등장할 법한 특이한 외형이지만 좋다. 버니어 색분할 압권'),
(null, 29, '파워드짐.jpg', '폭죽이라 놀리지 마라'),
(null, 29, '파워드짐2.jpg', '심플한 매력'),
(null, 30, '프리덤건담.jpg', '인기 많은 기체'),
(null, 30, '프리덤건담2.jpg', 'MG의 화려함을 따라가기엔 부족'),
(null, 30, '프리덤건담3.jpg', '인기 많은 기체 답게 뭐가 많이 달려있다');

Chap.04. Select

CoLab

https://colab.research.google.com/drive/1hOrefbnFaQTHijuI7lN49tuISirxD4Ot

https://bit.ly/38tRvYo

데이터베이스 구축

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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
DROP DATABASE IF EXISTS `gunpladb` ;

CREATE DATABASE IF NOT EXISTS `gunpladb`
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;

USE `gunpladb` ;

CREATE TABLE `mechanic` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(255) NOT NULL,
`model` VARCHAR(100) NOT NULL,
`manufacturer` VARCHAR(255) NULL,
`armor` VARCHAR(255) NULL,
`height` DECIMAL(7,2) NULL,
`weight` DECIMAL(7,2) NULL,
PRIMARY KEY (`id`)
) ENGINE = InnoDB
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;

CREATE TABLE `gunpla` (
`id` INT NOT NULL AUTO_INCREMENT,
`mechanic_id` INT NOT NULL,
`grade` VARCHAR(45) NOT NULL,
`date` DATE NULL,
`price` INT(11) NULL,
`title` VARCHAR(255) NULL,
`boxart` VARCHAR(2083) NULL,
PRIMARY KEY (`id`),
INDEX (`mechanic_id`),
FOREIGN KEY (`mechanic_id`) REFERENCES `mechanic` (`id`)
ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;

CREATE TABLE `image` (
`id` INT NOT NULL AUTO_INCREMENT,
`gunpla_id` INT NOT NULL,
`filename` VARCHAR(255) NOT NULL,
`description` TEXT NULL,
PRIMARY KEY (`id`),
INDEX (`gunpla_id`),
FOREIGN KEY (`gunpla_id`) REFERENCES `gunpla` (`id`)
ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;

CREATE TABLE `armament` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(255) NULL,
`description` TEXT NULL,
`image` VARCHAR(2083) NULL,
PRIMARY KEY (`id`)
) ENGINE = InnoDB
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;

CREATE TABLE `equipment` (
`mechanic_id` INT NOT NULL,
`armaments_id` INT NOT NULL,
PRIMARY KEY (`mechanic_id`, `armaments_id`),
INDEX (`armaments_id`),
FOREIGN KEY (`mechanic_id`) REFERENCES `mechanic` (`id`)
ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY (`armaments_id`) REFERENCES `armament` (`id`)
ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;

CREATE TABLE `pilot` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(255) NOT NULL,
`alias` VARCHAR(255) NULL,
`type` VARCHAR(100) NULL,
`nationality` VARCHAR(100) NULL,
`image` VARCHAR(2083) NULL,
PRIMARY KEY (`id`)
) ENGINE = InnoDB
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;

CREATE TABLE `boarding` (
`mechanic_id` INT NOT NULL,
`pilot_id` INT NOT NULL,
PRIMARY KEY (`mechanic_id`, `pilot_id`),
INDEX (`pilot_id`),
FOREIGN KEY (`mechanic_id`) REFERENCES `mechanic` (`id`)
ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY (`pilot_id`) REFERENCES `pilot` (`id`)
ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;


###############################################

INSERT INTO mechanic (id, name, model, manufacturer, armor, height, weight) VALUES
(1, '건담', 'RX-78-2', 'Earth Federation', 'Luna Titanium', 18.0, 43.4),
(2, '건캐논', 'RX-77-2', 'Earth Federation', 'Luna Titanium', 17.5, 51.0),
(3, '건탱크', 'RX-75', 'Earth Federation', 'Luna Titanium', 15.0, 56.0),
(4, '짐', 'RGM-79', 'Earth Federation Forces', 'Titanium Alloy', 18.0, 41.2),
(5, '자쿠 II', 'MS-06F', 'Zeonic Company', 'Super Hard Steel Alloy', 17.5, 58.1),
(6, '샤아 전용 자쿠 II', 'MS-06S', 'Zeonic Company', 'Super Hard Steel Alloy', 17.5, 56.5),
(7, '돔', 'MS-09B', 'Zimmad Company', 'Super Hard Steel Alloy', 18.6, 62.6),
(8, '릭 돔', 'MS-09R', 'Zimmad Company', 'Super Hard Steel Alloy', 18.6, 43.8),
(9, '즈고크 E', 'MSM-07E', 'MIP Company', 'Titanium Alloy Ceramic Composite', 18.4, 69.5),
(10, '씨그', 'ZGMF-515', 'Zodiac Alliance of Freedom Treaty', null, 21.43, 80.22),
(11, '거너 자쿠 워리어', 'ZGMF-1000/A1', 'Integrated Design Bureau', null, 20.50, 91.11),
(12, '건담 5호기', 'RX-78-5', 'Earth Federation', 'Luna Titanium', 18.0, 42.9),
(13, '건담 Mk-II', 'RX-178', 'Titans', 'Titanium Alloy Ceramic Composite', 18.5, 33.4),
(14, '겔구그', 'MS-14A/C', 'Zeonic Company', 'Super Hard Steel Alloy', 19.2, 42.1),
(15, '겔구그 예거', 'MS-14Jg', 'Zeonic Company', 'Titanium Alloy Ceramic Composite', 19.2, 40.5),
(16, '고그', 'MSM-03', 'Zimmad Company', 'Super High Tensile Steel', 18.3, 82.4),
(17, '네모', 'MSA-003', 'Anaheim Electronics', 'Gundarium α Alloy', 18.5, 36.2),
(18, '뉴건담', 'RX-93', 'Anaheim Electronics', 'Gundarium α Alloy', 18.5, 36.2),
(19, '레전드 건담', 'ZGMF-X666S', 'Zodiac Alliance of Freedom Treaty', 'Variable Phase Shift armor', 18.66, 86.02),
(20, '릭디아스', 'RMS-099', 'Anaheim Electronics', 'Gundarium γ Alloy', 18.0, 32.2),
(21, '마라사이', 'RMS-108', 'Anaheim Electronics', 'Gundarium Alloy', 17.5, 33.1),
(22, '베르데 버스터 건담', 'GAT-X103AP', 'Actaeon Industries', 'Variable Phase Shift Armor', 18.46, 99.36),
(23, '블레이즈 자쿠 팬텀', 'ZGMF-1001/M', 'Integrated Design Bureau', null, 20.4, 91.2),
(24, '스트라이크 건담', 'GAT-X105', 'Earth Alliance', 'Phase Shift Armor', 17.72, 64.8),
(25, '건담 아스트레이 레드 프레임', 'MBF-P02', 'Morgenroete, Inc.', 'Foaming metal', 17.53, 49.8),
(26, '알렉스', 'RX-78NT-1', 'Earth Federation', 'Luna Titanium', 18.0, 40.0),
(27, '주다', 'EMS-10', 'Zimmad Company', 'Hardened Steel', 17.3, 61.0),
(28, '캠퍼', 'MS-18E', 'Zeonic Company', 'Titanium Alloy Ceramic Composite', 17.7, 43.5),
(29, '파워드 짐', 'RGM-79', 'Earth Federation', 'Titanium Ceramic Composite', 18.0, 46.6),
(30, '프리덤 건담', 'ZGMF-X10A', 'Integrated Design Bureau', 'Phase Shift Armor', 18.03, 71.5);

INSERT INTO gunpla (id, mechanic_id, grade, date, price, title, boxart) VALUES
(1, 1, 'MG', '2005-03-01', 3200, 'RX-78-2 Gundam ver. O.Y.W 0079 (PS2 soft)', 'http://ipsumimage.appspot.com/200x150,dfdfdf?s=24&l=RX-78-2%20Gundam%7Cver.%20O.Y.W%200079%7C(PS2%20soft)'),
(2, 2, 'SD', '2001-11-01', 500, 'Gun Cannon', 'http://ipsumimage.appspot.com/200x150,ffff3f?s=24&l=Gun%20Cannon'),
(3, 3, 'SD', '2001-08-01', 500, 'Gun Tank', 'http://ipsumimage.appspot.com/200x150,ffff72?s=24&l=Gun%20Tank'),
(4, 4, 'SD', '2001-04-01', 700, 'GM', 'http://ipsumimage.appspot.com/200x150,ffffd7?s=24&l=GM'),
(5, 5, 'MG', '2002-09-01', 3000, 'MS-06F2 Zaku II F2 : EFSF 연방군형', 'http://ipsumimage.appspot.com/200x150,3fef3f?s=24&l=%7CMS-06F2%7CZaku%20II%20F2%7CEFSF%20%EC%97%B0%EB%B0%A9%EA%B5%B0%ED%98%95'),
(6, 6, 'RG', '2010-11-01', 2500, "MS-06S Char's Zaku II", 'http://ipsumimage.appspot.com/200x150,7f7fff?s=24&l=MS-06S%7CChar%27s%20Zaku%20II'),
(7, 7, 'HGUC', '2006-01-01', 1700, 'MS-09/MS-09R Dom/Rick-Dom', 'http://ipsumimage.appspot.com/200x150,9f7fd2?s=24&l=MS-09%7CMS-09R%20Dom%7CRick-Dom'),
(8, 8, 'MG', '1999-10-01', 4000, 'MS-09R Rick-Dom', 'http://ipsumimage.appspot.com/200x150,ff7fd2?s=24&l=MS-09R%7CRick-Dom'),
(9, 9, 'HGUC', '2003-08-01', 1200, "MSM-07E Z'gok Experiment", 'http://ipsumimage.appspot.com/200x150,6f7fff?s=24&l=MSM-07E%7CZ%27gok%20Experiment'),
(10, 10, 'SEED HG', '2004-04-01', 1200, 'ZGMF-515 Mobile Cgue', 'http://ipsumimage.appspot.com/200x150,afafaf?s=24&l=ZGMF-515%7CMobile%20Cgue'),
(11, 11, 'SEED 1/100', '2005-03-01', 2300, 'ZGMF-1000/A1 Gunner Zaku Warrior - 루나마리아 전용', 'http://ipsumimage.appspot.com/200x150,ff4f4f?s=24&l=ZGMF-1000/A1%7CGunner%20Zaku%7CWarrior%7C%EB%A3%A8%EB%82%98%EB%A7%88%EB%A6%AC%EC%95%84%7C%EC%A0%84%EC%9A%A9'),
(12, 12, 'MG', '2003-08-01', 2800, 'RX-78-5 Gundam 5호기', 'http://ipsumimage.appspot.com/200x150,ffff4f?s=24&l=RX-78-5%7CGundam%205%ED%98%B8%EA%B8%B0'),
(13, 13, 'MG', '2005-10-01', 4000, 'RX-178 Gundam Mk-II v2.0', 'http://ipsumimage.appspot.com/200x150,8f8fff?s=24&l=RX-178%7CGundam%20Mk-II%7Cv2.0'),
(14, 14, 'HGUC', '2007-03-01', 1600, 'MS-14A/C Gelgoog/Gelgoog Cannon', 'http://ipsumimage.appspot.com/200x150,8f8f2f?s=24&l=MS-14A/C%7CGelgoog/%7CGelgoog%20Cannon'),
(15, 15, 'HGUC', '2004-04-01', 1200, 'MS-14JG Gelgoog J', 'http://ipsumimage.appspot.com/200x150,ff8f2f?s=24&l=MS-14JG%7CGelgoog%20J'),
(16, 16, 'SD', '2000-02-01', 500, 'Gogg/Acguy/Zock', 'http://ipsumimage.appspot.com/200x150,8f7fff?s=24&l=Gogg%7CAcguy%7CZock'),
(17, 17, 'MG', '2006-02-01', 2800, 'MSA-003 Nemo', 'http://ipsumimage.appspot.com/200x150,7fff8f?s=24&l=MSA-003%20Nemo'),
(18, 18, 'SD', '2000-08-01', 500, 'Nu Gundam', 'http://ipsumimage.appspot.com/200x150,ffffaf?s=24&l=Nu%20Gundam'),
(19, 19, 'SEED 1/100', '2006-06-01', 2600, 'ZGMF-X666S Legend Gundam', 'http://ipsumimage.appspot.com/200x150,dfdfef?s=24&l=ZGMF-X666S%7CLegend%20Gundam'),
(20, 20, 'HGUC', '2002-08-01', 1200, 'RMS-099 Rick Dias - 샤아전용', 'http://ipsumimage.appspot.com/200x150,df2f3f?s=24&l=RMS-099%7CRick%20Dias%20%EC%83%A4%EC%95%84%EC%A0%84%EC%9A%A9'),
(21, 21, 'HGUC', '2005-01-01', 1400, 'RMS-108 Marasai', 'http://ipsumimage.appspot.com/200x150,ff5f5f?s=24&l=RMS-108%7CMarasai'),
(22, 22, 'SEED HG', '2006-08-01', 1600, 'GAT-X103AP Verde Buster Gundam', 'http://ipsumimage.appspot.com/200x150,7fffaf?s=24&l=GAT-X103AP%7CVerde%20Buster%7CGundam'),
(23, 23, 'SEED 1/100', '2005-06-01', 2600, 'ZGMF-1001/M Blaze Zaku Phantom - 하이네 전용기', 'http://ipsumimage.appspot.com/200x150,dfdf3f?s=24&l=%7CZGMF-1001/M%7CBlaze%20Zaku%7CPhantom%7C%ED%95%98%EC%9D%B4%EB%84%A4%20%EC%A0%84%EC%9A%A9%EA%B8%B0'),
(24, 24, 'SD', '2003-02-01', 500, 'Strike Gundam', 'http://ipsumimage.appspot.com/200x150,dfdfdf?s=24&l=Strike%20Gundam'),
(25, 25, 'SD', '2003-04-01', 500, 'Gundam Astray - Red Frame', 'http://ipsumimage.appspot.com/200x150,df6f4f?s=24&l=Gundam%20Astray%7CRed%20Frame'),
(26, 26, 'SD', '2004-11-01', 500, 'Gundam NT-1', 'http://ipsumimage.appspot.com/200x150,4f4fdf?s=24&l=Gundam%20NT-1'),
(27, 27, 'HGUC', '2006-06-01', 1400, 'EMS-10 Zudah', 'http://ipsumimage.appspot.com/200x150,bfbfef?s=24&l=EMS-10%7CZudah'),
(28, 28, 'MG', '2001-01-01', 4000, 'MS-18E Kämpfer', 'http://ipsumimage.appspot.com/200x150,3f3fef?s=24&l=EMS-18E%7CK%C3%A4mpfer'),
(29, 29, 'HGUC', '2006-08-01', 1200, 'RGM-79 Powered GM', 'http://ipsumimage.appspot.com/200x150,ff8f4f?s=24&l=RGM-79%7CPowered%20GM'),
(30, 30, 'SD', '2003-11-01', 500, 'Freedom Gundam', 'http://ipsumimage.appspot.com/200x150,dfdfff?s=24&l=Freedom%20Gundam'),

(31, 1, 'SD', '1999-10-01', 500, 'RX-78 Gundam', 'http://ipsumimage.appspot.com/200x150,dfdfdf?s=24&l=RX-78%7CGundam'),
(32, 5, 'HGUC', '2003-09-01', 1000, 'MS-06 Zaku II - 양산형', 'http://ipsumimage.appspot.com/200x150,3fef3f?s=24&l=%7CMS-06%7CZaku%20II%7C%EC%96%91%EC%82%B0%ED%98%95g'),
(33, 5, 'SD', '2001-07-01', 500, 'MS-06F Zaku II', 'http://ipsumimage.appspot.com/200x150,2fff2f?s=24&l=MS-06F%7CZaku%20II'),
(34, 6, 'SD', '2002-03-01', 500, 'MS-06S Zaku II 샤아전용', 'http://ipsumimage.appspot.com/200x150,ff2f2f?s=24&l=%7CMS-06S%7CZaku%20II%7C%EC%83%A4%EC%95%84%EC%A0%84%EC%9A%A9'),
(35, 7, 'SD', '2000-05-01', 400, 'Dom', 'http://ipsumimage.appspot.com/200x150,3f3f3f?s=24&l=Dom'),
(36, 11, 'SD', '2005-07-01', 600, 'Gunner Zaku Warrior', 'http://ipsumimage.appspot.com/200x150,ff3f3f?s=24&l=Gunner%20Zaku%7CWarrior'),
(37, 13, 'SD', '2001-06-01', 500, 'Gundam Mk-II Titans', 'http://ipsumimage.appspot.com/200x150,3f3fff?s=24&l=Gundam%20Mk-II%7CTitans'),
(38, 18, 'HGUC', '2008-03-01', 2500, 'RX-93 υ Gundam', 'http://ipsumimage.appspot.com/200x150,dfdf33?s=24&l=RX-93%7C%CF%85%20Gundam'),
(39, 22, 'SD', '2007-04-01', 600, 'Verde Buster Gundam', 'http://ipsumimage.appspot.com/200x150,7fff6f?s=24&l=Verde%20Buster%7CGundam'),
(40, 23, 'SD', '2007-07-01', 600, 'Blaze Zaku Phantom (Heine Custom)', 'http://ipsumimage.appspot.com/200x150,ffff2f?s=24&l=Blaze%20Zaku%7CPhantom%7C(Heine%20Custom)'),
(41, 25, 'SEED HG', '2003-11-01', 1200, 'MBF-P02 Gundam Astray Red Frame', 'http://ipsumimage.appspot.com/200x150,ff4f2f?s=24&l=MBF-P02%7CGundam%20Astray%7CRed%20Frame');


INSERT INTO image (id, gunpla_id, filename, description) VALUES
(null, 1, 'gundam.png', '세로로 긴 이미지'),
(null, 31, '건담.jpg', '귀여운 SD'),
(null, 1, '건담mg.jpg', '파스텔 톤 좋아'),
(null, 1, '건담mg2.jpg', '옆 모습도 멋지군'),
(null, 1, '건담mg3.jpg', '멋있는 MG'),
(null, 1, '건담mg4.jpg', 'mg3 파일을 세로로 길게 crop'),
(null, 2, '건캐논.jpg', 'SD의 위용'),
(null, 2, '건캐논2.jpg', '앙증맞은 SD'),
(null, 3, '건탱크.jpg', 'SD에 투명 파츠까지'),
(null, 3, '건탱크2.jpg', 'SD 위화감이 없어'),
(null, 4, '짐mini.jpg', '어 이거 SD 아닌데'),
(null, 5, '자쿠IImg.jpg', '육중한 위압감'),
(null, 5, '자쿠IImg2.jpg', '구 버전이라도 멋지다'),
(null, 5, '자쿠IImg3.jpg', '역시 모노아이'),
(null, 32, '자쿠II.jpg', 'HGUC 자쿠II'),
(null, 33, '자쿠IIsd.jpg', 'SD지만 육중함은 그대로'),
(null, 6, '자쿠II샤아전용.jpg', '3배 빠른 자쿠'),
(null, 34, '자쿠II샤아전용sd.jpg', '귀엽고 3배 빠른 자쿠'),
(null, 7, '돔.jpg', '튼튼한 돔'),
(null, 35, '릭돔sd.jpg', '이거 릭돔이 아니고 돔이었구나'),
(null, 8, '릭돔.jpg', '릭돔은 볼륨감이 좋아서 전체 샷이 멋진데'),
(null, 9, '즈고크E.jpg', '카리스마 짱'),
(null, 9, '즈고크E.jpg', '숨겨진 보물같은 킷'),
(null, 10, '모빌씨그.jpg', '전설의 야수와 같은 모습'),
(null, 11, '건너자쿠워리어.jpg', '독일군 헬멧'),
(null, 36, '건너자쿠워리어sd.jpg', 'SD가 더 근엄한 듯'),
(null, 36, '건너자쿠워리어sd2.jpg', 'SD지만 전투력이 높을 듯'),
(null, 36, '건너자쿠워리어sd3.jpg', '의기 양양'),
(null, 12, '건담5호기.jpg', '알록달록 이쁘다'),
(null, 12, '건담5호기2.jpg', '기대하지 않았는데 만족도가 높았던 킷'),
(null, 12, '건담5호기3.jpg', '얼굴도 알록달록'),
(null, 12, '건담5호기4.jpg', '너무 멋져~'),
(null, 13, '건담Mk-II에우고.jpg', '강렬한 눈빛'),
(null, 13, '건담Mk-II에우고2.jpg', '헤드폰 착용샷'),
(null, 37, '건담Mk-II티탄즈.jpg', 'SD에서 박력이 느껴져'),
(null, 37, '건담Mk-II티탄즈2.jpg', '흔치 않은 컬러'),
(null, 37, '건담Mk-II티탄즈미니.jpg', '이건 SD 아닌데'),
(null, 14, '겔구그.jpg', '멧돼지'),
(null, 15, '겔구그예거.jpg', '울퉁불퉁 멋진 킷'),
(null, 15, '겔구그예거2.jpg', '전투력 높을 것 같아'),
(null, 16, '고그.jpg', '해산물 3종 세트 중 하나. 너무 귀여워'),
(null, 17, '네모.jpg', '만족도 엄청 높았던 킷. 또 하나의 숨겨진 보물'),
(null, 18, '뉴건담sd.jpg', '인기 높은 뉴건담. 뉴건담이야 누 건담이야'),
(null, 18, '뉴건담sd2.jpg', '체구에 비해 큰 백팩'),
(null, 38, '뉴건담.jpg', '먹선을 너무 흐리게 넣었나'),
(null, 19, '레전드건담.jpg', '무등급이지만 박력있는 백팩'),
(null, 20, '릭디아스샤아전용.jpg', '사진빨 안받네'),
(null, 21, '마라사이.jpg', '이 킷도 좋았음'),
(null, 22, '베르데버스터건담.jpg', '그저 그런'),
(null, 39, '베르데버스터건담sd.jpg', 'SD가 HGUC보다 박력있다'),
(null, 23, '블레이즈자쿠팬텀.jpg', '무등급이지만 좋다'),
(null, 40, '블레이즈자쿠팬텀sd.jpg', '먹선 안 넣어도 멋져'),
(null, 40, '블레이즈자쿠팬텀sd2.jpg', '쌍도끼. 어쎄신 크리드 발할라 찍냐'),
(null, 24, '스트라이크건담.jpg', '스트라이크 건담은 모든 등급이 다 잘 뽑힌듯'),
(null, 24, '스트라이크건담2.jpg', '너무 가까워'),
(null, 24, '스트라이크건담3.jpg', 'SD치고는 롱다리'),
(null, 25, '아스트레이레드sd.jpg', 'SD 얼굴 귀여워'),
(null, 41, '아스트레이레드.jpg', '독특한 근육 몸매. 가동률 좋음'),
(null, 26, '알렉스.jpg', '주머니 속의 전쟁 주인공 기체'),
(null, 26, '알렉스2.jpg', '개틀링 건도 장착 가능'),
(null, 27, '주다.jpg', '개성 만점. 강추'),
(null, 28, '캠퍼.jpg', '건담이 아닌 다른 애니메이션에 등장할 법한 특이한 외형이지만 좋다. 버니어 색분할 압권'),
(null, 29, '파워드짐.jpg', '폭죽이라 놀리지 마라'),
(null, 29, '파워드짐2.jpg', '심플한 매력'),
(null, 30, '프리덤건담.jpg', '인기 많은 기체'),
(null, 30, '프리덤건담2.jpg', 'MG의 화려함을 따라가기엔 부족'),
(null, 30, '프리덤건담3.jpg', '인기 많은 기체 답게 뭐가 많이 달려있다');