Skip to content

Commit

Permalink
Merge pull request mozilla-services#1259 from selenamarie/bug864391-s…
Browse files Browse the repository at this point in the history
…kiplist-db

bug 864391 - Add skiplist table and migration
  • Loading branch information
selenamarie committed May 22, 2013
2 parents 269e437 + 05ee39c commit b47f8bc
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
32 changes: 32 additions & 0 deletions alembic/versions/4d86b4efd25d_bug_864391_create_sk.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"""bug 864391 - create skiplist
Revision ID: 4d86b4efd25d
Revises: e4d30f140ed
Create Date: 2013-05-22 09:16:15.248184
"""

# revision identifiers, used by Alembic.
revision = '4d86b4efd25d'
down_revision = 'e4d30f140ed'

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
import sqlalchemy.types as types
from sqlalchemy.sql import table, column
from sqlalchemy.dialects import postgresql

def upgrade():
op.create_table(u'skiplist',
sa.Column(u'category', sa.TEXT(), nullable=False),
sa.Column(u'rule', sa.TEXT(), nullable=False),
sa.PrimaryKeyConstraint(u'category', u'rule')
)
### end Alembic commands ###


def downgrade():
### commands auto generated by Alembic - please adjust! ###
op.drop_table(u'skiplist')
### end Alembic commands ###
5 changes: 5 additions & 0 deletions socorro/external/postgresql/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1225,6 +1225,11 @@ class SignatureProductsRollup(DeclarativeBase):
products = relationship('Product', primaryjoin='SignatureProductsRollup.product_name==Product.product_name')
signatures = relationship('Signature', primaryjoin='SignatureProductsRollup.signature_id==Signature.signature_id')

class Skiplist(DeclarativeBase):
__tablename__ = 'skiplist'

category = Column(u'category', TEXT(), primary_key=True, nullable=False)
rule = Column(u'rule', TEXT(), primary_key=True, nullable=False)

class SocorroDbVersion(DeclarativeBase):
__tablename__ = 'socorro_db_version'
Expand Down

0 comments on commit b47f8bc

Please sign in to comment.