Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Fri Apr 19, 2024 4:09 am
Hosted Voice Broadcast


All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Sync of Postgres 1.3->1.4 update script to MySQL's
PostPosted: Fri Sep 05, 2008 1:58 am 
Offline

Joined: Fri Sep 05, 2008 1:11 am
Posts: 4
Hi there,
I wanted to get trunk going w/ postgres, and it seems there's quite a few discrepancies between the postgres 1.3->1.4 script and the MySQL version.
It's bad enough right now (-revision 994) that A2B won't work on PG.

So I spent the day going over it line by line to make sure there as equivalent as possible and here's the patch.

I also normalized the formating a little, and if you compare them side by side (24" monitors are nice for that :D) all the pertinant bits match up line for line.

A note, based on the postgres manual here there's little point of using CHARACTER(n), so when the MYSQL version does, I switched them to CHARACTER VARYING(n).

NUMERIC and DECIMAL are equivalent, so I switched all to DECIMAL where MySQL uses them.

I've some concerns about each of the schemes:
    They are added as comments, especially regarding errors I've fixed but which are still broken in the MySQL version. Search 'XXX'
    The switch to encrypted passwords doesn't update existing passwords
    The encrypted pw hash in the mysql script isn't even root's default password ('mycode') and admin's isn't set. That can be seriously confusing when you can't login!
    A lot of money related columns are using floats, which is probably not a good idea. The last place you want ill-defined behaviour is when dealing with money, no? See postgress doc 8.1.3
    The only reason I can think of to use floats is if the database itself is actually doing calculations with them.


Anyways, I hope that helps out out a bit. Feel free to use whatever you'd like to include from the patch. (labeled .txt as .patch doesn't seem to be allowed)


Attachments:
a2b_postgres_13_to_14.txt [39.58 KiB]
Downloaded 713 times
Top
 Profile  
 
 Post subject: More fixes
PostPosted: Fri Sep 05, 2008 7:38 pm 
Offline

Joined: Fri Sep 05, 2008 1:11 am
Posts: 4
Seems not all is well after the above patch. I added, based on the MySQL version, the "traffic" realated columns. "traffic" is a BIGINT, and on trying to update a customer ("cc_card" row) it fails because A2B is trying to put a '' into the traffic bigint.
The patch is how I fixed it. I couldn't figure out how AddEditElement paramaters are actually supposed to work, so I just disabled "traffic"

Also, another problem concerning the "status_reporting" post update was giving me problems.
Code:
PHP Catchable fatal error:  Object of class ADORecordSet_empty could not be converted to string in /home/david/Projects/a2billing-1.4/common/lib/Form/Class.FormHandler.inc.php on line 1489

The patch also does a work around for that.


Attachments:
a2b_traffic_fix.patch.txt [1.17 KiB]
Downloaded 755 times
Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 06, 2008 5:42 pm 
Offline

Joined: Fri Sep 05, 2008 1:11 am
Posts: 4
Another issue, at least with the Postgres backend.

You cannot update the database stored config variables using the web UI.
The current update systems is using JOINs in the table references, which PG doesn't seem to like. No joins are needed for these update statements, but they're being used and very much complicate things.
The generating SQL is just to tortured for me to take a stab at fixing it

I'm just going to use PgAdmin for config updates.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 
Hosted Voice Broadcast


All times are UTC


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group