[siesta-commit] siesta/lib/Siesta/Storage DBI.pm,1.24,1.25

[prev] [thread] [next] [lurker] [Date index for 2002/09/12]

From: muttley
Subject: [siesta-commit] siesta/lib/Siesta/Storage DBI.pm,1.24,1.25
Date: 12:35 on 12 Sep 2002
Update of /cvsroot/siesta/siesta/lib/Siesta/Storage
In directory usw-pr-cvs1:/tmp/cvs-serv25644/lib/Siesta/Storage

Modified Files:
	DBI.pm 
Log Message:
Embed set up sql in the module.


Index: DBI.pm
===================================================================
RCS file: /cvsroot/siesta/siesta/lib/Siesta/Storage/DBI.pm,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- DBI.pm	11 Sep 2002 11:12:05 -0000	1.24
+++ DBI.pm	12 Sep 2002 11:35:51 -0000	1.25
@@ -22,6 +22,13 @@
     bless { _dbh => $dbh }, $class;
 }
 
+
+sub init_db {
+	my $self = shift;
+	my $sql = join('',(<DATA>));
+	$self->_dbh->do($sql);
+}
+
 # yes kids, it's yet another cheesy query builder
 sub _get_rows {
     my $self    = shift;
@@ -459,3 +466,38 @@
 }
 
 1;
+
+__DATA__
+CREATE TABLE users (
+        id              VARCHAR(30),
+        forename        VARCHAR(20),
+        surname         VARCHAR(20),
+        password        VARCHAR(13),
+        bouncing        BOOLEAN,
+        lastbounce      DATE,
+        created         DATETIME
+);
+CREATE TABLE lists (
+        id              VARCHAR(20),
+        owner           VARCHAR(20),
+        post_address    VARCHAR(255),
+        return_path     VARCHAR(255),
+        created         DATETIME
+);
+CREATE TABLE list_users (
+        id              INT,
+        list_id         VARCHAR(20),
+        user_id         VARCHAR(30)
+);
+CREATE TABLE list_plugins (
+        id              INT,
+        plugin_id       VARCHAR(20),
+        list_id         VARCHAR(20)
+);
+CREATE TABLE config (
+        namespace       VARCHAR(255),
+        list_id         VARCHAR(20),
+        user_id         VARCHAR(30),
+        key             VARCHAR(255),
+        value           VARCHAR(255)
+);



Generated at 13:57 on 01 Jul 2004 by mariachi 0.52