Merge "PGSQL: create Enum before using"
This commit is contained in:
commit
75199063e9
@ -36,10 +36,12 @@ Node = sql.table('nodes',
|
|||||||
|
|
||||||
|
|
||||||
def upgrade():
|
def upgrade():
|
||||||
|
state_enum = sa.Enum(*istate.States.all(), name='node_state')
|
||||||
|
state_enum.create(op.get_bind())
|
||||||
|
|
||||||
op.add_column('nodes', sa.Column('version_id', sa.String(36),
|
op.add_column('nodes', sa.Column('version_id', sa.String(36),
|
||||||
server_default=''))
|
server_default=''))
|
||||||
op.add_column('nodes', sa.Column('state', sa.Enum(*istate.States.all(),
|
op.add_column('nodes', sa.Column('state', state_enum,
|
||||||
name='node_state'),
|
|
||||||
nullable=False,
|
nullable=False,
|
||||||
default=istate.States.finished,
|
default=istate.States.finished,
|
||||||
server_default=istate.States.finished))
|
server_default=istate.States.finished))
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- |
|
||||||
|
Create the node_state enum explicitly in the migration, as it is required
|
||||||
|
by PostgreSQL
|
Loading…
Reference in New Issue
Block a user