make author relations and tag relations unique in db schema
This commit is contained in:
parent
c2f516a281
commit
cf66c7db0a
|
@ -101,8 +101,8 @@ async def fetch_async(args):
|
||||||
cur = con.cursor()
|
cur = con.cursor()
|
||||||
|
|
||||||
cur.execute("CREATE TABLE IF NOT EXISTS works(id TEXT PRIMARY KEY, title TEXT, circle TEXT, date TEXT, description TEXT, series TEXT, virtual INT)")
|
cur.execute("CREATE TABLE IF NOT EXISTS works(id TEXT PRIMARY KEY, title TEXT, circle TEXT, date TEXT, description TEXT, series TEXT, virtual INT)")
|
||||||
cur.execute("CREATE TABLE IF NOT EXISTS authors(author TEXT, work TEXT, FOREIGN KEY(work) REFERENCES works(id))")
|
cur.execute("CREATE TABLE IF NOT EXISTS authors(author TEXT, work TEXT, FOREIGN KEY(work) REFERENCES works(id), PRIMARY KEY(author, work))")
|
||||||
cur.execute("CREATE TABLE IF NOT EXISTS tags(tag TEXT, work TEXT, FOREIGN KEY(work) REFERENCES works(id))")
|
cur.execute("CREATE TABLE IF NOT EXISTS tags(tag TEXT, work TEXT, FOREIGN KEY(work) REFERENCES works(id), PRIMARY KEY(tag, work))")
|
||||||
|
|
||||||
thumbnails_dir = args.destdir / 'site' / 'thumbnails'
|
thumbnails_dir = args.destdir / 'site' / 'thumbnails'
|
||||||
thumbnails_dir.mkdir(parents=True, exist_ok=True)
|
thumbnails_dir.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
Loading…
Reference in a new issue