Skip to content

Commit

Permalink
[OSDEV-1142] Technical Debt. Remove unused api_tilecache and `api_d…
Browse files Browse the repository at this point in the history
…ynamicsetting` tables. (#303)

[OSDEV-1142](https://opensupplyhub.atlassian.net/browse/OSDEV-1142)
Technical Debt. Remove unused `api_tilecache` and `api_dynamicsetting`
tables.

* Removed files with models Tilecache and Dynamicsetting
* Added 0152 migration with deleting models and tables from db
* Removed imports and the file with unused functions
* Replaced direct model import with method get_model in 0133 migration

[OSDEV-1142]:
https://opensupplyhub.atlassian.net/browse/OSDEV-1142?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

---------

Co-authored-by: Inessa Druzhkova <[email protected]>
  • Loading branch information
Innavin369 and Inessa Druzhkova authored Jul 26, 2024
1 parent 3818cf7 commit 847679d
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 187 deletions.
28 changes: 28 additions & 0 deletions doc/release/RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,34 @@ All notable changes to this project will be documented in this file.

This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). The format is based on the `RELEASE-NOTES-TEMPLATE.md` file.

## Release 1.18.0

## Introduction
* Product name: Open Supply Hub
* Release date: August 10, 2024

### Database changes
#### Migrations:
* 0152_delete_tilecache_and_dynamicsetting - removed unused `api_tilecache` and `api_dynamicsetting` tables.

#### Scheme changes
* [OSDEV-1142](https://opensupplyhub.atlassian.net/browse/OSDEV-1142) - Technical Debt. Remove unused `api_tilecache` and `api_dynamicsetting` tables. Migration has been created, removed related data in the code base.

### Code/API changes
* *Describe code/API changes here.*

### Architecture/Environment changes
* *Describe architecture/environment changes here.*

### Bugfix
* *Describe bugfix here.*

### What's new
* *Describe what's new here. The changes that can impact user experience should be listed in this section.*

### Release instructions:
* *Provide release instructions here.*


## Release 1.17.0

Expand Down
6 changes: 0 additions & 6 deletions src/django/api/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,6 @@ def get_ordering(self, request):
return ['name']


class TileCacheAdmin(SimpleHistoryAdmin):
search_fields = ('path', 'embed')


admin_site.register(models.Version)
admin_site.register(models.User, OarUserAdmin)
admin_site.register(models.Contributor, ContributorAdmin)
Expand All @@ -205,5 +201,3 @@ class TileCacheAdmin(SimpleHistoryAdmin):
admin_site.register(models.RequestLog, RequestLogAdmin)
admin_site.register(models.ApiLimit, ApiLimitAdmin)
admin_site.register(models.Sector, SectorAdmin)
admin_site.register(models.TileCache, TileCacheAdmin)
admin_site.register(models.DynamicSetting)
4 changes: 1 addition & 3 deletions src/django/api/migrations/0133_introduce_tile_caching.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@
from django.db import models
from django.db.migrations import Migration, CreateModel, RunPython

from api.models.dynamic_setting import DynamicSetting


def add_default_dynamic_settings(apps, schema_editor):
DynamicSetting = apps.get_model('api', 'DynamicSetting')
dynamic_settings = DynamicSetting()
dynamic_settings.save()


class Migration(Migration):

dependencies = [
('api', '0132_add_moderation_mode_field'),
]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

# Generated by Django 3.2.4 on 2024-07-24 12:38

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('api', '0151_replace_index_number_of_workers'),
]

operations = [
migrations.DeleteModel(
name='DynamicSetting',
),
migrations.DeleteModel(
name='TileCache',
),
]
2 changes: 0 additions & 2 deletions src/django/api/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,3 @@
User,
)
from .version import Version
from .tile_cache import TileCache
from .dynamic_setting import DynamicSetting
37 changes: 0 additions & 37 deletions src/django/api/models/dynamic_setting.py

This file was deleted.

37 changes: 0 additions & 37 deletions src/django/api/models/tile_cache.py

This file was deleted.

79 changes: 0 additions & 79 deletions src/django/api/tests/test_tile_caching.py

This file was deleted.

23 changes: 0 additions & 23 deletions src/django/api/views/tile/utils.py

This file was deleted.

0 comments on commit 847679d

Please sign in to comment.