[
qw(InflateColumn::DateTime TimeStamp)
];
primary_column
addresses_id
=> {
data_type
=>
"integer"
,
is_auto_increment
=> 1,
sequence
=>
"addresses_addresses_id_seq"
,
};
column
users_id
=> {
data_type
=>
"integer"
,
};
column
type
=> {
data_type
=>
"varchar"
,
default_value
=>
""
,
size
=> 16,
};
column
archived
=> {
data_type
=>
"boolean"
,
default_value
=> 0,
};
column
first_name
=> {
data_type
=>
"varchar"
,
default_value
=>
""
,
size
=> 255,
};
column
last_name
=> {
data_type
=>
"varchar"
,
default_value
=>
""
,
size
=> 255,
};
column
company
=> {
data_type
=>
"varchar"
,
default_value
=>
""
,
size
=> 255,
};
column
address
=> {
data_type
=>
"varchar"
,
default_value
=>
""
,
size
=> 255,
};
column
address_2
=> {
data_type
=>
"varchar"
,
default_value
=>
""
,
size
=> 255,
};
column
postal_code
=> {
data_type
=>
"varchar"
,
default_value
=>
""
,
size
=> 255,
};
column
city
=> {
data_type
=>
"varchar"
,
default_value
=>
""
,
size
=> 255,
};
column
phone
=> {
data_type
=>
"varchar"
,
default_value
=>
""
,
size
=> 32,
};
column
states_id
=> {
data_type
=>
"integer"
,
is_nullable
=> 1,
};
column
country_iso_code
=> {
data_type
=>
"char"
,
size
=> 2,
};
column
priority
=> {
data_type
=>
"integer"
,
default_value
=> 0 };
column
created
=> {
data_type
=>
"datetime"
,
set_on_create
=> 1,
};
column
last_modified
=> {
data_type
=>
"datetime"
,
set_on_create
=> 1,
set_on_update
=> 1,
};
has_many
orderlines_shipping
=>
"Interchange6::Schema::Result::OrderlinesShipping"
,
{
"foreign.addresses_id"
=>
"self.addresses_id"
},
{
cascade_copy
=> 0,
cascade_delete
=> 0 };
has_many
orders
=>
"Interchange6::Schema::Result::Order"
,
{
"foreign.billing_addresses_id"
=>
"self.addresses_id"
},
{
cascade_copy
=> 0,
cascade_delete
=> 0 };
belongs_to
user
=>
"Interchange6::Schema::Result::User"
,
{
users_id
=>
"users_id"
},
{
is_deferrable
=> 1,
on_delete
=>
"CASCADE"
,
on_update
=>
"CASCADE"
};
belongs_to
state
=>
"Interchange6::Schema::Result::State"
,
{
states_id
=>
"states_id"
},
{
join_type
=>
'left'
,
is_deferrable
=> 1,
on_delete
=>
"CASCADE"
,
on_update
=>
"CASCADE"
};
belongs_to
country
=>
"Interchange6::Schema::Result::Country"
,
"country_iso_code"
,
{
is_deferrable
=> 1,
on_delete
=>
"CASCADE"
,
on_update
=>
"CASCADE"
};
many_to_many
orderlines
=>
"orderlines_shipping"
,
"orderline"
;
around
delete
=>
sub
{
my
(
$orig
,
$self
) =
@_
;
try
{
$self
->
$orig
(
@_
);
}
catch
{
my
$original_error
=
$_
;
try
{
$self
->update({
archived
=> 1});
}
catch
{
$self
->result_source->schema->throw_exception(
$original_error
);
};
};
};
1;