 /* Recreate the original table, this time less the temporary columns.
    Column descriptions are same as BASE_NODE in format 12 */
 CREATE TABLE BASE_NODE(
-  wc_id  INTEGER NOT NULL,
-  local_relpath  TEXT NOT NULL,
-  repos_id  INTEGER,
+  wc_id  INTEGER NOT NULL REFERENCES WCROOT (id),
+  local_relpath  TEXT NOT NULL,
+  repos_id  INTEGER REFERENCES REPOSITORY (id),
   repos_relpath  TEXT,
   parent_relpath  TEXT,
   presence  TEXT NOT NULL,


  /* Where this node was copied/moved from. Set only on the root of the
     operation, and implied for all children. */
  copyfrom_repos_id  INTEGER,
  /* ### BH: Should we call this copyfrom_repos_relpath and skip the initial '/'
     ### to match the other repository paths used in sqlite and to make it easier
     ### to join these paths? */


CREATE TABLE ACTUAL_NODE (
  /* specifies the location of this node in the local filesystem */
  wc_id  INTEGER NOT NULL REFERENCES WCROOT (id),
  local_relpath  TEXT NOT NULL,

  /* parent's local_relpath for aggregating children of a given parent.
