diff --git a/.gitpod.yml b/.gitpod.yml index ee982fa4..8f098d82 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -5,8 +5,7 @@ tasks: pipenv install --three && npm install -g gulp-cli && npm install && - gulp migrate && - gulp createcachetable + gulp migrate env: DJANGO_SETTINGS_MODULE: babybuddy.settings.gitpod command: gulp diff --git a/Procfile.sh b/Procfile.sh index a017850e..196af745 100644 --- a/Procfile.sh +++ b/Procfile.sh @@ -1,6 +1,5 @@ #!/bin/bash python manage.py migrate -python manage.py createcachetable gunicorn babybuddy.wsgi:application --timeout 30 --log-file - \ No newline at end of file diff --git a/babybuddy/management/commands/reset.py b/babybuddy/management/commands/reset.py index 34840a75..6d7c835a 100644 --- a/babybuddy/management/commands/reset.py +++ b/babybuddy/management/commands/reset.py @@ -62,11 +62,6 @@ class Command(BaseCommand): options["migration_name"] = None migrate.handle(*args, **options) - # Create cache table. - call_command("createcachetable", verbosity=verbosity) - if verbosity > 0: - self.stdout.write(self.style.SUCCESS("Cache table created.")) - # Clear cache. cache.clear() if verbosity > 0: diff --git a/babybuddy/migrations/0029_create_cache_table.py b/babybuddy/migrations/0029_create_cache_table.py new file mode 100644 index 00000000..af2753d1 --- /dev/null +++ b/babybuddy/migrations/0029_create_cache_table.py @@ -0,0 +1,16 @@ +# Generated by Django 4.2.3 on 2023-07-24 19:09 + +from django.db import migrations +from django.core.management import call_command + + +def create_cache_table(apps, schema_editor): + call_command("createcachetable", verbosity=0) + + +class Migration(migrations.Migration): + dependencies = [ + ("babybuddy", "0028_alter_settings_language_alter_settings_timezone"), + ] + + operations = [migrations.RunPython(create_cache_table, migrations.RunPython.noop)] diff --git a/docs/contributing/development-environment.md b/docs/contributing/development-environment.md index de949832..6071234c 100644 --- a/docs/contributing/development-environment.md +++ b/docs/contributing/development-environment.md @@ -64,12 +64,6 @@ information and steps below to set up a local development environment for Baby B ```shell gulp migrate ``` - -1. Create cache table - - ```shell - gulp createcachetable - ``` 1. Build assets and run the server diff --git a/docs/contributing/gulp-command-reference.md b/docs/contributing/gulp-command-reference.md index e695456f..396d2c0f 100644 --- a/docs/contributing/gulp-command-reference.md +++ b/docs/contributing/gulp-command-reference.md @@ -57,11 +57,6 @@ for more details about other options and functionality of this command. Create a test coverage report. See [`.coveragerc`](https://github.com/babybuddy/babybuddy/tree/master/.coveragerc) for default settings information. -### `createcachetable` - -Executes Django's `createcachetable` management task. See [django-admin createcachetable](https://docs.djangoproject.com/en/4.0/ref/django-admin/#createcachetable) -for more details about other options and functionality of this command. - ### `extras` Copies "extra" files (fonts, images and server root contents) to the build diff --git a/docs/setup/deployment.md b/docs/setup/deployment.md index eee42a31..88bc8743 100644 --- a/docs/setup/deployment.md +++ b/docs/setup/deployment.md @@ -66,7 +66,7 @@ application before pushing the babybuddy source code: ```shell CC_PYTHON_BACKEND=uwsgi -CC_PYTHON_MANAGE_TASKS=migrate, createcachetable +CC_PYTHON_MANAGE_TASKS=migrate CC_PYTHON_MODULE=babybuddy.wsgi:application DJANGO_SETTINGS_MODULE=babybuddy.settings.clever-cloud SECRET_KEY= @@ -151,7 +151,6 @@ and any number of children). ```shell export DJANGO_SETTINGS_MODULE=babybuddy.settings.production python manage.py migrate - python manage.py createcachetable ``` 9. Set appropriate permissions on the database and data folder diff --git a/gulpfile.js b/gulpfile.js index 3d14cb50..31ac236a 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -273,10 +273,6 @@ gulp.task('compilemessages', () => { return _runInPipenv(['python', 'manage.py', 'compilemessages']); }); -gulp.task('createcachetable', () => { - return _runInPipenv(['python', 'manage.py', 'createcachetable']); -}); - gulp.task('fake', () => { return _runInPipenv(['python', 'manage.py', 'fake']); });