Commit 74465f74 authored by Tomas Taraba's avatar Tomas Taraba

2443 Fix primary keys in route tables

parent 2246a31d
......@@ -24,7 +24,7 @@ from xivo_dao.helpers.db_manager import Base
class RouteContext(Base):
__tablename__ = 'routecontext'
__table_args__ = (
PrimaryKeyConstraint('id'),
PrimaryKeyConstraint('routeid', 'contextname'),
ForeignKeyConstraint(('routeid',),
('route.id',),
ondelete='RESTRICT'),
......
......@@ -24,7 +24,7 @@ from xivo_dao.helpers.db_manager import Base
class RouteMediaServer(Base):
__tablename__ = 'routemediaserver'
__table_args__ = (
PrimaryKeyConstraint('id'),
PrimaryKeyConstraint('routeid', 'mdsid'),
ForeignKeyConstraint(('routeid',),
('route.id',),
ondelete='RESTRICT'),
......
......@@ -24,7 +24,7 @@ from xivo_dao.helpers.db_manager import Base
class RouteTrunk(Base):
__tablename__ = 'routetrunk'
__table_args__ = (
PrimaryKeyConstraint('id'),
PrimaryKeyConstraint('routeid', 'trunkid'),
ForeignKeyConstraint(('routeid',),
('route.id',),
ondelete='RESTRICT'),
......
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