[OpenSIPS-Users] Opensips - using database views

Oleg Burlacu olegburlacu at gmail.com
Tue Feb 2 15:29:33 CET 2010


Hi Bogdan,

Let's suppose that we have 2 tables, one for domains and other for users but
with the domain field the foreign key from domains table. Also I have in the
users table the bit type fields "local", "mobile"...
In this case our output from the created view "grp" will be

username  domain    grp     last_modified
xxyy10    sip1.abcd.efg    international    1900-01-01 00:00:01
xxyy10    sip1.abcd.efg    local    1900-01-01 00:00:01
xxyy10    sip1.abcd.efg    mobile    1900-01-01 00:00:01
xxyy10    sip1.abcd.efg    national    1900-01-01 00:00:01

So, each table has a primary key, but the "result" - not. Can I use this
result for group module? Or, I should generate also a primary key?

Best regards,
Oleg


On Tue, Feb 2, 2010 at 4:13 PM, Bogdan-Andrei Iancu
<bogdan at voice-system.ro>wrote:

> Hi Oleg,
>
> most of the "id" columns are not used by opensips (neither written, nor
> read) - but they are used as primary keys.
>
> So, you can remove the columns, but be sure in setting another primary
> key for the tables.
>
> Regards,
> Bogdan
>
> Oleg Burlacu wrote:
> > Hi!
> > I'm planning to migrate from fixed database tables to views.
> > But I have a touble to generate the auto increment field - "id".
> > Can opensips operate with tables without the "id" filed?
> >
> > Thanks,
> > Oleg
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Users mailing list
> > Users at lists.opensips.org
> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> >
>
>
> --
> Bogdan-Andrei Iancu
> www.voice-system.ro
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20100202/bde29192/attachment.htm 


More information about the Users mailing list