Skip to content

Commit d5e349a

Browse files
committed
Company Name Migration
1 parent 7fa49ef commit d5e349a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
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)

0 commit comments

Comments
 (0)