/[Frey]/branches/mojo/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 /branches/mojo/lib/Reblog/Schema.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 228 - (show annotations)
Sat Nov 1 13:06:31 2008 UTC (15 years, 7 months ago) by dpavlin
File size: 587 byte(s)
create experimental branch to test Mojo as server instead of Continuity
1 package Reblog::Schema;
2
3 use Fey::ORM::Schema;
4
5 my $dsn = "DBI:mysql:database=reblog";
6 $dsn .= ";host=127.0.0.1;port=13306"; # XXX over ssh
7
8 my ( $schema, $source ) = Frey::Schema->schema_source( $dsn );
9
10 has_schema $schema;
11
12 # fixup MySQL schema (hooray!)
13
14 $schema->add_foreign_key(
15 Fey::FK->new(
16 source_columns => [ $schema->table('feeds')->column('id') ],
17 target_columns => [ $schema->table('items')->column('feed_id') ],
18 )
19 );
20
21 __PACKAGE__->DBIManager()->add_source($source);
22
23 #$source->dbh->do( qq{ set client_encoding = 'utf-8' } ) if $dsn =~ /Pg/;
24
25 warn "## dsn $dsn";
26
27 1;

  ViewVC Help
Powered by ViewVC 1.1.26