From d5e349aea05fb0d1e73899f76cd429abe408d20f Mon Sep 17 00:00:00 2001 From: Alex Ford Date: Thu, 27 Jan 2022 10:13:18 +0000 Subject: [PATCH 1/2] Company Name Migration --- tcsocket/app/management.py | 8 ++++++++ tcsocket/app/models.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tcsocket/app/management.py b/tcsocket/app/management.py index 81d7a18..57fa741 100644 --- a/tcsocket/app/management.py +++ b/tcsocket/app/management.py @@ -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)') diff --git a/tcsocket/app/models.py b/tcsocket/app/models.py index 19ab7eb..0b17f82 100644 --- a/tcsocket/app/models.py +++ b/tcsocket/app/models.py @@ -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) From 69dbe2413b11573ad78bc39176120600b6fe7d1b Mon Sep 17 00:00:00 2001 From: Alex Ford Date: Thu, 27 Jan 2022 10:23:14 +0000 Subject: [PATCH 2/2] upgrade reqs --- tcsocket/requirements.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tcsocket/requirements.txt b/tcsocket/requirements.txt index 39c3233..2a641bc 100644 --- a/tcsocket/requirements.txt +++ b/tcsocket/requirements.txt @@ -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