(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: create_host.ml,v 1.4 2004/09/25 11:45:59 rich Exp $
+ * $Id: create_host.ml,v 1.6 2004/10/04 14:46:51 rich Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
)
) (List.combine names row);
+ (* Force new host.is_template field to false. *)
+ let sth =
+ dbh#prepare_cached
+ "update hosts set is_template = false where id = ?" in
+ sth#execute [`Int hostid];
+
(* Copy pages. *)
let sth =
dbh#prepare_cached
let sth =
dbh#prepare_cached
"insert into contact_emails (contactid, email)
- select (select contactid from contacts
+ select (select id from contacts
where hostid = ? and name = c.name), ce.email
from contact_emails ce, contacts c
where ce.contactid = c.id and c.hostid = ?" in