title: sqlalchemy unique in m:m
body: <p>I scraped a website resulting in a list of dictionaries.
  [{'name': name of job}, {'skills': [many skills]}, ...]
  when using sqlalchemy i built the following:</p>
  <pre><code>class Job(Base):
      __tablename__ = 'Job'
      # Initialize the Column
      id = Column(Integer, nullable=False, primary_key=True)
      title = Column(String(1000), nullable=False)
      
      # Initialize the relationship
      children = relationship(&quot;Job_Skills&quot;)
  
  class Job_Skills(Base):
      __tablename__ = 'Job_Skills'
      # Initialize the Column
      id = Column(Integer, nullable=False, primary_key=True)
      job_id = Column(Integer, ForeignKey('Job.id'))
      skill_id = Column(Integer, ForeignKey('Skill.id'))
      # Initialize the relationship
      skill = relationship('Skill')
  
  class Skill(Base):
      __tablename__ = 'Skill'
      # Initialize the Column
      id = Column(Integer, primary_key=True, nullable=False, autoincrement=True)
      name = Column(String(100))
  
  for a_dict in dict_merged:
      # job
      job = Job(title=a_dict[&quot;name&quot;]
      session.add(job)
      
      # skills
      job_Skills = Job_Skills()
      session.add(job_Skills)
  
      # add skill in catalogue
      for my_skill in [x.strip() for x in a_dict[&quot;skills&quot;].split(',')]:
          skill = Skill(name=my_skill)
          session.add(skill)
  </code></pre>
  <p>the problem is my skill table has many redundancies, I want it to be a uniqe value catalogue that is connected to the proper job via the Job_Skills table.</p>