Permalink
Browse files

[irclog] preparations to add a primary key to the database

(why didn't I do that in the first place? silly me). 
whitespace fixes.


git-svn-id: http://svn.pugscode.org/pugs/misc/irclog@16424 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
1 parent eb8c079 commit 4a09a2e01ef475bb983e1e2ad4f9f8f061d45c76 moritz committed May 18, 2007
Showing with 4 additions and 3 deletions.
  1. +2 −2 IrcLog.pm
  2. +1 −0 add_id.sql
  3. +1 −1 ilbot.pl
View
@@ -15,8 +15,8 @@ our @ISA = qw(Exporter);
our @EXPORT = qw(
get_dbh
gmt_today
- my_encode
- message_line
+ my_encode
+ message_line
);
# get a database handle.
View
@@ -0,0 +1 @@
+ALTER TABLE irclog ADD id INT NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (id);
View
@@ -19,7 +19,7 @@
my $dbh = get_dbh();
my $channel = $conf->{CHANNEL} || "#perl6";
-my $q = $dbh->prepare("INSERT INTO irclog VALUES(?, ?, ?, ?, ?)");
+my $q = $dbh->prepare("INSERT INTO irclog (channel, day, nick, timestamp, line) VALUES(?, ?, ?, ?, ?)");
$conn->add_global_handler('376', \&on_connect);
$conn->add_handler("public", \&on_public);
$conn->add_handler("notice", \&on_public);

0 comments on commit 4a09a2e

Please sign in to comment.