|
Revision 406, 0.5 KB
(checked in by eevee, 22 months ago)
|
|
Database refactoring. Renamed columns and tables to be more consistent and more readable. (#58)
|
| Line | |
|---|
| 1 | package Vee::Schema::Groups; |
|---|
| 2 | |
|---|
| 3 | use strict; |
|---|
| 4 | use warnings; |
|---|
| 5 | use base 'DBIx::Class'; |
|---|
| 6 | |
|---|
| 7 | =head1 NAME |
|---|
| 8 | |
|---|
| 9 | Vee::Schema::Groups - DBIC class for the C<groups> table |
|---|
| 10 | |
|---|
| 11 | =cut |
|---|
| 12 | |
|---|
| 13 | __PACKAGE__->load_components('Core'); |
|---|
| 14 | __PACKAGE__->table('groups'); |
|---|
| 15 | __PACKAGE__->add_columns(qw/ id icon name /); |
|---|
| 16 | __PACKAGE__->set_primary_key('id'); |
|---|
| 17 | |
|---|
| 18 | __PACKAGE__->has_many(user_groups => 'Vee::Schema::UserGroups', 'group_id'); |
|---|
| 19 | __PACKAGE__->has_many(permissions => 'Vee::Schema::GroupPermissions', 'group_id'); |
|---|
| 20 | __PACKAGE__->many_to_many('users' => 'user_groups', 'user'); |
|---|
| 21 | |
|---|
| 22 | 1; |
|---|