Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

c

  • Loading branch information...
commit 658862dbf14cbb57bbb240749f1960d350b0ccc2 1 parent 5804b45
@f-marais authored
View
20 lib/Schema.pm
@@ -0,0 +1,20 @@
+use utf8;
+package Schema;
+
+# Created by DBIx::Class::Schema::Loader
+# DO NOT MODIFY THE FIRST PART OF THIS FILE
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class::Schema';
+
+__PACKAGE__->load_namespaces;
+
+
+# Created by DBIx::Class::Schema::Loader v0.07024 @ 2012-07-07 20:41:59
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:TkV4mYLu3oRA5irrLYyhLA
+
+
+# You can replace this text with custom code or comments, and it will be preserved on regeneration
+1;
View
92 lib/Schema/Result/E2e.pm
@@ -0,0 +1,92 @@
+use utf8;
+package Schema::Result::E2e;
+
+# Created by DBIx::Class::Schema::Loader
+# DO NOT MODIFY THE FIRST PART OF THIS FILE
+
+=head1 NAME
+
+Schema::Result::E2e
+
+=cut
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class::Core';
+
+=head1 TABLE: C<e2e>
+
+=cut
+
+__PACKAGE__->table("e2e");
+
+=head1 ACCESSORS
+
+=head2 left_id
+
+ data_type: 'integer'
+ is_foreign_key: 1
+ is_nullable: 0
+
+=head2 right_id
+
+ data_type: 'integer'
+ is_foreign_key: 1
+ is_nullable: 0
+
+=head2 bus_rule
+
+ data_type: 'text'
+ is_nullable: 1
+
+=cut
+
+__PACKAGE__->add_columns(
+ "left_id",
+ { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
+ "right_id",
+ { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
+ "bus_rule",
+ { data_type => "text", is_nullable => 1 },
+);
+
+=head1 RELATIONS
+
+=head2 left
+
+Type: belongs_to
+
+Related object: L<Schema::Result::Entity>
+
+=cut
+
+__PACKAGE__->belongs_to(
+ "left",
+ "Schema::Result::Entity",
+ { et_id => "left_id" },
+ { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
+);
+
+=head2 right
+
+Type: belongs_to
+
+Related object: L<Schema::Result::Entity>
+
+=cut
+
+__PACKAGE__->belongs_to(
+ "right",
+ "Schema::Result::Entity",
+ { et_id => "right_id" },
+ { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
+);
+
+
+# Created by DBIx::Class::Schema::Loader v0.07024 @ 2012-07-07 20:41:59
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:0pCqfGpRExI9r7p/HpdkXg
+
+
+# You can replace this text with custom code or comments, and it will be preserved on regeneration
+1;
View
32 lib/Schema/Result/EntListVw.pm
@@ -0,0 +1,32 @@
+package Schema::Result::EntListVw;
+
+use base qw/DBIx::Class::Core/;
+
+__PACKAGE__->table_class('DBIx::Class::ResultSource::View');
+
+__PACKAGE__->table('entlist_vw');
+__PACKAGE__->result_source_instance->is_virtual(1);
+__PACKAGE__->result_source_instance->view_definition(
+ qq{
+select distinct ifnull(c.name,f.src_em_nm) 'em_nm',
+ ifnull(c.version,f.src_em_version) 'em_version',
+ ifnull(b.name,'N/A') 'tgt_ent_nm',
+ ifnull(f.src_ent_nm,'N/A') src_ent_nm
+ from item a join entity b on a.et_id=b.et_id
+ join entity_master c on b.em_id=c.em_id
+ left join (select c.tgt_id, e.name 'src_ent_nm',
+ g.name 'src_em_nm', g.version 'src_em_version'
+ from i2i c, item d, entity e, entity_master g
+ where e.em_id=g.em_id and c.src_id=d.it_id and d.et_id=e.et_id) f
+ on a.it_id=f.tgt_id
+ where b.name like '%ALLOCATION%'
+ and c.max_version=1
+ order by b.name, c.name, c.version desc });
+
+__PACKAGE__->add_columns(
+'em_nm' => { is_numeric=>0,data_type => 'varchar', },
+'version' => { is_numeric=>0,data_type => 'varchar', },
+'tgt_ent_nm' => { is_numeric=>0,data_type => 'varchar', },
+'src_ent_nm' => { is_numeric=>0,data_type => 'varchar', },
+);
+1;
View
207 lib/Schema/Result/Entity.pm
@@ -0,0 +1,207 @@
+use utf8;
+package Schema::Result::Entity;
+
+# Created by DBIx::Class::Schema::Loader
+# DO NOT MODIFY THE FIRST PART OF THIS FILE
+
+=head1 NAME
+
+Schema::Result::Entity
+
+=cut
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class::Core';
+
+=head1 TABLE: C<entity>
+
+=cut
+
+__PACKAGE__->table("entity");
+
+=head1 ACCESSORS
+
+=head2 et_id
+
+ data_type: 'integer'
+ is_auto_increment: 1
+ is_nullable: 0
+
+=head2 em_id
+
+ data_type: 'integer'
+ is_foreign_key: 1
+ is_nullable: 0
+
+=head2 name
+
+ data_type: 'text'
+ is_nullable: 1
+
+=head2 type
+
+ data_type: 'text'
+ is_nullable: 1
+
+=head2 grain
+
+ data_type: 'text'
+ is_nullable: 1
+
+=head2 retention
+
+ data_type: 'text'
+ is_nullable: 1
+
+=head2 format
+
+ data_type: 'char'
+ is_nullable: 1
+ size: 30
+
+=head2 latency
+
+ data_type: 'char'
+ is_nullable: 1
+ size: 100
+
+=head2 frequency
+
+ data_type: 'char'
+ is_nullable: 1
+ size: 100
+
+=head2 scope
+
+ data_type: 'text'
+ is_nullable: 1
+
+=head2 parameters
+
+ data_type: 'text'
+ is_nullable: 1
+
+=head2 comment
+
+ data_type: 'text'
+ is_nullable: 1
+
+=head2 description
+
+ data_type: 'text'
+ is_nullable: 1
+
+=cut
+
+__PACKAGE__->add_columns(
+ "et_id",
+ { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
+ "em_id",
+ { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
+ "name",
+ { data_type => "text", is_nullable => 1 },
+ "type",
+ { data_type => "text", is_nullable => 1 },
+ "grain",
+ { data_type => "text", is_nullable => 1 },
+ "retention",
+ { data_type => "text", is_nullable => 1 },
+ "format",
+ { data_type => "char", is_nullable => 1, size => 30 },
+ "latency",
+ { data_type => "char", is_nullable => 1, size => 100 },
+ "frequency",
+ { data_type => "char", is_nullable => 1, size => 100 },
+ "scope",
+ { data_type => "text", is_nullable => 1 },
+ "parameters",
+ { data_type => "text", is_nullable => 1 },
+ "comment",
+ { data_type => "text", is_nullable => 1 },
+ "description",
+ { data_type => "text", is_nullable => 1 },
+);
+
+=head1 PRIMARY KEY
+
+=over 4
+
+=item * L</et_id>
+
+=back
+
+=cut
+
+__PACKAGE__->set_primary_key("et_id");
+
+=head1 RELATIONS
+
+=head2 e2e_lefts
+
+Type: has_many
+
+Related object: L<Schema::Result::E2e>
+
+=cut
+
+__PACKAGE__->has_many(
+ "e2e_lefts",
+ "Schema::Result::E2e",
+ { "foreign.left_id" => "self.et_id" },
+ { cascade_copy => 0, cascade_delete => 1 },
+);
+
+=head2 e2e_rights
+
+Type: has_many
+
+Related object: L<Schema::Result::E2e>
+
+=cut
+
+__PACKAGE__->has_many(
+ "e2e_rights",
+ "Schema::Result::E2e",
+ { "foreign.right_id" => "self.et_id" },
+ { cascade_copy => 0, cascade_delete => 1 },
+);
+
+=head2 em
+
+Type: belongs_to
+
+Related object: L<Schema::Result::EntityMaster>
+
+=cut
+
+__PACKAGE__->belongs_to(
+ "em",
+ "Schema::Result::EntityMaster",
+ { em_id => "em_id" },
+ { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
+);
+
+=head2 items
+
+Type: has_many
+
+Related object: L<Schema::Result::Item>
+
+=cut
+
+__PACKAGE__->has_many(
+ "items",
+ "Schema::Result::Item",
+ { "foreign.et_id" => "self.et_id" },
+ { cascade_copy => 0, cascade_delete => 1 },
+);
+
+
+# Created by DBIx::Class::Schema::Loader v0.07024 @ 2012-07-07 20:41:59
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:vYQUSN3YMvOLg6tT0Ouw6Q
+
+
+# You can replace this text with custom code or comments, and it will be preserved on regeneration
+1;
View
99 lib/Schema/Result/EntityMaster.pm
@@ -0,0 +1,99 @@
+use utf8;
+package Schema::Result::EntityMaster;
+
+# Created by DBIx::Class::Schema::Loader
+# DO NOT MODIFY THE FIRST PART OF THIS FILE
+
+=head1 NAME
+
+Schema::Result::EntityMaster
+
+=cut
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class::Core';
+
+=head1 TABLE: C<entity_master>
+
+=cut
+
+__PACKAGE__->table("entity_master");
+
+=head1 ACCESSORS
+
+=head2 em_id
+
+ data_type: 'integer'
+ is_auto_increment: 1
+ is_nullable: 0
+
+=head2 name
+
+ data_type: 'text'
+ is_nullable: 1
+
+=head2 version
+
+ data_type: 'numeric'
+ is_nullable: 1
+ size: [4,2]
+
+=cut
+
+__PACKAGE__->add_columns(
+ "em_id",
+ { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
+ "name",
+ { data_type => "text", is_nullable => 1 },
+ "type",
+ { data_type => "text", is_nullable => 1 },
+ "rel_notes",
+ { data_type => "text", is_nullable => 1 },
+ "max_version",
+ { data_type => "boolean", is_nullable => 1 },
+ "author",
+ { data_type => "text", is_nullable => 1 },
+ "uploaded",
+ { data_type => "date", is_nullable => 1 },
+ "version",
+ { data_type => "text", is_nullable => 1 },
+);
+
+=head1 PRIMARY KEY
+
+=over 4
+
+=item * L</em_id>
+
+=back
+
+=cut
+
+__PACKAGE__->set_primary_key("em_id");
+
+=head1 RELATIONS
+
+=head2 entities
+
+Type: has_many
+
+Related object: L<Schema::Result::Entity>
+
+=cut
+
+__PACKAGE__->has_many(
+ "entities",
+ "Schema::Result::Entity",
+ { "foreign.em_id" => "self.em_id" },
+ { cascade_copy => 0, cascade_delete => 1 },
+);
+
+
+# Created by DBIx::Class::Schema::Loader v0.07024 @ 2012-07-07 20:41:59
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:RghMxcHDvht6RC2RFsl3nQ
+
+
+# You can replace this text with custom code or comments, and it will be preserved on regeneration
+1;
View
96 lib/Schema/Result/I2i.pm
@@ -0,0 +1,96 @@
+use utf8;
+package Schema::Result::I2i;
+
+# Created by DBIx::Class::Schema::Loader
+# DO NOT MODIFY THE FIRST PART OF THIS FILE
+
+=head1 NAME
+
+Schema::Result::I2i
+
+=cut
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class::Core';
+
+=head1 TABLE: C<i2i>
+
+=cut
+
+__PACKAGE__->table("i2i");
+
+=head1 ACCESSORS
+
+=head2 src_id
+
+ data_type: 'integer'
+ is_foreign_key: 1
+ is_nullable: 0
+
+=head2 tgt_id
+
+ data_type: 'integer'
+ is_foreign_key: 1
+ is_nullable: 0
+
+=head2 bus_rule
+
+ data_type: 'text'
+ is_nullable: 1
+
+=cut
+
+__PACKAGE__->add_columns(
+ "src_id",
+ { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
+ "tgt_id",
+ { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
+ "bus_rule",
+ { data_type => "text", is_nullable => 1 },
+);
+
+=head1 RELATIONS
+
+=head2 src
+
+Type: belongs_to
+
+Related object: L<Schema::Result::Item>
+
+=cut
+
+__PACKAGE__->belongs_to(
+ "src",
+ "Schema::Result::Item",
+ { it_id => "src_id" },
+ { is_deferrable => 1,
+ cascade_delete => 1,
+ on_delete => "CASCADE", on_update => "CASCADE" },
+);
+
+=head2 tgt
+
+Type: belongs_to
+
+Related object: L<Schema::Result::Item>
+
+=cut
+
+__PACKAGE__->belongs_to(
+ "tgt",
+ "Schema::Result::Item",
+ { it_id => "tgt_id" },
+ { is_deferrable => 1,
+ cascade_delete => 1,
+ on_delete => "CASCADE", on_update => "CASCADE" },
+);
+
+
+# Created by DBIx::Class::Schema::Loader v0.07024 @ 2012-07-07 20:41:59
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:fVV0WGO1ICWBxEL3S//H2w
+
+
+# You can replace this text with custom code or comments, and it will be preserved on regeneration
+1;
View
158 lib/Schema/Result/Item.pm
@@ -0,0 +1,158 @@
+use utf8;
+package Schema::Result::Item;
+
+# Created by DBIx::Class::Schema::Loader
+# DO NOT MODIFY THE FIRST PART OF THIS FILE
+
+=head1 NAME
+
+Schema::Result::Item
+
+=cut
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class::Core';
+
+=head1 TABLE: C<item>
+
+=cut
+
+__PACKAGE__->table("item");
+
+=head1 ACCESSORS
+
+=head2 it_id
+
+ data_type: 'integer'
+ is_auto_increment: 1
+ is_nullable: 0
+
+=head2 seq
+
+ data_type: 'numeric'
+ is_nullable: 1
+ size: 4
+
+=head2 et_id
+
+ data_type: 'integer'
+ is_foreign_key: 1
+ is_nullable: 0
+
+=head2 name
+
+ data_type: 'text'
+ is_nullable: 1
+
+=head2 type
+
+ data_type: 'char'
+ is_nullable: 1
+ size: 100
+
+=head2 scale
+
+ data_type: 'smallint'
+ is_nullable: 1
+
+=head2 precision
+
+ data_type: 'smallint'
+ is_nullable: 1
+
+=head2 bus_rule
+
+ data_type: 'text'
+ is_nullable: 1
+
+=cut
+
+__PACKAGE__->add_columns(
+ "it_id",
+ { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
+ "seq",
+ { data_type => "numeric", is_nullable => 1, size => 4 },
+ "et_id",
+ { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
+ "name",
+ { data_type => "text", is_nullable => 1 },
+ "type",
+ { data_type => "char", is_nullable => 1, size => 100 },
+ "scale",
+ { data_type => "integer", is_nullable => 1 },
+ "precision",
+ { data_type => "integer", is_nullable => 1 },
+ "bus_rule",
+ { data_type => "text", is_nullable => 1 },
+ "deflt",
+ { data_type => "text", is_nullable => 1 },
+);
+
+=head1 PRIMARY KEY
+
+=over 4
+
+=item * L</it_id>
+
+=back
+
+=cut
+
+__PACKAGE__->set_primary_key("it_id");
+
+=head1 RELATIONS
+
+=head2 et
+
+Type: belongs_to
+
+Related object: L<Schema::Result::Entity>
+
+=cut
+
+__PACKAGE__->belongs_to(
+ "et",
+ "Schema::Result::Entity",
+ { et_id => "et_id" },
+ { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
+);
+
+=head2 i2i_srcs
+
+Type: has_many
+
+Related object: L<Schema::Result::I2i>
+
+=cut
+
+__PACKAGE__->has_many(
+ "i2i_srcs",
+ "Schema::Result::I2i",
+ { "foreign.src_id" => "self.it_id" },
+ { cascade_copy => 0, cascade_delete => 1 },
+);
+
+=head2 i2i_tgts
+
+Type: has_many
+
+Related object: L<Schema::Result::I2i>
+
+=cut
+
+__PACKAGE__->has_many(
+ "i2i_tgts",
+ "Schema::Result::I2i",
+ { "foreign.tgt_id" => "self.it_id" },
+ { cascade_copy => 0, cascade_delete => 1 },
+);
+
+
+# Created by DBIx::Class::Schema::Loader v0.07024 @ 2012-07-07 20:41:59
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:sd0SRS+C/U0RIl1atIMYig
+
+
+# You can replace this text with custom code or comments, and it will be preserved on regeneration
+1;
View
45 lib/Schema/Result/StmListVw.pm
@@ -0,0 +1,45 @@
+package Schema::Result::StmListVw;
+
+use base qw/DBIx::Class::Core/;
+
+__PACKAGE__->table_class('DBIx::Class::ResultSource::View');
+
+__PACKAGE__->table('entdet_vw');
+__PACKAGE__->result_source_instance->is_virtual(1);
+__PACKAGE__->result_source_instance->view_definition(
+ qq{
+select c.name em_nm,b.name tgt_ent_nm,a.name tgt_itm_nm,
+ a.type tgt_itm_type, a.precision tgt_itm_precision,
+ a.scale tgt_itm_scale, a.bus_rule,
+ ifnull(f.src_itm_nm,' ') src_itm_nm,
+ ifnull(f.src_itm_type,' ') src_itm_type,
+ ifnull(f.src_itm_precision,' ') src_itm_precision,
+ ifnull(f.src_ent_nm,' ') src_ent_nm,
+ a.deflt, a.seq
+ from item a join entity b on a.et_id=b.et_id
+ join entity_master c on b.em_id=c.em_id
+ join (select c.tgt_id,d.name src_itm_nm,
+ d.type src_itm_type, d.precision src_itm_precision,
+ e.name src_ent_nm,d.seq src_seq
+ from i2i c, item d, entity e
+ where c.src_id=d.it_id and d.et_id=e.et_id) f
+ on a.it_id=f.tgt_id
+ where c.max_version=1
+ order by a.seq,f.src_seq
+});
+
+__PACKAGE__->add_columns(
+'em_nm' => { is_numeric=>0,data_type => 'varchar', },
+'tgt_ent_nm' => { is_numeric=>0,data_type => 'varchar', },
+'tgt_itm_nm' => { is_numeric=>0,data_type => 'varchar', },
+'tgt_itm_type' => { is_numeric=>0,data_type => 'varchar', },
+'tgt_itm_precision' => { is_numeric=>1,data_type => 'integer', },
+'tgt_itm_scale' => { is_numeric=>1,data_type => 'integer', },
+'bus_rule' => { is_numeric=>0,data_type => 'varchar', },
+'src_itm_nm' => { is_numeric=>0,data_type => 'varchar', },
+'src_itm_type' => { is_numeric=>0,data_type => 'varchar', },
+'src_itm_precision' => { is_numeric=>1,data_type => 'integer', },
+'src_ent_nm' => { is_numeric=>0,data_type => 'varchar', },
+'deflt' => { is_numeric=>0,data_type => 'varchar', },
+);
+1;
Please sign in to comment.
Something went wrong with that request. Please try again.