Skip to content

Instantly share code, notes, and snippets.

@typester
Created August 7, 2009 15:36
Show Gist options
  • Save typester/163962 to your computer and use it in GitHub Desktop.
Save typester/163962 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use FindBin::libs;
use Schema;
Schema->connect->create_ddl_dir;
package Schema;
use strict;
use warnings;
use base 'DBIx::Class::Schema';
__PACKAGE__->load_namespaces;
1;
package Schema::Result::Table;
use strict;
use warnings;
use base 'DBIx::Class';
__PACKAGE__->load_components('Core');
__PACKAGE__->table('table');
__PACKAGE__->add_columns(
id => {
data_type => 'integer',
is_auto_increment => 1,
extra => {
unsigned => 1,
},
},
username => {
data_type => 'varchar',
size => 255,
},
);
__PACKAGE__->set_primary_key('id');
__PACKAGE__->add_unique_constraint( username => ['username'] );
1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment