Commit f258870e authored by Tomas Taraba's avatar Tomas Taraba

2400 Add tables route, routecontext, routemediaserver, routetrunk

parent da05bd05
......@@ -3,6 +3,7 @@ xivo-dao (2019.04.00) xivo-callisto; urgency=medium
* 2371 Fix agent api by porting the following fixes
* 2375 Add a CtiProfile to user when it's not set and a login is set
* 2352 Add api to create func key destination for agent
* 2400 Add route tables for outcall application
-- Jean-Pierre Thomasset <jpthomasset@gmail.com> Fri, 22 Feb 2019 09:44:53 +0000
......
# -*- coding: utf-8 -*-
#
# Copyright (C) 2019 Avencall
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>
from sqlalchemy.schema import Column, PrimaryKeyConstraint
from sqlalchemy.types import Integer, String
from xivo_dao.helpers.db_manager import Base
class Route(Base):
__tablename__ = 'route'
__table_args__ = (
PrimaryKeyConstraint('id'),
)
id = Column(Integer, nullable=False)
pattern = Column(String, nullable=False)
regexp = Column(String, nullable=True)
subroutine = Column(String, nullable=True)
notes = Column(String(39), nullable=True)
priority = Column(Integer, nullable=False)
# -*- coding: utf-8 -*-
#
# Copyright (C) 2019 Avencall
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>
from sqlalchemy.schema import Column, PrimaryKeyConstraint, ForeignKeyConstraint
from sqlalchemy.types import Integer, String
from xivo_dao.helpers.db_manager import Base
class RouteContext(Base):
__tablename__ = 'routecontext'
__table_args__ = (
PrimaryKeyConstraint('id'),
ForeignKeyConstraint(('routeid',),
('route.id',),
ondelete='RESTRICT'),
ForeignKeyConstraint(('contextname',),
('context.name',),
ondelete='RESTRICT'),
)
routeid = Column(Integer, nullable=False)
contextname = Column(String, nullable=False)
# -*- coding: utf-8 -*-
#
# Copyright (C) 2019 Avencall
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>
from sqlalchemy.schema import Column, PrimaryKeyConstraint, ForeignKeyConstraint
from sqlalchemy.types import Integer
from xivo_dao.helpers.db_manager import Base
class RouteMediaServer(Base):
__tablename__ = 'routemediaserver'
__table_args__ = (
PrimaryKeyConstraint('id'),
ForeignKeyConstraint(('routeid',),
('route.id',),
ondelete='RESTRICT'),
ForeignKeyConstraint(('mdsid',),
('mediaserver.id',),
ondelete='RESTRICT'),
)
routeid = Column(Integer, nullable=False)
mdsid = Column(Integer, nullable=False)
# -*- coding: utf-8 -*-
#
# Copyright (C) 2019 Avencall
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>
from sqlalchemy.schema import Column, PrimaryKeyConstraint, ForeignKeyConstraint
from sqlalchemy.types import Integer
from xivo_dao.helpers.db_manager import Base
class RouteTrunk(Base):
__tablename__ = 'routetrunk'
__table_args__ = (
PrimaryKeyConstraint('id'),
ForeignKeyConstraint(('routeid',),
('route.id',),
ondelete='RESTRICT'),
ForeignKeyConstraint(('trunkid',),
('trunkfeatures.id',),
ondelete='RESTRICT'),
)
routeid = Column(Integer, nullable=False)
trunkid = Column(Integer, nullable=False)
priority = Column(Integer, nullable=False)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment