Hi,
Any outstanding patches, please send to this thread. Can somebody also
go through rt.cpan.org and work out if there's anything on there we need
to apply as well?
attached the test and patch for DBIx::Class::InflateColumn::Datetime
The recreation of the test-schema generates many changes - many more
then my :-(
jens
Index: t/89inflate_datetime.t
===
--- t/89inflate_datetime.t (Revision 4887)
+++ t/89inflate_datetime.t (Arbeitskopie)
@@ -10,7 +10,7 @@
eval { require DateTime::Format::MySQL };
plan skip_all = Need DateTime::Format::MySQL for inflation tests if $@;
-plan tests = 21;
+plan tests = 25;
# inflation test
my $event = $schema-resultset(Event)-find(1);
@@ -92,3 +92,26 @@
like( $@, qr/invalid date format/i, Invalid date format exception);
}
+my $datetime_timezone_invalid = $schema-resultset('Event')-create( {
+
+ starts_at = DateTime-new(year=2007, month=12, day=31, time_zone =
America/Chicago ),
+ created_on = DateTime-new(year=2006, month=1, day=31, hour = 13,
minute = 34, second = 56, time_zone = America/New_York ),
+ ends_at = ,
+});
+
+is( $datetime_timezone_invalid-ends_at, undef, Inflate to undef);
+
+$datetime_timezone_invalid-update({ ends_at = undef } );
+
+is( $datetime_timezone_invalid-ends_at, undef, Inflate to undef);
+
+my $datetime_timezone_valid = $schema-resultset('Event')-create( {
+
+ starts_at = DateTime-new(year=2007, month=12, day=31, time_zone =
America/Chicago ),
+ created_on = DateTime-new(year=2006, month=1, day=31, hour = 13,
minute = 34, second = 56, time_zone = America/New_York ),
+ ends_at= DateTime-new(year=2008, month=1, day=1, hour = 1,
minute = 0, second = 0, time_zone = Europe/Berlin ) ,
+});
+
+isa_ok( $datetime_timezone_valid-ends_at,'DateTime', Inflate to DateTime);
+is( $datetime_timezone_valid-ends_at-time_zone-name, 'UTC', Timezone is
UTC );
+
Index: t/lib/sqlite.sql
===
--- t/lib/sqlite.sql(Revision 4887)
+++ t/lib/sqlite.sql(Arbeitskopie)
@@ -1,88 +1,40 @@
--
-- Created by SQL::Translator::Producer::SQLite
--- Created on Tue Aug 8 01:53:20 2006
+-- Created on Mon Oct 6 00:02:21 2008
--
BEGIN TRANSACTION;
--
--- Table: employee
---
-CREATE TABLE employee (
- employee_id INTEGER PRIMARY KEY NOT NULL,
- position integer NOT NULL,
- group_id integer,
- group_id_2 integer,
- name varchar(100)
-);
-
---
--- Table: serialized
---
-CREATE TABLE serialized (
- id INTEGER PRIMARY KEY NOT NULL,
- serialized text NOT NULL
-);
-
---
--- Table: liner_notes
---
-CREATE TABLE liner_notes (
- liner_id INTEGER PRIMARY KEY NOT NULL,
- notes varchar(100) NOT NULL
-);
-
---
--- Table: cd_to_producer
---
-CREATE TABLE cd_to_producer (
- cd integer NOT NULL,
- producer integer NOT NULL,
- PRIMARY KEY (cd, producer)
-);
-
---
-- Table: artist
--
CREATE TABLE artist (
artistid INTEGER PRIMARY KEY NOT NULL,
name varchar(100)
);
-
--
--- Table: twokeytreelike
+-- Table: artist_undirected_map
--
-CREATE TABLE twokeytreelike (
+CREATE TABLE artist_undirected_map (
id1 integer NOT NULL,
id2 integer NOT NULL,
- parent1 integer NOT NULL,
- parent2 integer NOT NULL,
- name varchar(100) NOT NULL,
PRIMARY KEY (id1, id2)
);
-
---
--- Table: fourkeys_to_twokeys
+CREATE INDEX artist_undirected_map_idx_id1_ ON artist_undirected_map
(id1);CREATE INDEX artist_undirected_map_idx_id2_ ON artist_undirected_map
(id2);--
+-- Table: bookmark
--
-CREATE TABLE fourkeys_to_twokeys (
- f_foo integer NOT NULL,
- f_bar integer NOT NULL,
- f_hello integer NOT NULL,
- f_goodbye integer NOT NULL,
- t_artist integer NOT NULL,
- t_cd integer NOT NULL,
- autopilot character NOT NULL,
- PRIMARY KEY (f_foo, f_bar, f_hello, f_goodbye, t_artist, t_cd)
+CREATE TABLE bookmark (
+ id INTEGER PRIMARY KEY NOT NULL,
+ link integer NOT NULL
);
-
---
--- Table: self_ref_alias
+CREATE INDEX bookmark_idx_link_bookmark ON bookmark (link);--
+-- Table: books
--
-CREATE TABLE self_ref_alias (
- self_ref integer NOT NULL,
- alias integer NOT NULL,
- PRIMARY KEY (self_ref, alias)
+CREATE TABLE books (
+ id INTEGER PRIMARY KEY NOT NULL,
+ source varchar(100) NOT NULL,
+ owner integer NOT NULL,
+ title varchar(100) NOT NULL
);
-
--
-- Table: cd
--
@@ -93,95 +45,109 @@
year varchar(100) NOT NULL,
genreid integer
);
-
+CREATE INDEX cd_idx_artist_cd ON cd (artist);CREATE INDEX cd_idx_genreid_cd ON
cd (genreid);CREATE UNIQUE INDEX cd_artist_title_cd ON cd (artist, title);--
+-- Table: cd_to_producer
--
--- Table: genre
+CREATE TABLE cd_to_producer (
+ cd integer NOT NULL,
+ producer integer NOT NULL,
+ PRIMARY KEY (cd, producer)
+);
+CREATE INDEX cd_to_producer_idx_cd_cd_to_pr ON cd_to_producer (cd);CREATE
INDEX cd_to_producer_idx_producer_cd ON cd_to_producer (producer);--
+-- Table: collection
--
-CREATE TABLE genre (
- genreid INTEGER PRIMARY KEY