[Catalyst-commits] r13243 - in
trunk/examples/Tutorial/MyApp_Chapter9_FormFu/MyApp: .
lib/MyApp/Schema/Result
caelum at dev.catalyst.perl.org
caelum at dev.catalyst.perl.org
Thu May 13 12:56:04 GMT 2010
Author: caelum
Date: 2010-05-13 13:56:04 +0100 (Thu, 13 May 2010)
New Revision: 13243
Modified:
trunk/examples/Tutorial/MyApp_Chapter9_FormFu/MyApp/lib/MyApp/Schema/Result/Book.pm
trunk/examples/Tutorial/MyApp_Chapter9_FormFu/MyApp/myapp.db
trunk/examples/Tutorial/MyApp_Chapter9_FormFu/MyApp/myapp03.sql
Log:
change created/updated columns to type "timestamp"
Modified: trunk/examples/Tutorial/MyApp_Chapter9_FormFu/MyApp/lib/MyApp/Schema/Result/Book.pm
===================================================================
--- trunk/examples/Tutorial/MyApp_Chapter9_FormFu/MyApp/lib/MyApp/Schema/Result/Book.pm 2010-05-13 11:58:52 UTC (rev 13242)
+++ trunk/examples/Tutorial/MyApp_Chapter9_FormFu/MyApp/lib/MyApp/Schema/Result/Book.pm 2010-05-13 12:56:04 UTC (rev 13243)
@@ -133,9 +133,9 @@
#
__PACKAGE__->add_columns(
"created",
- { data_type => 'datetime', set_on_create => 1 },
+ { data_type => 'timestamp', set_on_create => 1 },
"updated",
- { data_type => 'datetime', set_on_create => 1, set_on_update => 1 },
+ { data_type => 'timestamp', set_on_create => 1, set_on_update => 1 },
);
Modified: trunk/examples/Tutorial/MyApp_Chapter9_FormFu/MyApp/myapp.db
===================================================================
(Binary files differ)
Modified: trunk/examples/Tutorial/MyApp_Chapter9_FormFu/MyApp/myapp03.sql
===================================================================
--- trunk/examples/Tutorial/MyApp_Chapter9_FormFu/MyApp/myapp03.sql 2010-05-13 11:58:52 UTC (rev 13242)
+++ trunk/examples/Tutorial/MyApp_Chapter9_FormFu/MyApp/myapp03.sql 2010-05-13 12:56:04 UTC (rev 13243)
@@ -1,6 +1,6 @@
--
-- Add 'created' and 'updated' columns to 'book' table.
--
-ALTER TABLE book ADD created INTEGER;
-ALTER TABLE book ADD updated INTEGER;
+ALTER TABLE book ADD created TIMESTAMP;
+ALTER TABLE book ADD updated TIMESTAMP;
UPDATE book SET created = DATETIME('NOW'), updated = DATETIME('NOW');
More information about the Catalyst-commits
mailing list