forked from CenterForOpenScience/osf.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move createcachetable to post migrate signal (CenterForOpenScience#9944)
Use management command in post-migrate signal to create cache table instead of in Raw SQL in migrations Co-authored-by: John Tordoff <>
- Loading branch information
1 parent
e36831c
commit 06d7c86
Showing
3 changed files
with
12 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,11 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
from django.db import migrations | ||
from django.conf import settings | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
('osf', '0155_merge_20190115_1437'), | ||
] | ||
operations = [ | ||
migrations.RunSQL([ | ||
""" | ||
CREATE TABLE "{}" ( | ||
"cache_key" varchar(255) NOT NULL PRIMARY KEY, | ||
"value" text NOT NULL, | ||
"expires" timestamp with time zone NOT NULL | ||
); | ||
""".format(settings.CACHES[settings.STORAGE_USAGE_CACHE_NAME]['LOCATION']) | ||
], [ | ||
"""DROP TABLE "{}"; """.format(settings.CACHES[settings.STORAGE_USAGE_CACHE_NAME]['LOCATION']) | ||
]) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters