/[Frey]/trunk/lib/Reblog/Schema.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/lib/Reblog/Schema.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 624 - (show annotations)
Sat Nov 29 17:47:34 2008 UTC (14 years ago) by dpavlin
File size: 612 byte(s)
cleanup
1 package Reblog::Schema;
2
3 use Fey::ORM::Schema;
4
5 sub debug { 0 } # FIXME fake
6 with 'Frey::Config';
7 my $dsn = __PACKAGE__->config( __PACKAGE__ )->{dsn}; # FIXME yaaaack
8
9 my ( $schema, $source ) = Frey::Schema->schema_source( $dsn );
10
11 has_schema $schema;
12
13 # fixup MySQL schema (hooray!)
14
15 $schema->add_foreign_key(
16 Fey::FK->new(
17 source_columns => [ $schema->table('feeds')->column('id') ],
18 target_columns => [ $schema->table('items')->column('feed_id') ],
19 )
20 );
21
22 __PACKAGE__->DBIManager()->add_source($source);
23
24 #$source->dbh->do( qq{ set client_encoding = 'utf-8' } ) if $dsn =~ /Pg/;
25
26 warn "## dsn $dsn";
27
28 1;

  ViewVC Help
Powered by ViewVC 1.1.26