From 54b0964a8a1081d7082415c18ef702febb19fc18 Mon Sep 17 00:00:00 2001 From: sime-k Date: Mon, 3 Nov 2014 10:31:57 +0100 Subject: [PATCH 01/18] Create companies table. --- lib/Interchange6/Schema/Result/Company.pm | 137 ++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 lib/Interchange6/Schema/Result/Company.pm diff --git a/lib/Interchange6/Schema/Result/Company.pm b/lib/Interchange6/Schema/Result/Company.pm new file mode 100644 index 0000000..960306b --- /dev/null +++ b/lib/Interchange6/Schema/Result/Company.pm @@ -0,0 +1,137 @@ +use utf8; +package Interchange6::Schema::Result::Company; + +=head1 NAME + +Interchange6::Schema::Result::Company + +=cut + +use Interchange6::Schema::Candy -components => + [qw(InflateColumn::DateTime TimeStamp)]; + +=head1 ACCESSORS + +=head2 companies_id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + primary key + +=cut + +primary_column companies_id => { + data_type => "integer", + is_auto_increment => 1, + is_nullable => 0, +}; + +=head2 name + + data_type: 'varchar' + default_value: (empty string) + is_nullable: 0 + size: 45 + +=cut + +column name => { + data_type => "varchar", + default_value => "", + is_nullable => 0, + size => 45, +}; + +=head2 addresses_id + + data_type: 'integer' + is_foreign_key_constraint + : 1 + is_nullable: 0 + +=cut + +primary_column addresses_id => { + data_type => "integer", + is_foreign_key_constraint => 1, + is_nullable => 0, +}; + +=head2 tax_id + + data_type: 'varchar' + default_value: (empty string) + is_nullable: 0 + size: 45 + +=cut + +column tax_id => { + data_type => "varchar", + default_value => "", + is_nullable => 0, + size => 45, +}; + +=head2 phone + + data_type: 'varchar' + default_value: (empty string) + is_nullable: 0 + size: 45 + +=cut + +column phone => { + data_type => "varchar", + default_value => "", + is_nullable => 0, + size => 45, +}; + +=head2 email + + data_type: 'varchar' + default_value: (empty string) + is_nullable: 0 + size: 45 + +=cut + +column email => { + data_type => "varchar", + default_value => "", + is_nullable => 0, + size => 45, +}; + +=head1 RELATIONS + +=head2 product_company + +Type: has_many + +Related object: L + +=cut + +has_many + product_company => "Interchange6::Schema::Result::ProductCompany", + { "foreign.companies_id" => "self.companies_id" }, + { cascade_copy => 0, cascade_delete => 0 }; + +=head2 addresses + +Type: belongs_to + +Related object: L + +=cut + +belongs_to + addresses => "Interchange6::Schema::Result::Address", + { "foreign.addresses_id" => "self.addresses_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }; + +1; \ No newline at end of file From 08d54b4963ccf418f7d19123cc799f55361ce48d Mon Sep 17 00:00:00 2001 From: sime-k Date: Mon, 3 Nov 2014 10:32:18 +0100 Subject: [PATCH 02/18] Create locations table. --- lib/Interchange6/Schema/Result/Location.pm | 153 +++++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 lib/Interchange6/Schema/Result/Location.pm diff --git a/lib/Interchange6/Schema/Result/Location.pm b/lib/Interchange6/Schema/Result/Location.pm new file mode 100644 index 0000000..f42cfdc --- /dev/null +++ b/lib/Interchange6/Schema/Result/Location.pm @@ -0,0 +1,153 @@ +use utf8; +package Interchange6::Schema::Result::Location; + +=head1 NAME + +Interchange6::Schema::Result::Location + +=cut + +use Interchange6::Schema::Candy -components => + [qw(InflateColumn::DateTime TimeStamp)]; + +=head1 ACCESSORS + +=head2 locations_id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + primary key + +=cut + +primary_column locations_id => { + data_type => "integer", + is_auto_increment => 1, + is_nullable => 0, +}; + +=head2 name + + data_type: 'varchar' + default_value: (empty string) + is_nullable: 0 + size: 255 + +=cut + +column name => { + data_type => "varchar", + default_value => "", + is_nullable => 0, + size => 45, +}; + +=head2 parent_id + + data_type: 'integer' + is_nullable: 1 + +=cut + +column parent_id => { + data_type => "integer", + is_foreign_key_constraint => 1, + is_nullable => 1, +}; + + +=head2 addresses_id + + data_type: 'integer' + is_nullable: 1 + +=cut + +column addresses_id => { + data_type => "integer", + is_foreign_key_constraint => 1, + is_nullable => 1, +}; + +=head2 location_types_id + + data_type: 'integer' + is_nullable: 0 + +=cut + +column location_types_id => { + data_type => "integer", + is_foreign_key_constraint => 1, + is_nullable => 1, +}; + +=head1 RELATIONS + +=head2 address + +Type: belongs_to + +Related object: L + +=cut + +belongs_to + address => "Interchange6::Schema::Result::Address", + { "foreign.addresses_id" => "self.addresses_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }; + +=head2 children + +Type: has_many + +Related object: L + +=cut + +has_many + children => "Interchange6::Schema::Result::Location", + { "foreign.parent_id" => "self.locations_id" }, + { cascade_copy => 0, cascade_delete => 0 }; + +=head2 parent + +Type: belongs_to + +Related object: L + +=cut + +belongs_to + parent => "Interchange6::Schema::Result::Location", + { "foreign.locations_id" => "self.parent_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }; + +=head2 location_type + +Type: belongs_to + +Related object: L + +=cut + +belongs_to + location_types => "Interchange6::Schema::Result::LocationType", + { "foreign.location_types_id" => "self.location_types_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }; + +=head2 inventory_log + +Type: has_many + +Related object: L + +=cut + +has_many + inventory_logs => "Interchange6::Schema::Result::InventoryLog", + { "foreign.location_id" => "self.location_id" }, + { cascade_copy => 0, cascade_delete => 0 }; + +1; \ No newline at end of file From 77374cdf6ff46202853175608579d32e7f3722f4 Mon Sep 17 00:00:00 2001 From: sime-k Date: Mon, 3 Nov 2014 10:32:30 +0100 Subject: [PATCH 03/18] Create location_types table. --- .../Schema/Result/LocationType.pm | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 lib/Interchange6/Schema/Result/LocationType.pm diff --git a/lib/Interchange6/Schema/Result/LocationType.pm b/lib/Interchange6/Schema/Result/LocationType.pm new file mode 100644 index 0000000..71c0019 --- /dev/null +++ b/lib/Interchange6/Schema/Result/LocationType.pm @@ -0,0 +1,61 @@ +use utf8; +package Interchange6::Schema::Result::LocationType; + +=head1 NAME + +Interchange6::Schema::Result::LocationType + +=cut + +use Interchange6::Schema::Candy -components => + [qw(InflateColumn::DateTime TimeStamp)]; + +=head1 ACCESSORS + +=head2 location_types_id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + primary key + +=cut + +primary_column location_types_id => { + data_type => "integer", + is_auto_increment => 1, + is_nullable => 0, +}; + +=head2 name + + data_type: 'varchar' + default_value: (empty string) + is_nullable: 0 + size: 255 + +=cut + +column name => { + data_type => "varchar", + default_value => "", + is_nullable => 0, + size => 45, +}; + +=head1 RELATIONS + +=head2 location + +Type: has_many + +Related object: L + +=cut + +has_many + locations => "Interchange6::Schema::Result::Location", + { "foreign.location_types_id" => "self.location_types_id" }, + { cascade_copy => 0, cascade_delete => 0 }; + +1; \ No newline at end of file From 11817d6c33914b5b1c2f612098dd2911a03b2906 Mon Sep 17 00:00:00 2001 From: sime-k Date: Mon, 3 Nov 2014 10:33:52 +0100 Subject: [PATCH 04/18] Create inentory_logs table. --- .../Schema/Result/InventoryLog.pm | 143 ++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 lib/Interchange6/Schema/Result/InventoryLog.pm diff --git a/lib/Interchange6/Schema/Result/InventoryLog.pm b/lib/Interchange6/Schema/Result/InventoryLog.pm new file mode 100644 index 0000000..b3528d6 --- /dev/null +++ b/lib/Interchange6/Schema/Result/InventoryLog.pm @@ -0,0 +1,143 @@ +use utf8; +package Interchange6::Schema::Result::InventoryLog; + +=head1 NAME + +Interchange6::Schema::Result::InventoryLog + +=cut + +use Interchange6::Schema::Candy -components => + [qw(InflateColumn::DateTime TimeStamp)]; + +=head1 ACCESSORS + +=head2 inventory_logs_id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + primary key + +=cut + +primary_column inventory_logs_id => { + data_type => "integer", + is_auto_increment => 1, + is_nullable => 0, +}; + +=head2 sku + + data_type: 'varchar' + is_foreign_key_constraint: 1 + is_nullable: 0 + +=cut + +primary_column sku => { + data_type => "varchar", + is_foreign_key_constraint => 1, + is_nullable => 0, +}; + +=head2 datetime + + data_type: 'datetime' + set_on_create: 1 + is_nullable: 0 + +=cut + +column datetime => { + data_type => "datetime", + set_on_create => 1, + is_nullable => 0 +}; + +=head2 quantity + + data_type: 'decimal' + size: [9,2], + is_nullable: 0, + default_value: '0.00', + +=cut + +primary_column quantity => { + data_type => 'decimal', + size => [9,2], + is_nullable => 0, + default_value => '0.00', +}; + +=head2 locations_id + + data_type: 'integer' + is_foreign_key_constraint: 1 + is_nullable: 0 + +=cut + +primary_column locations_id => { + data_type => "integer", + is_foreign_key_constraint => 1, + is_nullable => 0, +}; + +=head2 suppliers_id + + data_type: 'integer' + is_foreign_key_constraint: 1 + is_nullable: 0 + +=cut + +primary_column suppliers_id => { + data_type => "integer", + is_foreign_key_constraint => 1, + is_nullable => 0, +}; + +=head1 RELATIONS + +=head2 location + +Type: has_many + +Related object: L + +=cut + +belongs_to + locations => "Interchange6::Schema::Result::Location", + { "foreign.locations_id" => "self.locations_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }; + +=head2 products + +Type: has_many + +Related object: L + +=cut + +belongs_to + products => "Interchange6::Schema::Result::Product", + { "foreign.sku" => "self.sku" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }; + +=head2 product_company + +Type: has_many + +Related object: L + +=cut + +belongs_to + product_companies => "Interchange6::Schema::Result::ProductCompany", + { "foreign.suppliers_id" => "self.suppliers_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }; + +1; \ No newline at end of file From 42c9128e33c044a0e9debd9195e823128c430830 Mon Sep 17 00:00:00 2001 From: sime-k Date: Mon, 3 Nov 2014 10:34:18 +0100 Subject: [PATCH 05/18] Create product_companies table. --- .../Schema/Result/ProductCompany.pm | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 lib/Interchange6/Schema/Result/ProductCompany.pm diff --git a/lib/Interchange6/Schema/Result/ProductCompany.pm b/lib/Interchange6/Schema/Result/ProductCompany.pm new file mode 100644 index 0000000..803c583 --- /dev/null +++ b/lib/Interchange6/Schema/Result/ProductCompany.pm @@ -0,0 +1,101 @@ +use utf8; +package Interchange6::Schema::Result::ProductCompany; + +=head1 NAME + +Interchange6::Schema::Result::ProductCompany + +=cut + +use Interchange6::Schema::Candy -components => + [qw(InflateColumn::DateTime TimeStamp)]; + +=head1 ACCESSORS + +=head2 suppliers_id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + primary key + +=cut + +primary_column suppliers_id => { + data_type => "integer", + is_auto_increment => 1, + is_nullable => 0, +}; + +=head2 companies_id + + data_type: 'integer' + is_foreign_key_constraint + : 1 + is_nullable: 0 + +=cut + +primary_column companies_id => { + data_type => "integer", + is_foreign_key_constraint => 1, + is_nullable => 0, +}; + +=head2 sku + + data_type: 'varchar' + is_foreign_key_constraint: 1 + is_nullable: 0 + +=cut + +column sku => { + data_type => "varchar", + is_foreign_key_constraint => 1, + is_nullable => 0, +}; + +=head1 RELATIONS + +=head2 products + +Type: belongs_to + +Related object: L + +=cut + +belongs_to + location => "Interchange6::Schema::Result::Product", + { "foreign.sku" => "self.sku" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }; + +=head2 inventory_logs + +Type: has_many + +Related object: L + +=cut + +has_many + inventory_logs => "Interchange6::Schema::Result::InventoryLog", + { "foreign.suppliers_id" => "self.suppliers_id" }, + { cascade_copy => 0, cascade_delete => 0 }; + +=head2 company + +Type: has_many + +Related object: L + +=cut + +belongs_to + product_companies => "Interchange6::Schema::Result::Company", + { "foreign.companies_id" => "self.companies_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }; + + +1; \ No newline at end of file From a5934d367fe44784a14b24aeab9fc7c226ce4ebd Mon Sep 17 00:00:00 2001 From: sime-k Date: Mon, 3 Nov 2014 10:39:48 +0100 Subject: [PATCH 06/18] Add relations in products. --- lib/Interchange6/Schema/Result/Product.pm | 29 ++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/lib/Interchange6/Schema/Result/Product.pm b/lib/Interchange6/Schema/Result/Product.pm index c5fb6f5..75f1058 100644 --- a/lib/Interchange6/Schema/Result/Product.pm +++ b/lib/Interchange6/Schema/Result/Product.pm @@ -384,7 +384,7 @@ This is considered a private method. Please see public L metho has_many _product_reviews => "Interchange6::Schema::Result::ProductReview", - "sku", { cascade_copy => 0 }; + "sku"; =head2 _reviews @@ -396,6 +396,33 @@ This is considered a private method. Accessor to related Message results. Please many_to_many _reviews => "_product_reviews", "message"; +=head2 product_company + +Type: has_many + +Related object: L + +=cut + +has_many + product_companies => "Interchange6::Schema::Result::ProductCompany", + { "foreign.sku" => "self.sku" }, + { cascade_copy => 0, cascade_delete => 0 }; + +=head2 inventory_log + +Type: has_many + +Related object: L + +=cut + +has_many + inventory_logs => "Interchange6::Schema::Result::InventoryLog", + { "foreign.sku" => "self.sku" }, + { cascade_copy => 0, cascade_delete => 0 }; + + =head1 METHODS Attribute methods are provided by the L class. From 52aafb20b8e032549a6e774f5f4b2a608d5bdd05 Mon Sep 17 00:00:00 2001 From: sime-k Date: Mon, 3 Nov 2014 10:40:11 +0100 Subject: [PATCH 07/18] Add relations in addresses. --- lib/Interchange6/Schema/Result/Address.pm | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/lib/Interchange6/Schema/Result/Address.pm b/lib/Interchange6/Schema/Result/Address.pm index 87f0404..ee74ac7 100644 --- a/lib/Interchange6/Schema/Result/Address.pm +++ b/lib/Interchange6/Schema/Result/Address.pm @@ -339,4 +339,31 @@ Composing rels: L -> orderline many_to_many orderlines => "orderlines_shipping", "orderline"; +=head2 location + +Type: has_many + +Related object: L + +=cut + +has_many + location => "Interchange6::Schema::Result::Location", + { "foreign.addresses_id" => "self.addresses_id" }, + { cascade_copy => 0, cascade_delete => 0 }; + +=head2 company + +Type: has_many + +Related object: L + +=cut + +has_many + location => "Interchange6::Schema::Result::Company", + { "foreign.addresses_id" => "self.addresses_id" }, + { cascade_copy => 0, cascade_delete => 0 }; + + 1; From 15a82d0037a7aa7a988c84bf05d3db2338882997 Mon Sep 17 00:00:00 2001 From: sime-k Date: Mon, 3 Nov 2014 13:34:31 +0100 Subject: [PATCH 08/18] Define location_types_id and addresses_id as required. --- lib/Interchange6/Schema/Result/Location.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Interchange6/Schema/Result/Location.pm b/lib/Interchange6/Schema/Result/Location.pm index f42cfdc..1d92c90 100644 --- a/lib/Interchange6/Schema/Result/Location.pm +++ b/lib/Interchange6/Schema/Result/Location.pm @@ -60,14 +60,14 @@ column parent_id => { =head2 addresses_id data_type: 'integer' - is_nullable: 1 + is_nullable: 0 =cut column addresses_id => { data_type => "integer", is_foreign_key_constraint => 1, - is_nullable => 1, + is_nullable => 0, }; =head2 location_types_id @@ -80,7 +80,7 @@ column addresses_id => { column location_types_id => { data_type => "integer", is_foreign_key_constraint => 1, - is_nullable => 1, + is_nullable => 0, }; =head1 RELATIONS From 4dc69a80a7f6b6c42d92bf7ebc03cd2eb7ac72bb Mon Sep 17 00:00:00 2001 From: sime-k Date: Tue, 4 Nov 2014 12:21:54 +0100 Subject: [PATCH 09/18] Replace Companiy with supplier --- lib/Interchange6/Schema/Result/Address.pm | 6 +++--- .../Schema/Result/InventoryLog.pm | 10 +++++----- lib/Interchange6/Schema/Result/Product.pm | 6 +++--- .../{ProductCompany.pm => ProductSupplier.pm} | 20 +++++++++---------- .../Schema/Result/{Company.pm => Supplier.pm} | 16 +++++++-------- 5 files changed, 29 insertions(+), 29 deletions(-) rename lib/Interchange6/Schema/Result/{ProductCompany.pm => ProductSupplier.pm} (79%) rename lib/Interchange6/Schema/Result/{Company.pm => Supplier.pm} (84%) diff --git a/lib/Interchange6/Schema/Result/Address.pm b/lib/Interchange6/Schema/Result/Address.pm index ee74ac7..2940e7a 100644 --- a/lib/Interchange6/Schema/Result/Address.pm +++ b/lib/Interchange6/Schema/Result/Address.pm @@ -352,16 +352,16 @@ has_many { "foreign.addresses_id" => "self.addresses_id" }, { cascade_copy => 0, cascade_delete => 0 }; -=head2 company +=head2 supplier Type: has_many -Related object: L +Related object: L =cut has_many - location => "Interchange6::Schema::Result::Company", + supplier => "Interchange6::Schema::Result::Supplier", { "foreign.addresses_id" => "self.addresses_id" }, { cascade_copy => 0, cascade_delete => 0 }; diff --git a/lib/Interchange6/Schema/Result/InventoryLog.pm b/lib/Interchange6/Schema/Result/InventoryLog.pm index b3528d6..8ed7842 100644 --- a/lib/Interchange6/Schema/Result/InventoryLog.pm +++ b/lib/Interchange6/Schema/Result/InventoryLog.pm @@ -93,7 +93,7 @@ primary_column locations_id => { =cut -primary_column suppliers_id => { +primary_column product_suppliers_id => { data_type => "integer", is_foreign_key_constraint => 1, is_nullable => 0, @@ -127,17 +127,17 @@ belongs_to { "foreign.sku" => "self.sku" }, { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }; -=head2 product_company +=head2 product_supplier Type: has_many -Related object: L +Related object: L =cut belongs_to - product_companies => "Interchange6::Schema::Result::ProductCompany", - { "foreign.suppliers_id" => "self.suppliers_id" }, + product_suppliers => "Interchange6::Schema::Result::ProductSupplier", + { "foreign.product_suppliers_id" => "self.product_suppliers_id" }, { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }; 1; \ No newline at end of file diff --git a/lib/Interchange6/Schema/Result/Product.pm b/lib/Interchange6/Schema/Result/Product.pm index 75f1058..b3e0bd2 100644 --- a/lib/Interchange6/Schema/Result/Product.pm +++ b/lib/Interchange6/Schema/Result/Product.pm @@ -396,16 +396,16 @@ This is considered a private method. Accessor to related Message results. Please many_to_many _reviews => "_product_reviews", "message"; -=head2 product_company +=head2 product_supplier Type: has_many -Related object: L +Related object: L =cut has_many - product_companies => "Interchange6::Schema::Result::ProductCompany", + product_supplier => "Interchange6::Schema::Result::ProductSupplier", { "foreign.sku" => "self.sku" }, { cascade_copy => 0, cascade_delete => 0 }; diff --git a/lib/Interchange6/Schema/Result/ProductCompany.pm b/lib/Interchange6/Schema/Result/ProductSupplier.pm similarity index 79% rename from lib/Interchange6/Schema/Result/ProductCompany.pm rename to lib/Interchange6/Schema/Result/ProductSupplier.pm index 803c583..64f56e3 100644 --- a/lib/Interchange6/Schema/Result/ProductCompany.pm +++ b/lib/Interchange6/Schema/Result/ProductSupplier.pm @@ -1,9 +1,9 @@ use utf8; -package Interchange6::Schema::Result::ProductCompany; +package Interchange6::Schema::Result::ProductSupplier; =head1 NAME -Interchange6::Schema::Result::ProductCompany +Interchange6::Schema::Result::ProductSupplier =cut @@ -21,13 +21,13 @@ use Interchange6::Schema::Candy -components => =cut -primary_column suppliers_id => { +primary_column product_suppliers_id => { data_type => "integer", is_auto_increment => 1, is_nullable => 0, }; -=head2 companies_id +=head2 suppliers_id data_type: 'integer' is_foreign_key_constraint @@ -36,7 +36,7 @@ primary_column suppliers_id => { =cut -primary_column companies_id => { +primary_column suppliers_id => { data_type => "integer", is_foreign_key_constraint => 1, is_nullable => 0, @@ -81,20 +81,20 @@ Related object: L has_many inventory_logs => "Interchange6::Schema::Result::InventoryLog", - { "foreign.suppliers_id" => "self.suppliers_id" }, + { "foreign.product_suppliers_id" => "self.product_suppliers_id" }, { cascade_copy => 0, cascade_delete => 0 }; -=head2 company +=head2 product_suppliers Type: has_many -Related object: L +Related object: L =cut belongs_to - product_companies => "Interchange6::Schema::Result::Company", - { "foreign.companies_id" => "self.companies_id" }, + product_suppliers => "Interchange6::Schema::Result::Supplier", + { "foreign.suppliers_id" => "self.suppliers_id" }, { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }; diff --git a/lib/Interchange6/Schema/Result/Company.pm b/lib/Interchange6/Schema/Result/Supplier.pm similarity index 84% rename from lib/Interchange6/Schema/Result/Company.pm rename to lib/Interchange6/Schema/Result/Supplier.pm index 960306b..48a4e44 100644 --- a/lib/Interchange6/Schema/Result/Company.pm +++ b/lib/Interchange6/Schema/Result/Supplier.pm @@ -1,9 +1,9 @@ use utf8; -package Interchange6::Schema::Result::Company; +package Interchange6::Schema::Result::Supplier; =head1 NAME -Interchange6::Schema::Result::Company +Interchange6::Schema::Result::Supplier =cut @@ -12,7 +12,7 @@ use Interchange6::Schema::Candy -components => =head1 ACCESSORS -=head2 companies_id +=head2 suppliers_id data_type: 'integer' is_auto_increment: 1 @@ -21,7 +21,7 @@ use Interchange6::Schema::Candy -components => =cut -primary_column companies_id => { +primary_column suppliers_id => { data_type => "integer", is_auto_increment => 1, is_nullable => 0, @@ -108,17 +108,17 @@ column email => { =head1 RELATIONS -=head2 product_company +=head2 product_supplier Type: has_many -Related object: L +Related object: L =cut has_many - product_company => "Interchange6::Schema::Result::ProductCompany", - { "foreign.companies_id" => "self.companies_id" }, + product_supplier => "Interchange6::Schema::Result::ProductSupplier", + { "foreign.suppliers_id" => "self.suppliers_id" }, { cascade_copy => 0, cascade_delete => 0 }; =head2 addresses From bb1ab629e343bda7b3b489563085b4c844086066 Mon Sep 17 00:00:00 2001 From: sime-k Date: Tue, 4 Nov 2014 14:36:46 +0100 Subject: [PATCH 10/18] Fix test issues and arrange many to many product_suppliers table. --- .../Schema/Result/InventoryLog.pm | 23 ++++--------------- .../Schema/Result/ProductSupplier.pm | 22 ++++-------------- lib/Interchange6/Schema/Result/Supplier.pm | 4 ++-- 3 files changed, 11 insertions(+), 38 deletions(-) diff --git a/lib/Interchange6/Schema/Result/InventoryLog.pm b/lib/Interchange6/Schema/Result/InventoryLog.pm index 8ed7842..f07d5d1 100644 --- a/lib/Interchange6/Schema/Result/InventoryLog.pm +++ b/lib/Interchange6/Schema/Result/InventoryLog.pm @@ -35,7 +35,7 @@ primary_column inventory_logs_id => { =cut -primary_column sku => { +column sku => { data_type => "varchar", is_foreign_key_constraint => 1, is_nullable => 0, @@ -64,7 +64,7 @@ column datetime => { =cut -primary_column quantity => { +column quantity => { data_type => 'decimal', size => [9,2], is_nullable => 0, @@ -79,7 +79,7 @@ primary_column quantity => { =cut -primary_column locations_id => { +column locations_id => { data_type => "integer", is_foreign_key_constraint => 1, is_nullable => 0, @@ -93,7 +93,7 @@ primary_column locations_id => { =cut -primary_column product_suppliers_id => { +column suppliers_id => { data_type => "integer", is_foreign_key_constraint => 1, is_nullable => 0, @@ -114,19 +114,6 @@ belongs_to { "foreign.locations_id" => "self.locations_id" }, { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }; -=head2 products - -Type: has_many - -Related object: L - -=cut - -belongs_to - products => "Interchange6::Schema::Result::Product", - { "foreign.sku" => "self.sku" }, - { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }; - =head2 product_supplier Type: has_many @@ -137,7 +124,7 @@ Related object: L belongs_to product_suppliers => "Interchange6::Schema::Result::ProductSupplier", - { "foreign.product_suppliers_id" => "self.product_suppliers_id" }, + { "foreign.suppliers_id" => "self.suppliers_id", "foreign.sku" => "self.sku"}, { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }; 1; \ No newline at end of file diff --git a/lib/Interchange6/Schema/Result/ProductSupplier.pm b/lib/Interchange6/Schema/Result/ProductSupplier.pm index 64f56e3..64908e4 100644 --- a/lib/Interchange6/Schema/Result/ProductSupplier.pm +++ b/lib/Interchange6/Schema/Result/ProductSupplier.pm @@ -12,21 +12,6 @@ use Interchange6::Schema::Candy -components => =head1 ACCESSORS -=head2 suppliers_id - - data_type: 'integer' - is_auto_increment: 1 - is_nullable: 0 - primary key - -=cut - -primary_column product_suppliers_id => { - data_type => "integer", - is_auto_increment => 1, - is_nullable => 0, -}; - =head2 suppliers_id data_type: 'integer' @@ -50,7 +35,7 @@ primary_column suppliers_id => { =cut -column sku => { +primary_column sku => { data_type => "varchar", is_foreign_key_constraint => 1, is_nullable => 0, @@ -67,7 +52,7 @@ Related object: L =cut belongs_to - location => "Interchange6::Schema::Result::Product", + products => "Interchange6::Schema::Result::Product", { "foreign.sku" => "self.sku" }, { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }; @@ -81,9 +66,10 @@ Related object: L has_many inventory_logs => "Interchange6::Schema::Result::InventoryLog", - { "foreign.product_suppliers_id" => "self.product_suppliers_id" }, + { "foreign.suppliers_id" => "self.suppliers_id", "foreign.sku" => "self.sku"}, { cascade_copy => 0, cascade_delete => 0 }; + =head2 product_suppliers Type: has_many diff --git a/lib/Interchange6/Schema/Result/Supplier.pm b/lib/Interchange6/Schema/Result/Supplier.pm index 48a4e44..84b24ab 100644 --- a/lib/Interchange6/Schema/Result/Supplier.pm +++ b/lib/Interchange6/Schema/Result/Supplier.pm @@ -52,7 +52,7 @@ column name => { =cut -primary_column addresses_id => { +column addresses_id => { data_type => "integer", is_foreign_key_constraint => 1, is_nullable => 0, @@ -117,7 +117,7 @@ Related object: L =cut has_many - product_supplier => "Interchange6::Schema::Result::ProductSupplier", + product_suppliers => "Interchange6::Schema::Result::ProductSupplier", { "foreign.suppliers_id" => "self.suppliers_id" }, { cascade_copy => 0, cascade_delete => 0 }; From 45a9d247098c3d584bf10a9c020b2fd74035c8ab Mon Sep 17 00:00:00 2001 From: sime-k Date: Tue, 4 Nov 2014 15:09:53 +0100 Subject: [PATCH 11/18] Fix relation InventoryLog - Location. --- lib/Interchange6/Schema/Result/Location.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Interchange6/Schema/Result/Location.pm b/lib/Interchange6/Schema/Result/Location.pm index 1d92c90..5d78ab1 100644 --- a/lib/Interchange6/Schema/Result/Location.pm +++ b/lib/Interchange6/Schema/Result/Location.pm @@ -147,7 +147,7 @@ Related object: L has_many inventory_logs => "Interchange6::Schema::Result::InventoryLog", - { "foreign.location_id" => "self.location_id" }, + { "foreign.locations_id" => "self.locations_id" }, { cascade_copy => 0, cascade_delete => 0 }; 1; \ No newline at end of file From 90b4b16db464637268ad3aa535f8e224b2e8d8f6 Mon Sep 17 00:00:00 2001 From: sime-k Date: Tue, 4 Nov 2014 15:38:13 +0100 Subject: [PATCH 12/18] Update MANIFEST. --- MANIFEST | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/MANIFEST b/MANIFEST index 8e5ceb6..ad72d45 100644 --- a/MANIFEST +++ b/MANIFEST @@ -20,6 +20,9 @@ lib/Interchange6/Schema/Result/Cart.pm lib/Interchange6/Schema/Result/CartProduct.pm lib/Interchange6/Schema/Result/Country.pm lib/Interchange6/Schema/Result/Inventory.pm +lib/Interchange6/Schema/Result/InventoryLog.pm +lib/Interchange6/Schema/Result/Location.pm +lib/Interchange6/Schema/Result/LocationType.pm lib/Interchange6/Schema/Result/Media.pm lib/Interchange6/Schema/Result/MediaDisplay.pm lib/Interchange6/Schema/Result/MediaProduct.pm @@ -43,6 +46,7 @@ lib/Interchange6/Schema/Result/Product.pm lib/Interchange6/Schema/Result/ProductAttribute.pm lib/Interchange6/Schema/Result/ProductAttributeValue.pm lib/Interchange6/Schema/Result/ProductReview.pm +lib/Interchange6/Schema/Result/ProductSupplier.pm lib/Interchange6/Schema/Result/Role.pm lib/Interchange6/Schema/Result/Session.pm lib/Interchange6/Schema/Result/Setting.pm @@ -52,6 +56,7 @@ lib/Interchange6/Schema/Result/ShipmentDestination.pm lib/Interchange6/Schema/Result/ShipmentRate.pm lib/Interchange6/Schema/Result/ShipmentMethod.pm lib/Interchange6/Schema/Result/State.pm +lib/Interchange6/Schema/Result/Supplier.pm lib/Interchange6/Schema/Result/Tax.pm lib/Interchange6/Schema/Result/User.pm lib/Interchange6/Schema/Result/UserAttribute.pm From ff6ab2e854a8b8b3bf3ae406152abf3eb8130417 Mon Sep 17 00:00:00 2001 From: sime-k Date: Tue, 4 Nov 2014 15:38:13 +0100 Subject: [PATCH 13/18] Update MANIFEST. --- MANIFEST | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/MANIFEST b/MANIFEST index 8e5ceb6..20d22a5 100644 --- a/MANIFEST +++ b/MANIFEST @@ -20,6 +20,9 @@ lib/Interchange6/Schema/Result/Cart.pm lib/Interchange6/Schema/Result/CartProduct.pm lib/Interchange6/Schema/Result/Country.pm lib/Interchange6/Schema/Result/Inventory.pm +lib/Interchange6/Schema/Result/InventoryLog.pm +lib/Interchange6/Schema/Result/Location.pm +lib/Interchange6/Schema/Result/LocationType.pm lib/Interchange6/Schema/Result/Media.pm lib/Interchange6/Schema/Result/MediaDisplay.pm lib/Interchange6/Schema/Result/MediaProduct.pm @@ -43,6 +46,7 @@ lib/Interchange6/Schema/Result/Product.pm lib/Interchange6/Schema/Result/ProductAttribute.pm lib/Interchange6/Schema/Result/ProductAttributeValue.pm lib/Interchange6/Schema/Result/ProductReview.pm +lib/Interchange6/Schema/Result/ProductSupplier.pm lib/Interchange6/Schema/Result/Role.pm lib/Interchange6/Schema/Result/Session.pm lib/Interchange6/Schema/Result/Setting.pm @@ -52,6 +56,7 @@ lib/Interchange6/Schema/Result/ShipmentDestination.pm lib/Interchange6/Schema/Result/ShipmentRate.pm lib/Interchange6/Schema/Result/ShipmentMethod.pm lib/Interchange6/Schema/Result/State.pm +lib/Interchange6/Schema/Result/Supplier.pm lib/Interchange6/Schema/Result/Tax.pm lib/Interchange6/Schema/Result/User.pm lib/Interchange6/Schema/Result/UserAttribute.pm @@ -94,3 +99,4 @@ t/lib/Test/Tax.pm t/lib/Test/User.pm t/lib/Test/Variant.pm t/lib/Test/Zone.pm + From 4b7ebcf854ae785c890b380187a742bba25d8edd Mon Sep 17 00:00:00 2001 From: sime-k Date: Tue, 11 Nov 2014 14:33:19 +0100 Subject: [PATCH 14/18] Fix schema_sanity issues. --- lib/Interchange6/Schema/Result/Address.pm | 8 ++++---- .../Schema/Result/InventoryLog.pm | 10 ++++++---- lib/Interchange6/Schema/Result/Location.pm | 20 ++++++++++--------- .../Schema/Result/LocationType.pm | 4 +--- lib/Interchange6/Schema/Result/Product.pm | 6 +++--- .../Schema/Result/ProductSupplier.pm | 3 +-- lib/Interchange6/Schema/Result/Supplier.pm | 9 ++++----- 7 files changed, 30 insertions(+), 30 deletions(-) diff --git a/lib/Interchange6/Schema/Result/Address.pm b/lib/Interchange6/Schema/Result/Address.pm index 2940e7a..b6976b0 100644 --- a/lib/Interchange6/Schema/Result/Address.pm +++ b/lib/Interchange6/Schema/Result/Address.pm @@ -339,7 +339,7 @@ Composing rels: L -> orderline many_to_many orderlines => "orderlines_shipping", "orderline"; -=head2 location +=head2 locations Type: has_many @@ -348,11 +348,11 @@ Related object: L =cut has_many - location => "Interchange6::Schema::Result::Location", + locations => "Interchange6::Schema::Result::Location", { "foreign.addresses_id" => "self.addresses_id" }, { cascade_copy => 0, cascade_delete => 0 }; -=head2 supplier +=head2 suppliers Type: has_many @@ -361,7 +361,7 @@ Related object: L =cut has_many - supplier => "Interchange6::Schema::Result::Supplier", + suppliers => "Interchange6::Schema::Result::Supplier", { "foreign.addresses_id" => "self.addresses_id" }, { cascade_copy => 0, cascade_delete => 0 }; diff --git a/lib/Interchange6/Schema/Result/InventoryLog.pm b/lib/Interchange6/Schema/Result/InventoryLog.pm index f07d5d1..74cd96d 100644 --- a/lib/Interchange6/Schema/Result/InventoryLog.pm +++ b/lib/Interchange6/Schema/Result/InventoryLog.pm @@ -32,6 +32,7 @@ primary_column inventory_logs_id => { data_type: 'varchar' is_foreign_key_constraint: 1 is_nullable: 0 + size: 64 =cut @@ -39,6 +40,7 @@ column sku => { data_type => "varchar", is_foreign_key_constraint => 1, is_nullable => 0, + size => 64, }; =head2 datetime @@ -60,7 +62,7 @@ column datetime => { data_type: 'decimal' size: [9,2], is_nullable: 0, - default_value: '0.00', + default_value: 0, =cut @@ -68,7 +70,7 @@ column quantity => { data_type => 'decimal', size => [9,2], is_nullable => 0, - default_value => '0.00', + default_value => 0, }; =head2 locations_id @@ -101,7 +103,7 @@ column suppliers_id => { =head1 RELATIONS -=head2 location +=head2 locations Type: has_many @@ -114,7 +116,7 @@ belongs_to { "foreign.locations_id" => "self.locations_id" }, { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }; -=head2 product_supplier +=head2 product_suppliers Type: has_many diff --git a/lib/Interchange6/Schema/Result/Location.pm b/lib/Interchange6/Schema/Result/Location.pm index 5d78ab1..b05b3d4 100644 --- a/lib/Interchange6/Schema/Result/Location.pm +++ b/lib/Interchange6/Schema/Result/Location.pm @@ -40,17 +40,18 @@ column name => { data_type => "varchar", default_value => "", is_nullable => 0, - size => 45, + size => 255, }; -=head2 parent_id +=head2 parents_id data_type: 'integer' + is_foreign_key_constraint: 1 is_nullable: 1 =cut -column parent_id => { +column parents_id => { data_type => "integer", is_foreign_key_constraint => 1, is_nullable => 1, @@ -60,6 +61,7 @@ column parent_id => { =head2 addresses_id data_type: 'integer' + is_foreign_key_constraint: 1 is_nullable: 0 =cut @@ -85,7 +87,7 @@ column location_types_id => { =head1 RELATIONS -=head2 address +=head2 addresses Type: belongs_to @@ -94,7 +96,7 @@ Related object: L =cut belongs_to - address => "Interchange6::Schema::Result::Address", + addresses => "Interchange6::Schema::Result::Address", { "foreign.addresses_id" => "self.addresses_id" }, { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }; @@ -111,7 +113,7 @@ has_many { "foreign.parent_id" => "self.locations_id" }, { cascade_copy => 0, cascade_delete => 0 }; -=head2 parent +=head2 parents Type: belongs_to @@ -120,11 +122,11 @@ Related object: L =cut belongs_to - parent => "Interchange6::Schema::Result::Location", + parents => "Interchange6::Schema::Result::Location", { "foreign.locations_id" => "self.parent_id" }, { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }; -=head2 location_type +=head2 location_types Type: belongs_to @@ -137,7 +139,7 @@ belongs_to { "foreign.location_types_id" => "self.location_types_id" }, { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }; -=head2 inventory_log +=head2 inventory_logs Type: has_many diff --git a/lib/Interchange6/Schema/Result/LocationType.pm b/lib/Interchange6/Schema/Result/LocationType.pm index 71c0019..4bab2c8 100644 --- a/lib/Interchange6/Schema/Result/LocationType.pm +++ b/lib/Interchange6/Schema/Result/LocationType.pm @@ -32,7 +32,6 @@ primary_column location_types_id => { data_type: 'varchar' default_value: (empty string) is_nullable: 0 - size: 255 =cut @@ -40,12 +39,11 @@ column name => { data_type => "varchar", default_value => "", is_nullable => 0, - size => 45, }; =head1 RELATIONS -=head2 location +=head2 locations Type: has_many diff --git a/lib/Interchange6/Schema/Result/Product.pm b/lib/Interchange6/Schema/Result/Product.pm index b3e0bd2..ce212ef 100644 --- a/lib/Interchange6/Schema/Result/Product.pm +++ b/lib/Interchange6/Schema/Result/Product.pm @@ -396,7 +396,7 @@ This is considered a private method. Accessor to related Message results. Please many_to_many _reviews => "_product_reviews", "message"; -=head2 product_supplier +=head2 product_suppliers Type: has_many @@ -405,11 +405,11 @@ Related object: L =cut has_many - product_supplier => "Interchange6::Schema::Result::ProductSupplier", + product_suppliers => "Interchange6::Schema::Result::ProductSupplier", { "foreign.sku" => "self.sku" }, { cascade_copy => 0, cascade_delete => 0 }; -=head2 inventory_log +=head2 inventory_logs Type: has_many diff --git a/lib/Interchange6/Schema/Result/ProductSupplier.pm b/lib/Interchange6/Schema/Result/ProductSupplier.pm index 64908e4..a6a7c7a 100644 --- a/lib/Interchange6/Schema/Result/ProductSupplier.pm +++ b/lib/Interchange6/Schema/Result/ProductSupplier.pm @@ -15,8 +15,7 @@ use Interchange6::Schema::Candy -components => =head2 suppliers_id data_type: 'integer' - is_foreign_key_constraint - : 1 + is_foreign_key_constraint: 1 is_nullable: 0 =cut diff --git a/lib/Interchange6/Schema/Result/Supplier.pm b/lib/Interchange6/Schema/Result/Supplier.pm index 84b24ab..6ecf9fa 100644 --- a/lib/Interchange6/Schema/Result/Supplier.pm +++ b/lib/Interchange6/Schema/Result/Supplier.pm @@ -32,7 +32,7 @@ primary_column suppliers_id => { data_type: 'varchar' default_value: (empty string) is_nullable: 0 - size: 45 + size: 255 =cut @@ -40,14 +40,13 @@ column name => { data_type => "varchar", default_value => "", is_nullable => 0, - size => 45, + size => 255, }; =head2 addresses_id data_type: 'integer' - is_foreign_key_constraint - : 1 + is_foreign_key_constraint: 1 is_nullable: 0 =cut @@ -108,7 +107,7 @@ column email => { =head1 RELATIONS -=head2 product_supplier +=head2 product_suppliers Type: has_many From e3d4f1873244c6541a139b5e9206839bbab902f0 Mon Sep 17 00:00:00 2001 From: sime-k Date: Tue, 11 Nov 2014 15:42:53 +0100 Subject: [PATCH 15/18] Fix schema_sanity issues 2. --- lib/Interchange6/Schema/Result/Location.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Interchange6/Schema/Result/Location.pm b/lib/Interchange6/Schema/Result/Location.pm index b05b3d4..265adb5 100644 --- a/lib/Interchange6/Schema/Result/Location.pm +++ b/lib/Interchange6/Schema/Result/Location.pm @@ -110,7 +110,7 @@ Related object: L has_many children => "Interchange6::Schema::Result::Location", - { "foreign.parent_id" => "self.locations_id" }, + { "foreign.parents_id" => "self.locations_id" }, { cascade_copy => 0, cascade_delete => 0 }; =head2 parents @@ -123,7 +123,7 @@ Related object: L belongs_to parents => "Interchange6::Schema::Result::Location", - { "foreign.locations_id" => "self.parent_id" }, + { "foreign.locations_id" => "self.parents_id" }, { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }; =head2 location_types From 09e838cafa9158621e6a0e2348d2842989f8ecdd Mon Sep 17 00:00:00 2001 From: sime-k Date: Tue, 11 Nov 2014 16:03:39 +0100 Subject: [PATCH 16/18] Fix schema_sanity issues 3. --- lib/Interchange6/Schema/Result/LocationType.pm | 2 ++ lib/Interchange6/Schema/Result/ProductSupplier.pm | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib/Interchange6/Schema/Result/LocationType.pm b/lib/Interchange6/Schema/Result/LocationType.pm index 4bab2c8..4e8ae6c 100644 --- a/lib/Interchange6/Schema/Result/LocationType.pm +++ b/lib/Interchange6/Schema/Result/LocationType.pm @@ -31,6 +31,7 @@ primary_column location_types_id => { data_type: 'varchar' default_value: (empty string) + size: 45 is_nullable: 0 =cut @@ -38,6 +39,7 @@ primary_column location_types_id => { column name => { data_type => "varchar", default_value => "", + size => 45, is_nullable => 0, }; diff --git a/lib/Interchange6/Schema/Result/ProductSupplier.pm b/lib/Interchange6/Schema/Result/ProductSupplier.pm index a6a7c7a..858e8c3 100644 --- a/lib/Interchange6/Schema/Result/ProductSupplier.pm +++ b/lib/Interchange6/Schema/Result/ProductSupplier.pm @@ -30,12 +30,14 @@ primary_column suppliers_id => { data_type: 'varchar' is_foreign_key_constraint: 1 + size: 64 is_nullable: 0 =cut primary_column sku => { data_type => "varchar", + size => 64, is_foreign_key_constraint => 1, is_nullable => 0, }; From d9983c2955bb626815b0d8491cadb727a46843da Mon Sep 17 00:00:00 2001 From: sime-k Date: Wed, 12 Nov 2014 10:49:18 +0100 Subject: [PATCH 17/18] Fix schema_sanity issues 4. --- lib/Interchange6/Schema/Result/InventoryLog.pm | 10 +++++----- lib/Interchange6/Schema/Result/Location.pm | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/Interchange6/Schema/Result/InventoryLog.pm b/lib/Interchange6/Schema/Result/InventoryLog.pm index 74cd96d..9c95e71 100644 --- a/lib/Interchange6/Schema/Result/InventoryLog.pm +++ b/lib/Interchange6/Schema/Result/InventoryLog.pm @@ -59,15 +59,15 @@ column datetime => { =head2 quantity - data_type: 'decimal' - size: [9,2], - is_nullable: 0, - default_value: 0, + data_type: 'numeric' + size: [9,2] + is_nullable: 0 + default_value: 0 =cut column quantity => { - data_type => 'decimal', + data_type => 'numeric', size => [9,2], is_nullable => 0, default_value => 0, diff --git a/lib/Interchange6/Schema/Result/Location.pm b/lib/Interchange6/Schema/Result/Location.pm index 265adb5..4f292fb 100644 --- a/lib/Interchange6/Schema/Result/Location.pm +++ b/lib/Interchange6/Schema/Result/Location.pm @@ -75,6 +75,7 @@ column addresses_id => { =head2 location_types_id data_type: 'integer' + is_foreign_key_constraint: 1 is_nullable: 0 =cut From 4f87613edeb1e6f27912638b159b235ea70b8409 Mon Sep 17 00:00:00 2001 From: sime-k Date: Wed, 12 Nov 2014 11:18:18 +0100 Subject: [PATCH 18/18] Add decimal data_type to t/schema_sanity.t. --- t/schema_sanity.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/schema_sanity.t b/t/schema_sanity.t index 4efbc4b..a83daff 100644 --- a/t/schema_sanity.t +++ b/t/schema_sanity.t @@ -156,7 +156,7 @@ test 'schema_sanity' => sub { && cmp_ok( $size, '>=', 1, "size >= 1 for $source_name $column" ); } - elsif ( $data_type eq 'numeric' ) { + elsif ( $data_type =~ /^(numeric|decimal)$/) { ok( defined $size, "size is defined for $source_name $column" ) && ok( ref($size) eq 'ARRAY', "and is an array" ) && cmp_ok( scalar @$size, '==', 2, "that has 2 elements" )