Mercurial > pub > Impl
diff _test/Test/ORM/Schema.pm @ 44:32d2350fccf9
ORM
*Minor fixes
*Working tarnsform to sql
*Fixes to the sql traits
author | Sergey |
---|---|
date | Mon, 11 Jan 2010 01:42:00 +0300 |
parents | d660fb38b7cc |
children | 16ada169ca75 |
line wrap: on
line diff
--- a/_test/Test/ORM/Schema.pm Thu Jan 07 15:41:49 2010 +0300 +++ b/_test/Test/ORM/Schema.pm Mon Jan 11 01:42:00 2010 +0300 @@ -3,6 +3,8 @@ use warnings; use base qw(IMPL::Test::Unit); +require IMPL::SQL::Schema::Traits::mysql; + __PACKAGE__->PassThroughArgs; use IMPL::Test qw(test failed); @@ -26,9 +28,22 @@ return 1; }; -test TransformDataSchema => sub { +test GenerateSQL => sub { my $sqlSchema = IMPL::ORM::Schema::TransformToSQL->Std->Transform(Test::ORM::Schema::Data->instance) or failed("Failed to transform a schema"); + + my $sqlEmpty = new IMPL::SQL::Schema(Name => 'empty'); + + my $traits = IMPL::SQL::Schema::Traits::mysql->new( + SrcSchema => $sqlEmpty, + DstSchema => $sqlSchema + ); + + $traits->UpdateSchema(); + + print "$_\n" foreach $traits->Handler->Sql; + + $sqlEmpty->Dispose; $sqlSchema->Dispose; };