From 363281defc272f4f41774641593a73c5a0c33deb Mon Sep 17 00:00:00 2001 From: rich Date: Thu, 17 Nov 2005 10:14:42 +0000 Subject: [PATCH] Serial columns now 64 bits. --- scripts/create_contact.ml | 4 ++-- scripts/edit_page_css.ml | 4 ++-- scripts/lib/cocanwiki_create_host.ml | 4 ++-- scripts/lib/cocanwiki_pages.ml | 6 +++--- scripts/mail_import.ml | 4 ++-- scripts/restore.ml | 4 ++-- scripts/signup.ml | 4 ++-- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/scripts/create_contact.ml b/scripts/create_contact.ml index 61eebeb..d31be0d 100644 --- a/scripts/create_contact.ml +++ b/scripts/create_contact.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_contact.ml,v 1.3 2005/03/31 14:24:04 rich Exp $ + * $Id: create_contact.ml,v 1.4 2005/11/17 10:14:42 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 @@ -63,7 +63,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid _ _ = values (?, ?, ?)" in sth#execute [`Int hostid; `String name; `String subject]; - let contactid = sth#serial "contacts_id_seq" in + let contactid = Int64.to_int (sth#serial "contacts_id_seq") in let sth = dbh#prepare_cached "insert into contact_emails (contactid, email) values (?, ?)" in diff --git a/scripts/edit_page_css.ml b/scripts/edit_page_css.ml index ab29fa0..4338bc4 100644 --- a/scripts/edit_page_css.ml +++ b/scripts/edit_page_css.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * Copyright (C) 2004 Merjis Ltd. - * $Id: edit_page_css.ml,v 1.16 2005/03/31 14:24:04 rich Exp $ + * $Id: edit_page_css.ml,v 1.17 2005/11/17 10:14:42 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 @@ -79,7 +79,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid {hostname = hostname} user = sth#execute [`Int hostid; `String page; title; description; creation_date; logged_ip; logged_user; redirect; css ]; - let pageid = sth#serial "pages_id_seq" in + let pageid = Int64.to_int (sth#serial "pages_id_seq") in let sth = dbh#prepare_cached "insert into contents (pageid, ordering, sectionname, content, divname) diff --git a/scripts/lib/cocanwiki_create_host.ml b/scripts/lib/cocanwiki_create_host.ml index cfc1819..b72b543 100644 --- a/scripts/lib/cocanwiki_create_host.ml +++ b/scripts/lib/cocanwiki_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: cocanwiki_create_host.ml,v 1.1 2004/10/21 11:42:05 rich Exp $ + * $Id: cocanwiki_create_host.ml,v 1.2 2005/11/17 10:14:43 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 @@ -33,7 +33,7 @@ let create_host dbh canonical_hostname hostnames template values (?)" in sth#execute [`String canonical_hostname]; - let hostid = sth#serial "hosts_id_seq" in + let hostid = Int64.to_int (sth#serial "hosts_id_seq") in let sth = dbh#prepare_cached "insert into hostnames (hostid, name) values (?, ?)" in diff --git a/scripts/lib/cocanwiki_pages.ml b/scripts/lib/cocanwiki_pages.ml index 24e2291..f713277 100644 --- a/scripts/lib/cocanwiki_pages.ml +++ b/scripts/lib/cocanwiki_pages.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * Copyright (C) 2004 Merjis Ltd. - * $Id: cocanwiki_pages.ml,v 1.3 2004/11/22 11:07:32 rich Exp $ + * $Id: cocanwiki_pages.ml,v 1.4 2005/11/17 10:14:43 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 @@ -155,7 +155,7 @@ let save_page (dbh : Dbi.connection) hostid ?user ?r model = `String model.description; logged_ip; logged_user; redirect]; - let pageid = sth#serial "pages_id_seq" in + let pageid = Int64.to_int (sth#serial "pages_id_seq") in (* Create the page contents. *) let sth = dbh#prepare_cached "insert into contents (pageid, @@ -246,7 +246,7 @@ let save_page (dbh : Dbi.connection) hostid ?user ?r model = logged_user; redirect; css]; (* New page ID <> old page ID model.id. *) - let pageid = sth#serial "pages_id_seq" in + let pageid = Int64.to_int (sth#serial "pages_id_seq") in (* Create the page contents. *) let sth = dbh#prepare_cached "insert into contents (pageid, diff --git a/scripts/mail_import.ml b/scripts/mail_import.ml index 289e701..008d991 100644 --- a/scripts/mail_import.ml +++ b/scripts/mail_import.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * Copyright (C) 2004 Merjis Ltd. - * $Id: mail_import.ml,v 1.7 2004/12/01 13:55:55 rich Exp $ + * $Id: mail_import.ml,v 1.8 2005/11/17 10:14:42 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 @@ -172,7 +172,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid _ user = message_date) values (?, ?, ?, ?)" in sth#execute [`Int hostid; `String subject; `String inet_message_id; `Timestamp (date, time)]; - let msgid = sth#serial "messages_id_seq" in + let msgid = Int64.to_int (sth#serial "messages_id_seq") in let sth = dbh#prepare_cached diff --git a/scripts/restore.ml b/scripts/restore.ml index ed7f383..8fdaf85 100644 --- a/scripts/restore.ml +++ b/scripts/restore.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * Copyright (C) 2004 Merjis Ltd. - * $Id: restore.ml,v 1.16 2004/11/01 12:57:53 rich Exp $ + * $Id: restore.ml,v 1.17 2005/11/17 10:14:42 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 @@ -77,7 +77,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid {hostname = hostname} user = sth#execute [`Int hostid; `String page; title; description; creation_date; logged_ip; logged_user; redirect; css ]; - let pageid = sth#serial "pages_id_seq" in + let pageid = Int64.to_int (sth#serial "pages_id_seq") in let sth = dbh#prepare_cached "insert into contents (pageid, ordering, sectionname, content, divname) diff --git a/scripts/signup.ml b/scripts/signup.ml index 315c153..84a44aa 100644 --- a/scripts/signup.ml +++ b/scripts/signup.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * Copyright (C) 2004 Merjis Ltd. - * $Id: signup.ml,v 1.7 2005/03/31 14:24:04 rich Exp $ + * $Id: signup.ml,v 1.8 2005/11/17 10:14:42 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 @@ -88,7 +88,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid _ _ = values (?, ?, ?, ?)" in sth#execute [`String username; `String password; email; `Int hostid]; - let userid = sth#serial "users_id_seq" in + let userid = Int64.to_int (sth#serial "users_id_seq") in (* Create a cookie. *) let cookie = random_sessionid () in -- 1.8.3.1