"""Add quota table

Revision ID: 007
Revises: 006
Create Date: 2020-01-28
"""

# revision identifiers, used by Alembic.
revision = '007'
down_revision = '006'

from alembic import op
import sqlalchemy as sa


def upgrade():
    op.create_table(
        'quota',
        sa.Column('id', sa.String(length=36), nullable=False),
        sa.Column('resource', sa.String(length=50), nullable=False),
        sa.Column('project_id', sa.String(length=128), nullable=False),
        sa.Column('limit', sa.Integer, nullable=False),
        sa.PrimaryKeyConstraint('id'),
        sa.UniqueConstraint('project_id', 'resource'),
        sa.Index(
            'ix_quota_project_id_resource',
            'project_id', 'resource'
        )
    )
