From a7cc690ced15e1a0191d27034006bfb17a0deeb5 Mon Sep 17 00:00:00 2001 From: franck cuny Date: Sat, 23 Jan 2010 19:36:24 +0100 Subject: basic github crawler using api --- lib/githubexplorer/Schema/Result/Repositories.pm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 lib/githubexplorer/Schema/Result/Repositories.pm (limited to 'lib/githubexplorer/Schema/Result/Repositories.pm') diff --git a/lib/githubexplorer/Schema/Result/Repositories.pm b/lib/githubexplorer/Schema/Result/Repositories.pm new file mode 100644 index 0000000..641305f --- /dev/null +++ b/lib/githubexplorer/Schema/Result/Repositories.pm @@ -0,0 +1,23 @@ +package githubexplorer::Schema::Result::Repositories; + +use base qw/DBIx::Class/; + +__PACKAGE__->load_components(qw/Core/); +__PACKAGE__->table('repositories'); +__PACKAGE__->add_columns( + id => { data_type => 'integer', is_auto_increment => 1 }, + description => { data_type => 'text', is_nullable => 1 }, + name => { data_type => 'varchar' }, + homepage => { data_type => 'varchar', is_nullable => 1 }, + url => { data_type => 'varchar', is_nullable => 1 }, + watchers => { data_type => 'int' }, + forks => { data_type => 'int' }, + id_profile => { data_type => 'int', is_foreign_key => 1 }, +); + +__PACKAGE__->set_primary_key('id'); +__PACKAGE__->belongs_to( 'id_profile', + 'githubexplorer::Schema::Result::Profiles' ); +__PACKAGE__->add_unique_constraint( [qw/name id_profile/] ); + +1; -- cgit 1.4.1