@@ -0,0 +1,2342 @@
+#%0A# Copyright (C) 2017 Red Hat, Inc%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22); you may%0A# not use this file except in compliance with the License. You may obtain%0A# a copy of the License at%0A#%0A# http://www.apache.org/licenses/LICENSE-2.0%0A#%0A# Unless required by applicable law or agreed to in writing, software%0A# distributed under the License is distributed on an %22AS IS%22 BASIS, WITHOUT%0A# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the%0A# License for the specific language governing permissions and limitations%0A# under the License.%0A%0A%22%22%22add_feeder_role%0A%0ARevision ID: b58867f72568%0ARevises: 827c558895bc%0ACreate Date: 2017-10-27 08:29:07.283357%0A%0A%22%22%22%0A%0A# revision identifiers, used by Alembic.%0Arevision = 'b58867f72568'%0Adown_revision = '827c558895bc'%0Abranch_labels = None%0Adepends_on = None%0A%0Afrom alembic import op%0Aimport sqlalchemy as sa%0Afrom sqlalchemy.dialects import postgresql as pg%0A%0Aimport datetime%0Aimport dci.common.utils as utils%0A%0A%0ARESOURCE_STATES = %5B'active', 'inactive', 'archived'%5D%0ASTATES = sa.Enum(*RESOURCE_STATES, name='states')%0A%0AROLES = sa.Table(%0A    'roles', sa.MetaData(),%0A    sa.Column('id', pg.UUID(as_uuid=True), primary_key=True,%0A              default=utils.gen_uuid),%0A    sa.Column('created_at', sa.DateTime(),%0A              default=datetime.datetime.utcnow, nullable=False),%0A    sa.Column('updated_at', sa.DateTime(),%0A              onupdate=datetime.datetime.utcnow,%0A              default=datetime.datetime.utcnow, nullable=False),%0A    sa.Column('etag', sa.String(40), nullable=False, default=utils.gen_etag,%0A              onupdate=utils.gen_etag),%0A    sa.Column('name', sa.String(255), nullable=False),%0A    sa.Column('label', sa.String(255), nullable=False),%0A    sa.Column('description', sa.Text),%0A    sa.UniqueConstraint('label', name='roles_label_key'),%0A    sa.Column('state', STATES, default='active')%0A)%0A%0A%0Adef upgrade():%0A    db_conn = op.get_bind()%0A%0A    feeder_role_id = utils.gen_uuid()%0A    feeder_role = %7B%0A        'id': feeder_role_id,%0A        'created_at': datetime.datetime.utcnow().isoformat(),%0A        'updated_at': datetime.datetime.utcnow().isoformat(),%0A        'etag': utils.gen_etag(),%0A        'name': 'Feeder',%0A        'label': 'FEEDER',%0A        'description': 'A Feeder',%0A    %7D%0A    db_conn.execute(ROLES.insert().values(**feeder_role))%0A%0A%0Adef downgrade():%0A    pass%0A

Add the feeder role in the ROLES table