title: SQLAlchemy: How to add column to existing table?
body: <p>I am trying to add a field or column to an existing table using SQLAchemy.</p>
  
  <p>Below is the table class</p>
  
  <pre><code>class ReleaseVersion(Base):
  
      __tablename__ = 'versions'
  
      id = Column(Integer, primary_key=True, autoincrement=True)
      release = Column(String(128), nullable=False, unique=True)
  
  
      def __init__(self,release, id=None):
  
          if(id):
              self.id = id
  
          self.release = release
  </code></pre>
  
  <p>I initialized the table using following line</p>
  
  <pre><code>myDB.ReleaseVersion.__table__.create(bind=self.engine, checkfirst=True)
  </code></pre>
  
  <p>After using the DB for some time, I need to add a boolean field, 'is_currentversion' while keeping all the existing content of the table, but I am not so sure how to do this.</p>
  
  <p>Should I manually create the field to the table an update the class?
  Alternatively, add the field in the table class and add column if it does not exist in the initialization function?</p>