-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsql_queries.py
30 lines (27 loc) · 1.47 KB
/
sql_queries.py
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
CREATE_TABLE_CHARACTERS = """CREATE TABLE IF NOT EXISTS characters ("
id INTEGER, name VARCHAR(255),
description TEXT,
modified TIMESTAMP,
PRIMARY KEY(id)
)"""
CREATE_TABLE_COMICS = """CREATE TABLE IF NOT EXISTS comics ("
id INTEGER,
digital_id INTEGER,
character_id INTEGER,
title TEXT,
issue_number INTEGER,
variantDescription TEXT,
description TEXT,
modified TIMESTAMP,
isbn CHARACTER(255),
upc CHARACTER(255),
diamondCode CHARACTER(255),
ean CHARACTER(255),
issn CHARACTER(255),
format CHARACTER(255),
pageCount INTEGER,
PRIMARY KEY (id),
CONSTRAINT fk_charecter FOREIGN KEY(character_id) REFERENCES characters(id)
)"""
INSERT_INTO_CHARACTERS = """INSERT INTO characters VALUES (%s, %s, %s, %s)"""
INSERT_INTO_COMICS = """INSERT INTO comics VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)"""