
from sqlalchemy import (Column,
                        Integer,
                        DateTime,
                        )


class AddressMixin(object):
    """ This is a mixin for Address Many2Many bindings """

    addr_id = Column(Integer, primary_key=True)
    priority = Column(Integer)
    addr_type_cn = Column(Integer)
    app_flags = Column(Integer)
    timestmp = Column(DateTime)


from sqlalchemy import (Column,
                        Integer,
                        DateTime,
                        ForeignKey
                        )


class AddressMixin(object):
    """ This is a mixin for Address Many2Many bindings """

    addr_id = Column(
        Integer,
        ForeignKey('csaddr.addr_id'),
        primary_key=True,
    )
    priority = Column(Integer)
    addr_type_cn = Column(Integer)
    app_flags = Column(Integer)
    timestmp = Column(DateTime)

Add ForeignKey on addr_id in carepoint cph address model
Add ForeignKey on addr_id in carepoint cph address model

  
  from sqlalchemy import (Column,
                          Integer,
                          DateTime,
+                         ForeignKey
                          )
  
  
  class AddressMixin(object):
      """ This is a mixin for Address Many2Many bindings """
  
-     addr_id = Column(Integer, primary_key=True)
+     addr_id = Column(
+         Integer,
+         ForeignKey('csaddr.addr_id'),
+         primary_key=True,
+     )
      priority = Column(Integer)
      addr_type_cn = Column(Integer)
      app_flags = Column(Integer)
      timestmp = Column(DateTime)
  
Add ForeignKey on addr_id in carepoint cph address model
## Code Before:

from sqlalchemy import (Column,
                        Integer,
                        DateTime,
                        )


class AddressMixin(object):
    """ This is a mixin for Address Many2Many bindings """

    addr_id = Column(Integer, primary_key=True)
    priority = Column(Integer)
    addr_type_cn = Column(Integer)
    app_flags = Column(Integer)
    timestmp = Column(DateTime)

## Instruction:
Add ForeignKey on addr_id in carepoint cph address model
## Code After:

from sqlalchemy import (Column,
                        Integer,
                        DateTime,
                        ForeignKey
                        )


class AddressMixin(object):
    """ This is a mixin for Address Many2Many bindings """

    addr_id = Column(
        Integer,
        ForeignKey('csaddr.addr_id'),
        primary_key=True,
    )
    priority = Column(Integer)
    addr_type_cn = Column(Integer)
    app_flags = Column(Integer)
    timestmp = Column(DateTime)
