Hi,
i just tried to setup jbilling with a postgresql backend (9.0.3) and encountered the following obstacles:
1. The jbilling-schema-postgresql.sql contains DROP TABLE statements prior to each table create statement. This fails for me on a fresh emtpy database with "ERROR: table ... does not exist". I had to modify the statements to "DROP TABLE IF EXISTS" to initially setup the database. The mysql-schema in contrast already contains the "if exists" statement, why not put them in the postgresql schema as well?
2. The docmentation http://jbilling.com/documentation/database-guide is a bit messed up in the section about database initialization: "Open up the file jbilling-schema-postgresql.sqljbilling-schema-postgresql-constraints.sql." From the context I deducted that one needs to split the postgres schema in two files. One with the table create statements and one with the constraints. Why not put two files in the distribution archive which can be used right away?
Furthermore I had problems importing the constraints schema part. Almost at the very end I got an sql error for the folllowing statement:
ALTER TABLE mediation_record_line
ADD CONSTRAINT mediation_record_line_FK_1 FOREIGN KEY (mediation_record_id)
REFERENCES mediation_record (id);
ERROR: foreign key constraint "mediation_record_line_fk_1" cannot be implemented
DETAIL: Key columns "mediation_record_id" and "id" are of incompatible types: character varying and integer
I had to remove the constraint to execute the remaining statements.
Cheers,
Fabian
Same problem
I encountered the same problem and ended up commenting out the ALTERs