From aef7d5952e16a9e877b5a3846ff6aaac0725eb4e Mon Sep 17 00:00:00 2001
From: Valentin Lorentz <vlorentz@softwareheritage.org>
Date: Tue, 18 Jun 2019 17:09:33 +0200
Subject: [PATCH] Remove columns 'description' and 'origin_id'.

They are useless.
---
 swh/lister/bitbucket/lister.py       | 1 -
 swh/lister/core/models.py            | 2 --
 swh/lister/core/tests/test_lister.py | 2 +-
 swh/lister/cran/lister.py            | 1 -
 swh/lister/github/lister.py          | 1 -
 swh/lister/gnu/lister.py             | 1 -
 swh/lister/npm/lister.py             | 1 -
 swh/lister/phabricator/lister.py     | 1 -
 swh/lister/pypi/lister.py            | 1 -
 9 files changed, 1 insertion(+), 10 deletions(-)

diff --git a/swh/lister/bitbucket/lister.py b/swh/lister/bitbucket/lister.py
index 04a20aa1..e674cc40 100644
--- a/swh/lister/bitbucket/lister.py
+++ b/swh/lister/bitbucket/lister.py
@@ -28,7 +28,6 @@ class BitBucketLister(SWHIndexingHttpLister):
             'html_url': repo['links']['html']['href'],
             'origin_url': repo['links']['clone'][0]['href'],
             'origin_type': repo['scm'],
-            'description': repo['description']
         }
 
     def get_next_target_from_response(self, response):
diff --git a/swh/lister/core/models.py b/swh/lister/core/models.py
index 15a1441f..d0c61c54 100644
--- a/swh/lister/core/models.py
+++ b/swh/lister/core/models.py
@@ -29,12 +29,10 @@ class ModelBase(SQLBase, metaclass=ABCSQLMeta):
     html_url = Column(String)
     origin_url = Column(String)
     origin_type = Column(String)
-    description = Column(String)
 
     last_seen = Column(DateTime, nullable=False)
 
     task_id = Column(Integer)
-    origin_id = Column(Integer)
 
     def __init__(self, **kw):
         kw['last_seen'] = datetime.now()
diff --git a/swh/lister/core/tests/test_lister.py b/swh/lister/core/tests/test_lister.py
index 5b93b644..a63260fd 100644
--- a/swh/lister/core/tests/test_lister.py
+++ b/swh/lister/core/tests/test_lister.py
@@ -161,7 +161,7 @@ class HttpListerTesterBase(abc.ABC):
         self.assertIsInstance(di, dict)
         pubs = [k for k in vars(fl.MODEL).keys() if not k.startswith('_')]
         for k in pubs:
-            if k not in ['last_seen', 'task_id', 'origin_id', 'id']:
+            if k not in ['last_seen', 'task_id', 'id']:
                 self.assertIn(k, di)
 
     def disable_scheduler(self, fl):
diff --git a/swh/lister/cran/lister.py b/swh/lister/cran/lister.py
index 4277e143..73eeac9c 100644
--- a/swh/lister/cran/lister.py
+++ b/swh/lister/cran/lister.py
@@ -76,7 +76,6 @@ class CRANLister(SimpleLister):
             'html_url': project_url,
             'origin_url': project_url,
             'origin_type': 'cran',
-            'description': repo["Description"]
         }
 
     def transport_response_simplified(self, response):
diff --git a/swh/lister/github/lister.py b/swh/lister/github/lister.py
index 245afde9..866d0e51 100644
--- a/swh/lister/github/lister.py
+++ b/swh/lister/github/lister.py
@@ -25,7 +25,6 @@ class GitHubLister(SWHIndexingHttpLister):
             'html_url': repo['html_url'],
             'origin_url': repo['html_url'],
             'origin_type': 'git',
-            'description': repo['description'],
             'fork': repo['fork'],
         }
 
diff --git a/swh/lister/gnu/lister.py b/swh/lister/gnu/lister.py
index 82bea89f..f3296828 100644
--- a/swh/lister/gnu/lister.py
+++ b/swh/lister/gnu/lister.py
@@ -130,7 +130,6 @@ class GNULister(SimpleLister):
             'origin_url': repo['url'],
             'time_last_updated': repo['time_modified'],
             'origin_type': 'gnu',
-            'description': None,
         }
 
     def transport_response_simplified(self, response):
diff --git a/swh/lister/npm/lister.py b/swh/lister/npm/lister.py
index d686851b..bd8c4a68 100644
--- a/swh/lister/npm/lister.py
+++ b/swh/lister/npm/lister.py
@@ -45,7 +45,6 @@ class NpmListerBase(SWHIndexingHttpLister):
             'html_url': package_metadata_url,
             'origin_url': package_url,
             'origin_type': 'npm',
-            'description': None
         }
 
     def task_dict(self, origin_type, origin_url, **kwargs):
diff --git a/swh/lister/phabricator/lister.py b/swh/lister/phabricator/lister.py
index dd303080..e5efc4c7 100644
--- a/swh/lister/phabricator/lister.py
+++ b/swh/lister/phabricator/lister.py
@@ -83,7 +83,6 @@ class PhabricatorLister(SWHIndexingHttpLister):
             'full_name': repo['fields']['name'],
             'html_url': url,
             'origin_url': url,
-            'description': None,
             'origin_type': repo['fields']['vcs'],
             'instance': self.instance,
         }
diff --git a/swh/lister/pypi/lister.py b/swh/lister/pypi/lister.py
index fedffd07..f45a3a6c 100644
--- a/swh/lister/pypi/lister.py
+++ b/swh/lister/pypi/lister.py
@@ -67,7 +67,6 @@ class PyPILister(ListerOnePageApiTransport, SimpleLister):
             'html_url': project_url_meta,
             'origin_url': project_url,
             'origin_type': 'pypi',
-            'description': None,
         }
 
     def transport_response_simplified(self, response):
-- 
GitLab