This was a PAID request by a CAS license holder that uses CAS for Real Estate purposes.
As per title, I've increased the prices related fields from a decimal(10,2) to a decimal(12,2). This allows CAS to be used for Real Estate where the max of 99,999,999.99 limits high end property sales that are in the 100's of millions and for large land or business that go into the billions.
For those that don't know, decimal(10,2) means a max of 8 digits to the left and 2 digits to the right so a max of 99,999,999.99, where as a decimal(12,2) means a max of 10 digits to the left and 2 digits to the right, so a max of 9,999,999,999.99.
Note: Not all decimal(10,2) fields have been changed, just the 10 "price" related fields as shown below.
Here are the 5 tables with field changes related to this update...
As per title, I've increased the prices related fields from a decimal(10,2) to a decimal(12,2). This allows CAS to be used for Real Estate where the max of 99,999,999.99 limits high end property sales that are in the 100's of millions and for large land or business that go into the billions.
For those that don't know, decimal(10,2) means a max of 8 digits to the left and 2 digits to the right so a max of 99,999,999.99, where as a decimal(12,2) means a max of 10 digits to the left and 2 digits to the right, so a max of 9,999,999,999.99.
Note: Not all decimal(10,2) fields have been changed, just the 10 "price" related fields as shown below.
Here are the 5 tables with field changes related to this update...
PHP:
public function upgrade2022970Step1()
{
$this->alterTable('xf_xa_cas_ad', function(Alter $table)
{
$table->changeColumn('price', 'decimal', '12,2')->setDefault(0.00);
$table->changeColumn('to_price', 'decimal', '12,2');
$table->changeColumn('sale_price', 'decimal', '12,2');
$table->changeColumn('to_sale_price', 'decimal', '12,2');
});
$this->alterTable('xf_xa_cas_item', function(Alter $table)
{
$table->changeColumn('price', 'decimal', '12,2')->setDefault(0.00);
$table->changeColumn('sale_price', 'decimal', '12,2')->setDefault(0.00);
});
$this->alterTable('xf_xa_cas_offer', function(Alter $table)
{
$table->changeColumn('offer_price', 'decimal', '12,2')->setDefault(0.00);
});
$this->alterTable('xf_xa_cas_offer_counter', function(Alter $table)
{
$table->changeColumn('counter_price', 'decimal', '12,2')->setDefault(0.00);
});
$this->alterTable('xf_xa_cas_transaction', function(Alter $table)
{
$table->changeColumn('payment_amount', 'decimal', '12,2')->setDefault(0.00);
$table->changeColumn('payment_refund_amount', 'decimal', '12,2')->setDefault(0.00);
});
}
Upvote
0