title: onupdate='cascade' is not working in the column in a table in Flask
body: <p>as I am not an expert on flask-sqlalchemy, this might seem to be very basic question.</p>
  <p>I have two table i)project ii)project_users in postgres db</p>
  <p>i)Project Table</p>
  <pre><code>class Project(BaseModel):
  
      __tablename__ = 'projects'
      id = Column(fields.Integer, primary_key=True, autoincrement=True)
      uid = Column(fields.UID, nullable=False, unique=True)
      users = relationship(&quot;ProjectUser&quot;, lazy='select')
  </code></pre>
  <p>ii)Project_Users Table</p>
  <pre><code>class ProjectUser(BaseModel):
  
      __tablename__ = 'project_users'
      id = Column(fields.Integer, primary_key=True, autoincrement=True)
      project = Column(fields.UID, ForeignKey(Project.uid), nullable=False)
  </code></pre>
  <p>NOW as we can see project field in PROJECT_USERS table is a foreign key and references from PROJECT table.</p>
  <p>So, I want to <strong>modify uid in the project table</strong> but that gives foreign_key_violation error , so in order to solve that I have tried to <strong>cascade</strong> the foreign key in PROJECT_USERS Table using the following ways</p>
  <p>i)In PROJECT_USERS table</p>
  <pre><code>project = Column(fields.UID, ForeignKey(Project.uid), nullable=False, onupdate=u'CASCADE)
  </code></pre>
  <p>ii)In PROJECT Table</p>
  <pre><code>users = relationship(&quot;ProjectUser&quot;, lazy='select', cascade=&quot;save-update)
  </code></pre>
  <p>I am still not able to solve  key violation error. <strong>&quot;sqlalchemy.exc.IntegrityError: (psycopg2.errors.ForeignKeyViolation)&quot;</strong></p>
  <p>Can anyone please help and tell how can I correctly add cascade?</p>
  <p>Thanks</p>