-
Notifications
You must be signed in to change notification settings - Fork 687
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
John Bodley
committed
Mar 11, 2020
1 parent
bbf7c7d
commit 47cd344
Showing
7 changed files
with
96 additions
and
37 deletions.
There are no files selected for viewing
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
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
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
36 changes: 36 additions & 0 deletions
36
knowledge_repo/app/migrations/versions/38eeba774226_resize_email_text.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,36 @@ | ||
"""resize_email_text | ||
Revision ID: 38eeba774226 | ||
Revises: eb39ac93fc39 | ||
Create Date: 2020-03-11 09:46:29.112836 | ||
""" | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '38eeba774226' | ||
down_revision = 'eb39ac93fc39' | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
from knowledge_repo.utils.types import MediumText | ||
|
||
|
||
def upgrade(): | ||
with op.batch_alter_table('emails') as batch_op: | ||
batch_op.alter_column( | ||
'text', | ||
existing_type=sa.Text(), | ||
type_=MediumText(), | ||
existing_nullable=True, | ||
) | ||
|
||
|
||
def downgrade(): | ||
with op.batch_alter_table('emails') as batch_op: | ||
batch_op.alter_column( | ||
'text', | ||
existing_type=MediumText(), | ||
type_=sa.Text(), | ||
existing_nullable=True, | ||
) |
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
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
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 |
---|---|---|
@@ -1,8 +1,15 @@ | ||
import sys | ||
|
||
from sqlalchemy import Text | ||
from sqlalchemy.dialects.mysql import MEDIUMTEXT | ||
|
||
__all__ = ['str_types'] | ||
|
||
if sys.version_info.major > 2: | ||
str_types = (str,) | ||
else: | ||
str_types = (str, unicode) | ||
|
||
|
||
def MediumText(): | ||
return Text().with_variant(MEDIUMTEXT(), 'mysql') |