Index: /trunk/Nebulous-Server/docs/database_setup.txt
===================================================================
--- /trunk/Nebulous-Server/docs/database_setup.txt	(revision 3015)
+++ /trunk/Nebulous-Server/docs/database_setup.txt	(revision 3016)
@@ -1,5 +1,5 @@
 # Copyright (C) 2004  Joshua Hoblitt
 #
-# $Id: database_setup.txt,v 1.2 2005-01-15 03:29:58 jhoblitt Exp $
+# $Id: database_setup.txt,v 1.3 2005-01-15 04:02:12 jhoblitt Exp $
 
 ### Database Setup
@@ -18,5 +18,5 @@
 USE pixel;
 
-### MySQL 4.0
+### MySQL 4.1
 
 DROP TABLE IF EXISTS storage_object;
@@ -28,5 +28,6 @@
     read_lock TINYINT DEFAULT 0 NOT NULL,
     write_lock ENUM( 'write' ),
-    epoch TIMESTAMP NOT NULL,
+    epoch TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+    mtime TIMESTAMP,
     PRIMARY KEY(so_id),
     KEY(ext_id(64)),
@@ -39,8 +40,8 @@
     so_id BIGINT NOT NULL,
     uri VARCHAR(255) BINARY NOT NULL,
-    sha1sum CHAR(40),
+    sha1sum CHAR(40) ASCII,
     assigned_location BOOL,
-    epoch TIMESTAMP NOT NULL,
-    atime TIMESTAMP NOT NULL,
+    epoch TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+    mtime TIMESTAMP,
     PRIMARY KEY(ins_id),
     KEY(so_id),
@@ -72,39 +73,4 @@
         key(class_id)
     ) ENGINE=innodb;
-
-### MySQL 4.1
-
-DROP TABLE IF EXISTS storage_object;
-CREATE TABLE storage_object (
-        so_id BIGINT NOT NULL AUTO_INCREMENT,
-        ext_id VARCHAR(255) UNIQUE BINARY NOT NULL,
-        comment VARCHAR(255),
-        epoch TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
-        PRIMARY KEY(so_id),
-        KEY(ext_id(20))
-    ) ENGINE=innodb;
-
-
-DROP TABLE IF EXISTS instance;
-CREATE TABLE instance ( 
-        ins_id BIGINT NOT NULL AUTO_INCREMENT,
-        so_id BIGINT NOT NULL,
-        uri VARCHAR(255) BINARY NOT NULL,
-        sha1sum CHAR(40) ASCII,
-        read_lock TINYINT NOT NULL,
-        write_lock ENUM( 'write', 'wait' ),
-        atime TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-        PRIMARY KEY(ins_id),
-        KEY(so_id)
-    ) ENGINE=innodb;
-
-DROP TABLE IF EXISTS lock_record;
-CREATE TABLE lock_record (
-        ins_id BIGINT NOT NULL,
-        type ENUM( 'read', 'write', 'wait' ) NOT NULL,
-        epoch TIMESTAMP DEFAULT CURRENT_TIMESTAMP
-    ) ENGINE=innodb;
-
-        epoch TIMESTAMP,
 
 ### Initialization
Index: /trunk/Nebulous-Server/lib/Nebulous/Server/SQL.pm
===================================================================
--- /trunk/Nebulous-Server/lib/Nebulous/Server/SQL.pm	(revision 3015)
+++ /trunk/Nebulous-Server/lib/Nebulous/Server/SQL.pm	(revision 3016)
@@ -1,5 +1,5 @@
 # Copyright (c) 2004  Joshua Hoblitt
 #
-# $Id: SQL.pm,v 1.3 2005-01-05 03:19:12 jhoblitt Exp $
+# $Id: SQL.pm,v 1.4 2005-01-15 04:02:12 jhoblitt Exp $
 
 package PS::IPP::IData::Server::SQL;
@@ -24,5 +24,6 @@
     new_object          => qq{
         INSERT INTO storage_object
-        VALUES (NULL, ?, ?, ?, 0, NULL, NULL)
+        (so_id, ext_id, class_id, comment, read_lock, write_lock)
+        VALUES (NULL, ?, ?, ?, 0, NULL)
     },
     delete_object       => qq{
@@ -39,5 +40,5 @@
     },
     get_object          => qq{
-        SELECT *
+        SELECT so_id, ext_id, class_id, comment, read_lock, write_lock, epoch, mtime
         FROM storage_object
         WHERE ext_id = ?
Index: /trunk/Nebulous-Server/t/09_server_stat_object.t
===================================================================
--- /trunk/Nebulous-Server/t/09_server_stat_object.t	(revision 3015)
+++ /trunk/Nebulous-Server/t/09_server_stat_object.t	(revision 3016)
@@ -3,10 +3,10 @@
 # Copryight (C) 2004-2005  Joshua Hoblitt
 #
-# $Id: 09_server_stat_object.t,v 1.3 2005-01-03 23:55:29 jhoblitt Exp $
+# $Id: 09_server_stat_object.t,v 1.4 2005-01-15 04:02:12 jhoblitt Exp $
 
 use strict;
 use warnings FATAL => qw( all );
 
-use Test::More tests => 12;
+use Test::More tests => 13;
 
 use lib qw( ./t ./lib );
@@ -31,5 +31,5 @@
     my $info = $idata->stat_object( "foo" );
 
-    is( scalar @$info, 7, "number of columns" );
+    is( scalar @$info, 8, "number of columns" );
 }
 
@@ -41,5 +41,5 @@
     my $info = $idata->stat_object( "foo" );
 
-    is( scalar @$info, 7,                       "number of columns" );
+    is( scalar @$info, 8,                       "number of columns" );
     is( @$info[0], 1,                           "so_id" );
     is( @$info[1], "foo",                       "ext_id" );
@@ -49,4 +49,5 @@
     is( @$info[5], undef,                       "write lock" );
     like( @$info[6], qr/....-..-.. ..:..:../,   "epoch" );
+    like( @$info[6], qr/....-..-.. ..:..:../,   "mtime" );
 }
 
Index: /trunk/Nebulous-Server/t/23_client_stat.t
===================================================================
--- /trunk/Nebulous-Server/t/23_client_stat.t	(revision 3015)
+++ /trunk/Nebulous-Server/t/23_client_stat.t	(revision 3016)
@@ -3,5 +3,5 @@
 # Copryight (C) 2004-2005  Joshua Hoblitt
 #
-# $Id: 23_client_stat.t,v 1.1 2005-01-04 22:02:43 jhoblitt Exp $
+# $Id: 23_client_stat.t,v 1.2 2005-01-15 04:02:12 jhoblitt Exp $
 
 use strict;
@@ -10,5 +10,5 @@
 use Apache::Test qw( -withtestmore );
 
-plan tests => 12;
+plan tests => 13;
 
 use lib qw( ./t ./lib );
@@ -30,5 +30,5 @@
     my $info = $idata->stat( "foo" );
 
-    is( scalar @$info, 7, "number of columns" );
+    is( scalar @$info, 8, "number of columns" );
 }
 
@@ -43,5 +43,5 @@
     my $info = $idata->stat( "foo" );
 
-    is( scalar @$info, 7,                       "number of columns" );
+    is( scalar @$info, 8,                       "number of columns" );
     is( @$info[0], 1,                           "so_id" );
     is( @$info[1], "foo",                       "ext_id" );
@@ -51,4 +51,5 @@
     is( @$info[5], undef,                       "write lock" );
     like( @$info[6], qr/....-..-.. ..:..:../,   "epoch" );
+    like( @$info[6], qr/....-..-.. ..:..:../,   "mtime" );
 }
 
Index: /trunk/Nebulous/docs/database_setup.txt
===================================================================
--- /trunk/Nebulous/docs/database_setup.txt	(revision 3015)
+++ /trunk/Nebulous/docs/database_setup.txt	(revision 3016)
@@ -1,5 +1,5 @@
 # Copyright (C) 2004  Joshua Hoblitt
 #
-# $Id: database_setup.txt,v 1.2 2005-01-15 03:29:58 jhoblitt Exp $
+# $Id: database_setup.txt,v 1.3 2005-01-15 04:02:12 jhoblitt Exp $
 
 ### Database Setup
@@ -18,5 +18,5 @@
 USE pixel;
 
-### MySQL 4.0
+### MySQL 4.1
 
 DROP TABLE IF EXISTS storage_object;
@@ -28,5 +28,6 @@
     read_lock TINYINT DEFAULT 0 NOT NULL,
     write_lock ENUM( 'write' ),
-    epoch TIMESTAMP NOT NULL,
+    epoch TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+    mtime TIMESTAMP,
     PRIMARY KEY(so_id),
     KEY(ext_id(64)),
@@ -39,8 +40,8 @@
     so_id BIGINT NOT NULL,
     uri VARCHAR(255) BINARY NOT NULL,
-    sha1sum CHAR(40),
+    sha1sum CHAR(40) ASCII,
     assigned_location BOOL,
-    epoch TIMESTAMP NOT NULL,
-    atime TIMESTAMP NOT NULL,
+    epoch TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+    mtime TIMESTAMP,
     PRIMARY KEY(ins_id),
     KEY(so_id),
@@ -72,39 +73,4 @@
         key(class_id)
     ) ENGINE=innodb;
-
-### MySQL 4.1
-
-DROP TABLE IF EXISTS storage_object;
-CREATE TABLE storage_object (
-        so_id BIGINT NOT NULL AUTO_INCREMENT,
-        ext_id VARCHAR(255) UNIQUE BINARY NOT NULL,
-        comment VARCHAR(255),
-        epoch TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
-        PRIMARY KEY(so_id),
-        KEY(ext_id(20))
-    ) ENGINE=innodb;
-
-
-DROP TABLE IF EXISTS instance;
-CREATE TABLE instance ( 
-        ins_id BIGINT NOT NULL AUTO_INCREMENT,
-        so_id BIGINT NOT NULL,
-        uri VARCHAR(255) BINARY NOT NULL,
-        sha1sum CHAR(40) ASCII,
-        read_lock TINYINT NOT NULL,
-        write_lock ENUM( 'write', 'wait' ),
-        atime TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
-        PRIMARY KEY(ins_id),
-        KEY(so_id)
-    ) ENGINE=innodb;
-
-DROP TABLE IF EXISTS lock_record;
-CREATE TABLE lock_record (
-        ins_id BIGINT NOT NULL,
-        type ENUM( 'read', 'write', 'wait' ) NOT NULL,
-        epoch TIMESTAMP DEFAULT CURRENT_TIMESTAMP
-    ) ENGINE=innodb;
-
-        epoch TIMESTAMP,
 
 ### Initialization
Index: /trunk/Nebulous/lib/Nebulous/Server/SQL.pm
===================================================================
--- /trunk/Nebulous/lib/Nebulous/Server/SQL.pm	(revision 3015)
+++ /trunk/Nebulous/lib/Nebulous/Server/SQL.pm	(revision 3016)
@@ -1,5 +1,5 @@
 # Copyright (c) 2004  Joshua Hoblitt
 #
-# $Id: SQL.pm,v 1.3 2005-01-05 03:19:12 jhoblitt Exp $
+# $Id: SQL.pm,v 1.4 2005-01-15 04:02:12 jhoblitt Exp $
 
 package PS::IPP::IData::Server::SQL;
@@ -24,5 +24,6 @@
     new_object          => qq{
         INSERT INTO storage_object
-        VALUES (NULL, ?, ?, ?, 0, NULL, NULL)
+        (so_id, ext_id, class_id, comment, read_lock, write_lock)
+        VALUES (NULL, ?, ?, ?, 0, NULL)
     },
     delete_object       => qq{
@@ -39,5 +40,5 @@
     },
     get_object          => qq{
-        SELECT *
+        SELECT so_id, ext_id, class_id, comment, read_lock, write_lock, epoch, mtime
         FROM storage_object
         WHERE ext_id = ?
Index: /trunk/Nebulous/t/09_server_stat_object.t
===================================================================
--- /trunk/Nebulous/t/09_server_stat_object.t	(revision 3015)
+++ /trunk/Nebulous/t/09_server_stat_object.t	(revision 3016)
@@ -3,10 +3,10 @@
 # Copryight (C) 2004-2005  Joshua Hoblitt
 #
-# $Id: 09_server_stat_object.t,v 1.3 2005-01-03 23:55:29 jhoblitt Exp $
+# $Id: 09_server_stat_object.t,v 1.4 2005-01-15 04:02:12 jhoblitt Exp $
 
 use strict;
 use warnings FATAL => qw( all );
 
-use Test::More tests => 12;
+use Test::More tests => 13;
 
 use lib qw( ./t ./lib );
@@ -31,5 +31,5 @@
     my $info = $idata->stat_object( "foo" );
 
-    is( scalar @$info, 7, "number of columns" );
+    is( scalar @$info, 8, "number of columns" );
 }
 
@@ -41,5 +41,5 @@
     my $info = $idata->stat_object( "foo" );
 
-    is( scalar @$info, 7,                       "number of columns" );
+    is( scalar @$info, 8,                       "number of columns" );
     is( @$info[0], 1,                           "so_id" );
     is( @$info[1], "foo",                       "ext_id" );
@@ -49,4 +49,5 @@
     is( @$info[5], undef,                       "write lock" );
     like( @$info[6], qr/....-..-.. ..:..:../,   "epoch" );
+    like( @$info[6], qr/....-..-.. ..:..:../,   "mtime" );
 }
 
Index: /trunk/Nebulous/t/23_client_stat.t
===================================================================
--- /trunk/Nebulous/t/23_client_stat.t	(revision 3015)
+++ /trunk/Nebulous/t/23_client_stat.t	(revision 3016)
@@ -3,5 +3,5 @@
 # Copryight (C) 2004-2005  Joshua Hoblitt
 #
-# $Id: 23_client_stat.t,v 1.1 2005-01-04 22:02:43 jhoblitt Exp $
+# $Id: 23_client_stat.t,v 1.2 2005-01-15 04:02:12 jhoblitt Exp $
 
 use strict;
@@ -10,5 +10,5 @@
 use Apache::Test qw( -withtestmore );
 
-plan tests => 12;
+plan tests => 13;
 
 use lib qw( ./t ./lib );
@@ -30,5 +30,5 @@
     my $info = $idata->stat( "foo" );
 
-    is( scalar @$info, 7, "number of columns" );
+    is( scalar @$info, 8, "number of columns" );
 }
 
@@ -43,5 +43,5 @@
     my $info = $idata->stat( "foo" );
 
-    is( scalar @$info, 7,                       "number of columns" );
+    is( scalar @$info, 8,                       "number of columns" );
     is( @$info[0], 1,                           "so_id" );
     is( @$info[1], "foo",                       "ext_id" );
@@ -51,4 +51,5 @@
     is( @$info[5], undef,                       "write lock" );
     like( @$info[6], qr/....-..-.. ..:..:../,   "epoch" );
+    like( @$info[6], qr/....-..-.. ..:..:../,   "mtime" );
 }
 
Index: /trunk/Nebulous/t/Test/Nebulous.pm
===================================================================
--- /trunk/Nebulous/t/Test/Nebulous.pm	(revision 3015)
+++ /trunk/Nebulous/t/Test/Nebulous.pm	(revision 3016)
@@ -1,5 +1,5 @@
 # Copyright (C) 2004  Joshua Hoblitt
 #
-# $Id: Nebulous.pm,v 1.1.1.1 2004-12-22 02:16:23 jhoblitt Exp $
+# $Id: Nebulous.pm,v 1.2 2005-01-15 04:02:12 jhoblitt Exp $
 
 package Test::IData;
@@ -68,5 +68,6 @@
     read_lock TINYINT DEFAULT 0 NOT NULL,
     write_lock ENUM( 'write' ),
-    epoch TIMESTAMP NOT NULL,
+    epoch TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+    mtime TIMESTAMP,
     PRIMARY KEY(so_id),
     KEY(ext_id(64)),
@@ -78,9 +79,9 @@
     ins_id BIGINT NOT NULL AUTO_INCREMENT,
     so_id BIGINT NOT NULL,
-    uri VARCHAR(255) BINARY NOT NULL UNIQUE,
-    sha1sum CHAR(40),
+    uri VARCHAR(255) BINARY NOT NULL,
+    sha1sum CHAR(40) ASCII,
     assigned_location BOOL,
-    epoch TIMESTAMP NOT NULL,
-    atime TIMESTAMP NOT NULL,
+    epoch TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+    mtime TIMESTAMP,
     PRIMARY KEY(ins_id),
     KEY(so_id),
