Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes bug 1319956 - Remove
data_dictionary
table (#3917)
- Loading branch information
Peter Bengtsson
committed
Aug 16, 2017
1 parent
ca52e6f
commit b09280a
Showing
2 changed files
with
47 additions
and
9 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
alembic/versions/f8b13d90e22a_remove_data_dictionary_table.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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()) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters