Created
          August 7, 2009 15:36 
        
      - 
      
- 
        Save typester/163962 to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | use strict; | |
| use warnings; | |
| use FindBin::libs; | |
| use Schema; | |
| Schema->connect->create_ddl_dir; | |
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | package Schema; | |
| use strict; | |
| use warnings; | |
| use base 'DBIx::Class::Schema'; | |
| __PACKAGE__->load_namespaces; | |
| 1; | |
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 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