]> Dogcows Code - chaz/chatty/commitdiff
fixed sqlite schema timestamp identifier
authorCharles McGarvey <chazmcgarvey@brokenzipper.com>
Tue, 18 Oct 2011 02:25:15 +0000 (20:25 -0600)
committerCharles McGarvey <chazmcgarvey@brokenzipper.com>
Tue, 18 Oct 2011 02:25:15 +0000 (20:25 -0600)
db/schema.sql
lib/Chatty/Schema/Result/Account.pm
lib/Chatty/Schema/Result/Message.pm
lib/Chatty/Schema/Result/Room.pm

index 70a5a24aae6db1ba2dc94c7f71edda9774135067..fee4063c1152baf247785b5a5c1884fc5f1ee53a 100644 (file)
@@ -3,8 +3,8 @@ PRAGMA foreign_keys = ON;
 
 CREATE TABLE room (
        id              INTEGER PRIMARY KEY,
-       name            TEXT,
-       created         TIMESTAMP DEFAULT NOW
+       name            TEXT UNIQUE,
+       created         TIMESTAMP DEFAULT CURRENT_TIMESTAMP
 );
 
 CREATE TABLE account (
@@ -18,7 +18,7 @@ CREATE TABLE account (
 
 CREATE TABLE message (
        id              INTEGER PRIMARY KEY,
-       posted          TIMESTAMP DEFAULT NOW,
+       posted          TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
        author          INTEGER REFERENCES account(id),
        room            INTEGER REFERENCES room(id),
        content         TEXT
index 1432ed560cab2cdec1f3783171e62eb546aa989e..60b33b1826d7441833539f8384eeddd281e0b4b6 100644 (file)
@@ -113,8 +113,8 @@ __PACKAGE__->has_many(
 );
 
 
-# Created by DBIx::Class::Schema::Loader v0.07010 @ 2011-10-13 18:47:53
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:l1E3sAYHA5mK6RiNszOTzA
+# Created by DBIx::Class::Schema::Loader v0.07010 @ 2011-10-17 20:21:50
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jbeLiaDPsjHNHj5O11tPFA
 
 
 # You can replace this text with custom code or comments, and it will be preserved on regeneration
index 792713dc545dc3f8c2b0994f17e066a0bb332bc9..78a74412e0bc23f21972a21a6e2cbccba3529a56 100644 (file)
@@ -32,7 +32,7 @@ __PACKAGE__->table("message");
 =head2 posted
 
   data_type: 'timestamp'
-  default_value: NOW
+  default_value: current_timestamp
   is_nullable: 1
 
 =head2 author
@@ -58,7 +58,11 @@ __PACKAGE__->add_columns(
   "id",
   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
   "posted",
-  { data_type => "timestamp", default_value => \"NOW", is_nullable => 1 },
+  {
+    data_type     => "timestamp",
+    default_value => \"current_timestamp",
+    is_nullable   => 1,
+  },
   "author",
   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
   "room",
@@ -111,8 +115,8 @@ __PACKAGE__->belongs_to(
 );
 
 
-# Created by DBIx::Class::Schema::Loader v0.07010 @ 2011-10-13 18:47:53
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:q1cq2bWftQPoo8huOftzMQ
+# Created by DBIx::Class::Schema::Loader v0.07010 @ 2011-10-17 20:21:50
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:R28y3tHGM5FZTILUAO/0XA
 
 
 # You can replace this text with custom code or comments, and it will be preserved on regeneration
index 7ae5643e8c20f78bfc0186fd1f37439103484bd1..53516f3050d20ddb1e57eccccf5e9242a8b4e73a 100644 (file)
@@ -37,7 +37,7 @@ __PACKAGE__->table("room");
 =head2 created
 
   data_type: 'timestamp'
-  default_value: NOW
+  default_value: current_timestamp
   is_nullable: 1
 
 =cut
@@ -48,9 +48,14 @@ __PACKAGE__->add_columns(
   "name",
   { data_type => "text", is_nullable => 1 },
   "created",
-  { data_type => "timestamp", default_value => \"NOW", is_nullable => 1 },
+  {
+    data_type     => "timestamp",
+    default_value => \"current_timestamp",
+    is_nullable   => 1,
+  },
 );
 __PACKAGE__->set_primary_key("id");
+__PACKAGE__->add_unique_constraint("name_unique", ["name"]);
 
 =head1 RELATIONS
 
@@ -85,8 +90,8 @@ __PACKAGE__->has_many(
 );
 
 
-# Created by DBIx::Class::Schema::Loader v0.07010 @ 2011-10-13 18:47:53
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2QSf3vZfv8xVbUKtsKsvDg
+# Created by DBIx::Class::Schema::Loader v0.07010 @ 2011-10-17 20:21:50
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:U0zHyxd2zFVEnATmgpd+Ag
 
 
 # You can replace this text with custom code or comments, and it will be preserved on regeneration
This page took 0.02586 seconds and 4 git commands to generate.