Skip to content

Commit

Permalink
fixes bug 1319956 - Remove data_dictionary table (#3917)
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Bengtsson committed Aug 16, 2017
1 parent ca52e6f commit b09280a
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 9 deletions.
47 changes: 47 additions & 0 deletions alembic/versions/f8b13d90e22a_remove_data_dictionary_table.py
@@ -0,0 +1,47 @@
"""remove data_dictionary table
Revision ID: f8b13d90e22a
Revises: 15d9132d759e
Create Date: 2017-08-15 14:15:08.960047
"""
from alembic import op
from sqlalchemy import types, Column
from sqlalchemy.dialects.postgresql import TEXT

# revision identifiers, used by Alembic.
revision = 'f8b13d90e22a'
down_revision = '15d9132d759e'


class JSON(types.UserDefinedType):
name = 'json'

def get_col_spec(self):
return 'JSON'

def bind_processor(self, dialect):
def process(value):
return value
return process

def result_processor(self, dialect, coltype):
def process(value):
return value
return process

def __repr__(self):
return "json"


def upgrade():
op.drop_table('data_dictionary')


def downgrade():
op.create_table(
'data_dictionary',
Column(u'raw_field', TEXT(), nullable=False, primary_key=True),
Column(u'transforms', JSON()),
Column(u'product', TEXT())
)
9 changes: 0 additions & 9 deletions socorro/external/postgresql/models.py
Expand Up @@ -673,15 +673,6 @@ class CrashesByUserBuild(DeclarativeBase):
'CrashType', primaryjoin='CrashesByUserBuild.crash_type_id==CrashType.crash_type_id')


class DataDictionary(DeclarativeBase):
__tablename__ = 'data_dictionary'

# column definitions
raw_field = Column(u'raw_field', TEXT(), nullable=False, primary_key=True)
transforms = Column(u'transforms', JSON())
product = Column(u'product', TEXT())


class Domain(DeclarativeBase):
__tablename__ = 'domains'

Expand Down

0 comments on commit b09280a

Please sign in to comment.