Skip to content

A Django app to automatically handle archiving model tables in MySQL.

License

Notifications You must be signed in to change notification settings

rayhern/django-table-archive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

django-table-archive

Django table archive is an app that will allow you to backup your models in MySQL to a different database.

Quick start

  1. pip install django-table-archive

  2. Add "django_table_archive" to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = [
        ...
        'django_table_archive',
    ]
    
  3. Add this to your settings.py:

    ARCHIVE_DB_ALIAS = 'archive'
    ARCHIVE_PRIMARY_DB = 'default'
    ARCHIVE_TABLES = [
        {
            'table': 'api_person',
            'days_old': '90',
            'date_field': 'date_created'
        }
    ]
    

This archive process will also work with django-table-sharding package. It will look for all tables matching the name and back them all up.

table = The table to archive.

days_old = Archive all items that are over 90 days old.

date_field = The datetime used to check if it is over 90 days old.

About

A Django app to automatically handle archiving model tables in MySQL.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages