<p dir="auto"><strong>Migrated issue, originally created by matt chisholm (<a href="https://github.com/glyphobet">@glyphobet</a>)</strong></p>
<p dir="auto">In PostgreSQL, when defining a column of type ARRAY of Enum, SQLAlchemy doesn't create the Enum types before creating the table. This causes the table creation to fail.</p>
<p dir="auto">This bug occurs with SQLAlchemy 0.8.1.</p>
<hr>
<p dir="auto">Attachments: <a href="../wiki/imported_issue_attachments/2745/sqlabug.py">sqlabug.py</a></p>
<p dir="auto"><strong>Migrated issue, originally created by Anonymous</strong></p>
<p dir="auto">metadata.create_all do not create work_place_roles if Enum in sqlalchemy.dialects.postgresql.ARRAY</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="class WorkPlacement(Base):
    __tablename__ = 'work_placement'

    roles = Column(ARRAY(Enum('manager', 'place_admin', 'carwash_admin',
                                      'parking_admin', 'service_admin', 'tire_admin',
                                      'mechanic', 'carwasher', 'tire_mechanic', name=&quot;work_place_roles&quot;)))"><pre class="notranslate"><code class="notranslate">class WorkPlacement(Base):
    __tablename__ = 'work_placement'

    roles = Column(ARRAY(Enum('manager', 'place_admin', 'carwash_admin',
                                      'parking_admin', 'service_admin', 'tire_admin',
                                      'mechanic', 'carwasher', 'tire_mechanic', name="work_place_roles")))
</code></pre></div>
<p dir="auto">i need do so:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="class WorkPlacement(Base):
    __tablename__ = 'work_placement'


    tmp_role = Column(Enum('manager', 'place_admin', 'carwash_admin',
                                      'parking_admin', 'service_admin', 'tire_admin',
                                      'mechanic', 'carwasher', 'tire_mechanic', name=&quot;work_place_roles&quot;))
    roles = Column(ARRAY(Enum(name=&quot;work_place_roles&quot;)))"><pre class="notranslate"><code class="notranslate">class WorkPlacement(Base):
    __tablename__ = 'work_placement'


    tmp_role = Column(Enum('manager', 'place_admin', 'carwash_admin',
                                      'parking_admin', 'service_admin', 'tire_admin',
                                      'mechanic', 'carwasher', 'tire_mechanic', name="work_place_roles"))
    roles = Column(ARRAY(Enum(name="work_place_roles")))
</code></pre></div>