title: How to make a column as FK from two tables in two different and unrelated services?
body: <p>Assume that there are 2 unconnected and different services: <code>Service-A</code> &amp; <code>Service-B</code>.</p>
  <p>The table that I have in <code>Service-A</code>:</p>
  <pre><code>class ServiceATable(Base):
      id = Column(Integer, primary_key=True)
      received_encrypted = Column(Boolean)
      encryption_author = Column(String(150))
      decryption_state = Column(Boolean)
  </code></pre>
  <p>The table in <code>Service-B</code>:</p>
  <pre><code>class ServiceBTable(Base):
      id = Column(Integer, primary_key=True)
      id_from_service_a = Column(Integer) 
      filename = Column(String(200))
      forwarding_to = Column(String(150))
  </code></pre>
  <p>What I am trying to do is to use the <code>id</code> column in the <code>Service-A</code> table and make it a Foreign Key in the <code>Service-B</code> table in the column <code>id_from_service_a</code>, so that the <code>Service-B</code> table looks something like this:</p>
  <pre><code>from sqlalchemy import ForeignKey
  
  class ServiceBTable(Base):
      id = Column(Integer, primary_key=True)
      id_from_service_a = Column(Integer, ForeignKey('id-from-service-a'))
      filename = Column(String(200))
      forwarding_to = Column(String(150))
  </code></pre>
  <p>Since both the tables are in 2 different services, I don't think I can use the <a href="https://docs.sqlalchemy.org/en/14/orm/basic_relationships.html" rel="nofollow noreferrer">Basic Relationship Patterns</a> as it assumes that both the tables are created in the same service.</p>
  <p>Is there a way I can achieve the following?</p>