
CREATE TABLE IF NOT EXISTS  "lists" (
	"id" INTEGER PRIMARY KEY AUTOINCREMENT, 
	"list" TEXT, 
	"slug" TEXT, 
	"media" TEXT, 
	"sync" INTEGER DEFAULT (1), 
	UNIQUE (slug, media) ON CONFLICT IGNORE
);

CREATE TABLE IF NOT EXISTS "list_movies" (
	"id" INTEGER PRIMARY KEY AUTOINCREMENT, 
	"list_id" INTEGER, 
	"imdb_id" TEXT, 
	"path" TEXT
);

CREATE TABLE IF NOT EXISTS "hosts" (
	"id" INTEGER PRIMARY KEY AUTOINCREMENT, 
	"host" TEXT UNIQUE, 
	"title" TEXT, 
	"enabled" INTEGER DEFAULT 1
);

CREATE TABLE IF NOT EXISTS "fetch_count" (
	"id" INTEGER PRIMARY KEY AUTOINCREMENT, 
	"num" INTEGER, 
	"ts" DATE DEFAULT CURRENT_DATE, 
	UNIQUE (ts)  ON CONFLICT REPLACE
);
