uwcirg / tb-api

1 stars 1 forks source link

Remove unused `mpower-db` tables #23

Closed c4lliope closed 5 years ago

c4lliope commented 5 years ago

The app uses two databases: tbapp-db and mpower-db. tbapp-db has five tables, and mpower has 92 - most of which are unused.

It is easy to find the mpower-db tables that are used: run a search for the __bind_key__ keyword, which SQLAlchemy uses to reference any database other than the default.

The search returns four results, all in webapp/tbapi/tbapi/models/mpower.py:

class Patient(SerializeMixin, db.Model):
    __bind_key__ = 'mpower'
    __table__ = db.Model.metadata.tables['patients']

class User(SerializeMixin, db.Model):
    __bind_key__ = 'mpower'
    __table__ = db.Model.metadata.tables['users']

class UserAclLeaf(db.Model):
    __bind_key__ = 'mpower'
    __table__ = db.Model.metadata.tables['user_acl_leafs']

class IdentityProvider(db.Model):
    __bind_key__ = 'mpower'
    __table__ = db.Model.metadata.tables['identity_providers']

Theoretically, we can remove all other tables from mpower-db without running into any problems.

c4lliope commented 5 years ago

Closing; conversation with Piotr revealed that this will conflict with current development goals.