 );
 
 CREATE TABLE product (
-  id INTEGER PRIMARY KEY,
+  id INTEGER AUTO_INCREMENT PRIMARY KEY,
   identifier TEXT NOT NULL,
   type INTEGER NOT NULL,
   production_id INTEGER NOT NULL,

-- Meta data for a production
-- see http://www.daisy.org/z3986/2005/Z3986-2005.html#PubMed
CREATE TABLE production (
  id INTEGER PRIMARY KEY,
  title TEXT,
  creator TEXT,
  subject TEXT,
  description TEXT,
  publisher TEXT,
  date TEXT,
  type TEXT,
  format TEXT,
  identifier TEXT,
  source TEXT,
  language TEXT,
  rights TEXT,
  source_date TEXT,
  source_edition TEXT,

  -- Number of levels
  depth INTEGER,
  -- SBS specific columns
  state INTEGER  NOT NULL DEFAULT 0,
  -- production number given by the erp system. We should really use
  -- this as the primary key but alas some productions are done
  -- without involving the erp system, so we need to keep our own
