Skip to content

Commit

Permalink
Merge pull request #417 from tutorcruncher/company-name-migration
Browse files Browse the repository at this point in the history
Company Name Migration
  • Loading branch information
alextford11 authored Jan 27, 2022
2 parents 7fa49ef + 69dbe24 commit 40ba155
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
8 changes: 8 additions & 0 deletions tcsocket/app/management.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,3 +308,11 @@ def update_socket_images(conn):
print(f'Unable to find {img_thumb_key}, returned 404')
else:
r.raise_for_status()


@patch
def increase_company_name_field_length(conn):
"""
increase company name length from 63 to 255 characters
"""
conn.execute('ALTER TABLE companies ALTER COLUMN name TYPE VARCHAR(255)')
2 changes: 1 addition & 1 deletion tcsocket/app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Company(Base):
public_key = Column(String(20), index=True, nullable=False, unique=True)
private_key = Column(String(50), index=True, nullable=False)

name = Column(String(63), unique=True)
name = Column(String(255), unique=True)
domains = Column(ARRAY(String(255)))

name_display = Column(sa_enum(NameOptions), default=NameOptions.first_name_initial, nullable=False)
Expand Down
8 changes: 4 additions & 4 deletions tcsocket/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ aiohttp==3.8.1
aiopg==1.3.3
aioredis==1.3.1
arq==0.22
boto3==1.20.28
boto3==1.20.44
cchardet==2.1.7
gunicorn==20.1.0
python-dateutil==2.8.2
pillow==9.0.0
pydantic[email]==1.9.0
raven==6.10.0
requests==2.27.0
requests==2.27.1
uvloop==0.16.0
ipython==7.31.0
pgcli==3.2.0
ipython==7.31.1
pgcli==3.3.1
ipython-sql==0.4.0
yarl==1.7.2

0 comments on commit 40ba155

Please sign in to comment.