Update organisation with extra information required for entity upgrade

This commit is contained in:
Tom Bloor 2017-08-31 12:29:06 +01:00
parent 7042020969
commit 4f99ef82f6

View file

@ -15,6 +15,11 @@ __PACKAGE__->add_columns(
is_auto_increment => 1, is_auto_increment => 1,
is_nullable => 0, is_nullable => 0,
}, },
entity_id => {
data_type => 'integer',
is_nullable => 0,
is_foreign_key => 1,
},
name => { name => {
data_type => 'varchar', data_type => 'varchar',
size => 255, size => 255,
@ -34,27 +39,33 @@ __PACKAGE__->add_columns(
size => 16, size => 16,
is_nullable => 1, is_nullable => 1,
}, },
country => {
data_type => 'varchar',
size => 255,
is_nullable => 1,
},
sector => { sector => {
data_type => "varchar", data_type => 'varchar',
size => 1, size => 1,
is_nullable => 1, is_nullable => 1,
}, },
pending => {
data_type => 'boolean',
default_value => \"0",
is_nullable => 0,
},
submitted_by_id => {
data_type => 'integer',
is_nullable => 1,
},
); );
__PACKAGE__->set_primary_key('id'); __PACKAGE__->set_primary_key('id');
__PACKAGE__->has_many( __PACKAGE__->belongs_to(
"transactions", "entity",
"Pear::LocalLoop::Schema::Result::Transaction", "Pear::LocalLoop::Schema::Result::Entity",
{ "foreign.seller_id" => 'self.id' }, "entity_id",
{ cascade_copy => 0, cascade_delete => 0 },
);
__PACKAGE__->might_have(
"user",
"Pear::LocalLoop::Schema::Result::User",
{ "foreign.organisation_id" => 'self.id' },
{ cascade_copy => 0, cascade_delete => 0 },
); );
1; 1;