Skip to content
This repository has been archived by the owner on Apr 29, 2022. It is now read-only.

Remove SpecialPlace model #839

Closed
artcz opened this issue Oct 15, 2018 · 2 comments
Closed

Remove SpecialPlace model #839

artcz opened this issue Oct 15, 2018 · 2 comments

Comments

@artcz
Copy link
Contributor

artcz commented Oct 15, 2018

Looks like we're not using it at all.

@umgelurgel
Copy link
Contributor

There's a handful of other models that look like might not be used (e.g. Quote or Hotel) - the following command ran from a django shell will list all tables that have no rows:

from django.db import connection

with connection.cursor() as cursor:
    cursor.execute("select name from sqlite_master where type = 'table' AND name NOT LIKE 'sqlite_%' AND name NOT LIKE 'django_%' AND name NOT LIKE 'auth_%' and name NOT LIKE 'cms_%'");
    tables = cursor.fetchall()
    for table in tables:
        tablename = table[0]
        cursor.execute("select count(1) from {}".format(tablename))
        row_count = cursor.fetchone()[0]
        if row_count == 0:
            print tablename

@umgelurgel
Copy link
Contributor

Recording project tables currently returned by the query:

conference_presence
conference_attendeelink
conference_mediapartner
conference_mediapartnerconference
conference_eventbooking
conference_specialplace
conference_quote
conference_captchaquestion
p3_ticketsim
p3_ticketroom
p3_hotelroom
assopy_useridentity
assopy_creditnote
assopy_refundorderitem
assopy_refund

Having had a look at some of them, they seem to be used in quite a few views or dataaccess caching functions, so if those aren't used, that would allow to retire a big chunk of code. @artcz is there any way to query production logs to confirm particular used have not been used?

There's also a handful that at first glance don't seem to belong to any application:

microblog_post
microblog_spam
microblog_postcontent
microblog_trackback

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants