use strict;
-use base qw(SL::DB::Object);
+use parent qw(SL::DB::Object);
-__PACKAGE__->meta->setup(
- table => 'user_config',
+__PACKAGE__->meta->table('user_config');
+__PACKAGE__->meta->schema('auth');
- columns => [
- user_id => { type => 'integer', not_null => 1 },
- cfg_key => { type => 'text', not_null => 1 },
- cfg_value => { type => 'text' },
- ],
+__PACKAGE__->meta->columns(
+ cfg_key => { type => 'text', not_null => 1 },
+ cfg_value => { type => 'text' },
+ user_id => { type => 'integer', not_null => 1 },
+);
+
+__PACKAGE__->meta->primary_key_columns([ 'user_id', 'cfg_key' ]);
- primary_key_columns => [ 'user_id', 'cfg_key' ],
+__PACKAGE__->meta->foreign_keys(
+ user => {
+ class => 'SL::DB::AuthUser',
+ key_columns => { user_id => 'id' },
+ },
);
1;