You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openmeetings.apache.org by Vieri <re...@yahoo.com> on 2013/03/07 15:23:08 UTC

sipusers table view

Hi,

I'd like to have 2 'sipusers' tables in 2 different databases. The content of these tables could be different.
So in order to share both data sets between Asterisk and OpenMeetings I create 2 views like this:

echo "create view view_sipusers as select * from sipusers union select * from ${OPENMEETINGS_DBNAME}.sipusers" | isql -v MySQL-asterisk

echo "create view view_sipusers as select * from sipusers union select * from ${ASTERISK_DBNAME}.sipusers" | isql -v MySQL-openmeetings

I can tell Asterisk to use the 'view_sipusers' view instead of the sipusers table.
How can I tell OM to use the 'view_sipusers' view?

Also, I'm concerned about the 'id' auto-increment field in both sipusers tables. Maybe I should simply remove the id in both tables (I wonder if there will be a significant performance hit) or define views by excluding the id fields:
echo "create view view_sipusers as select [all field names except 'id'] from sipusers union select * from ${OPENMEETINGS_DBNAME}.sipusers" | isql -v MySQL-asterisk
echo "create view view_sipusers as select [all field names except 'id'] from sipusers union select * from ${ASTERISK_DBNAME}.sipusers" | isql -v MySQL-openmeetings

Any suggestions?

Thanks,

Vieri


Re: sipusers table view

Posted by Maxim Solodovnik <so...@gmail.com>.
I believe it is impossible to rename DB table used by OM without recompiling
Also I'm not sure what is the purpose of such behavior?
You can have your data in OM table
additional rows and columns would not affect anything


On Thu, Mar 7, 2013 at 9:23 PM, Vieri <re...@yahoo.com> wrote:

> Hi,
>
> I'd like to have 2 'sipusers' tables in 2 different databases. The content
> of these tables could be different.
> So in order to share both data sets between Asterisk and OpenMeetings I
> create 2 views like this:
>
> echo "create view view_sipusers as select * from sipusers union select *
> from ${OPENMEETINGS_DBNAME}.sipusers" | isql -v MySQL-asterisk
>
> echo "create view view_sipusers as select * from sipusers union select *
> from ${ASTERISK_DBNAME}.sipusers" | isql -v MySQL-openmeetings
>
> I can tell Asterisk to use the 'view_sipusers' view instead of the
> sipusers table.
> How can I tell OM to use the 'view_sipusers' view?
>
> Also, I'm concerned about the 'id' auto-increment field in both sipusers
> tables. Maybe I should simply remove the id in both tables (I wonder if
> there will be a significant performance hit) or define views by excluding
> the id fields:
> echo "create view view_sipusers as select [all field names except 'id']
> from sipusers union select * from ${OPENMEETINGS_DBNAME}.sipusers" | isql
> -v MySQL-asterisk
> echo "create view view_sipusers as select [all field names except 'id']
> from sipusers union select * from ${ASTERISK_DBNAME}.sipusers" | isql -v
> MySQL-openmeetings
>
> Any suggestions?
>
> Thanks,
>
> Vieri
>
>


-- 
WBR
Maxim aka solomax