From 4f99ef82f6ba74e1c1ad72b06e3e8f396d2c8bfe Mon Sep 17 00:00:00 2001 From: Tom Bloor Date: Thu, 31 Aug 2017 12:29:06 +0100 Subject: [PATCH] Update organisation with extra information required for entity upgrade --- .../LocalLoop/Schema/Result/Organisation.pm | 37 ++++++++++++------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/lib/Pear/LocalLoop/Schema/Result/Organisation.pm b/lib/Pear/LocalLoop/Schema/Result/Organisation.pm index 5967644..a178e07 100644 --- a/lib/Pear/LocalLoop/Schema/Result/Organisation.pm +++ b/lib/Pear/LocalLoop/Schema/Result/Organisation.pm @@ -15,6 +15,11 @@ __PACKAGE__->add_columns( is_auto_increment => 1, is_nullable => 0, }, + entity_id => { + data_type => 'integer', + is_nullable => 0, + is_foreign_key => 1, + }, name => { data_type => 'varchar', size => 255, @@ -34,27 +39,33 @@ __PACKAGE__->add_columns( size => 16, is_nullable => 1, }, + country => { + data_type => 'varchar', + size => 255, + is_nullable => 1, + }, sector => { - data_type => "varchar", + data_type => 'varchar', size => 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__->has_many( - "transactions", - "Pear::LocalLoop::Schema::Result::Transaction", - { "foreign.seller_id" => 'self.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 }, +__PACKAGE__->belongs_to( + "entity", + "Pear::LocalLoop::Schema::Result::Entity", + "entity_id", ); 1;