Skip to content

Commit

Permalink
Company Name Migration
Browse files Browse the repository at this point in the history
  • Loading branch information
alextford11 committed Jan 27, 2022
1 parent 7fa49ef commit d5e349a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
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

0 comments on commit d5e349a

Please sign in to comment.