X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=scripts%2Fadmin%2Fcreate_host.ml;h=ff414909179e8654b19f05ac01834be207f67c00;hb=2b332786c6f216c5e2e72cc1596ba4c66b5aa2a4;hp=9f9eab633de69ddbc8059b8ce219cc0f419cb037;hpb=f303d3e2bc355bdca4147d21441d6a13d4748d1a;p=cocanwiki.git diff --git a/scripts/admin/create_host.ml b/scripts/admin/create_host.ml index 9f9eab6..ff41490 100644 --- a/scripts/admin/create_host.ml +++ b/scripts/admin/create_host.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * 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 @@ -107,6 +107,12 @@ let run r = ) ) (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 @@ -164,7 +170,7 @@ let run r = 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