Add strict/warnings test, adjust all offenders (wow, that was a lot)
[dbsrgits/DBIx-Class.git] / t / lib / DBICTest / Schema / TreeLike.pm
CommitLineData
8273e845 1package # hide from PAUSE
c6d74d3e 2 DBICTest::Schema::TreeLike;
38a0b4ff 3
4a233f30 4use warnings;
5use strict;
6
660cf1be 7use base qw/DBICTest::BaseResult/;
38a0b4ff 8
9__PACKAGE__->table('treelike');
10__PACKAGE__->add_columns(
11 'id' => { data_type => 'integer', is_auto_increment => 1 },
61177e44 12 'parent' => { data_type => 'integer' , is_nullable=>1},
cb561d1a 13 'name' => { data_type => 'varchar',
14 size => 100,
15 },
38a0b4ff 16);
17__PACKAGE__->set_primary_key(qw/id/);
5db49b9a 18__PACKAGE__->belongs_to('parent', 'TreeLike',
61177e44 19 { 'foreign.id' => 'self.parent' });
20__PACKAGE__->has_many('children', 'TreeLike', { 'foreign.parent' => 'self.id' });
38a0b4ff 21
89cf6a70 22## since this is a self referential table we need to do a post deploy hook and get
23## some data in while constraints are off
24
25 sub sqlt_deploy_hook {
26 my ($self, $sqlt_table) = @_;
27
64cdad22 28 ## We don't seem to need this anymore, but keeping it for the moment
29 ## $sqlt_table->add_index(name => 'idx_name', fields => ['name']);
89cf6a70 30 }
38a0b4ff 311;