my $deploy_attrs;
$deploy_attrs->{add_drop_table} = 1 if tables_exist( $dsn, $user, $pass );
$schema->deploy( $deploy_attrs );
+ $schema->populate('Personality', [
+ [ qw/user_id / ],
+ [ '1'],
+ [ '2' ],
+ [ '3'],
+ ]
+ );
$schema->populate('User', [
[ qw/username name password / ],
[ 'jgda', 'Jonas Alves', ''],
--- /dev/null
+package DBSchema::Result::Personality;
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class';
+
+__PACKAGE__->load_components( "PK::Auto", "Core" );
+__PACKAGE__->table("personality");
+__PACKAGE__->add_columns( "user_id" => { data_type => 'integer' }, );
+__PACKAGE__->set_primary_key("user_id");
+__PACKAGE__->has_one( 'user', 'DBSchema::Result::User', {'user_id' => 'foreign.id'}, );
+
+1;
+
sub run_tests{
my $schema = shift;
- plan tests => 40;
+ plan tests => 41;
my $dvd_rs = $schema->resultset( 'Dvd' );
my $user_rs = $schema->resultset( 'User' );
is( scalar @rel_tags, 2, 'tags related' );
ok( $rel_tags[0]->file eq 'file0' || $rel_tags[0]->file eq 'file1', 'tags related' );
+ my $new_person = {
+ name => 'Amiri Barksdale',
+ username => 'amiri',
+ password => 'amiri',
+ };
+ ok(my $new_user = $user_rs->recursive_update( $new_person ));
+ #print STDERR Dumper $new_user;
+
# $updates = {
# name => 'Test name 1',
# };