Sunday, June 11, 2017

Freeswitch Postgres database scheme

Freeswitch has a great option to put internal database from SQL to Postgres. But in a case if Postgres DB is BDR (as I've described here), there is need some additional work on this database.
So, I've created SQL file to use, based on DigiDaz file. 

You can find it here. Don't forget to set

<param name="auto-create-schemas" value="false"/>
<param name="auto-clear-sql" value="false"/>

in your switch.comf.xml file.

Also few things about BDR. You can't add primary key to existing database in one command. But you can use thing like:

ALTER TABLE tbl ADD COLUMN tbl_uuid uuid;
ALTER TABLE tbl ALTER COLUMN tbl_uuid  SET DEFAULT  gen_random_uuid();
ALTER TABLE tbl ADD PRIMARY KEY (tbl_uuid);

No comments:

Post a Comment