Skip to content

Commit 40ba155

Browse files
authored
Merge pull request #417 from tutorcruncher/company-name-migration
Company Name Migration
2 parents 7fa49ef + 69dbe24 commit 40ba155

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

tcsocket/app/management.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,3 +308,11 @@ def update_socket_images(conn):
308308
print(f'Unable to find {img_thumb_key}, returned 404')
309309
else:
310310
r.raise_for_status()
311+
312+
313+
@patch
314+
def increase_company_name_field_length(conn):
315+
"""
316+
increase company name length from 63 to 255 characters
317+
"""
318+
conn.execute('ALTER TABLE companies ALTER COLUMN name TYPE VARCHAR(255)')

tcsocket/app/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Company(Base):
2020
public_key = Column(String(20), index=True, nullable=False, unique=True)
2121
private_key = Column(String(50), index=True, nullable=False)
2222

23-
name = Column(String(63), unique=True)
23+
name = Column(String(255), unique=True)
2424
domains = Column(ARRAY(String(255)))
2525

2626
name_display = Column(sa_enum(NameOptions), default=NameOptions.first_name_initial, nullable=False)

tcsocket/requirements.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ aiohttp==3.8.1
44
aiopg==1.3.3
55
aioredis==1.3.1
66
arq==0.22
7-
boto3==1.20.28
7+
boto3==1.20.44
88
cchardet==2.1.7
99
gunicorn==20.1.0
1010
python-dateutil==2.8.2
1111
pillow==9.0.0
1212
pydantic[email]==1.9.0
1313
raven==6.10.0
14-
requests==2.27.0
14+
requests==2.27.1
1515
uvloop==0.16.0
16-
ipython==7.31.0
17-
pgcli==3.2.0
16+
ipython==7.31.1
17+
pgcli==3.3.1
1818
ipython-sql==0.4.0
1919
yarl==1.7.2

0 commit comments

Comments
 (0)