From a15bf2cd4e8f7279488f04aaf3040f420dc5f9cb Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Mon, 16 Jun 2014 10:18:42 -0400 Subject: [PATCH] [1.7.x] Added database migration for contrib.sessions. refs #22170. Backport of 37a8f5aeed from master --- .../sessions/migrations/0001_initial.py | 27 +++++++++++++++++++ .../contrib/sessions/migrations/__init__.py | 0 django/contrib/sessions/models.py | 2 ++ 3 files changed, 29 insertions(+) create mode 100644 django/contrib/sessions/migrations/0001_initial.py create mode 100644 django/contrib/sessions/migrations/__init__.py diff --git a/django/contrib/sessions/migrations/0001_initial.py b/django/contrib/sessions/migrations/0001_initial.py new file mode 100644 index 0000000000..652b128d85 --- /dev/null +++ b/django/contrib/sessions/migrations/0001_initial.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Session', + fields=[ + ('session_key', models.CharField(max_length=40, serialize=False, verbose_name='session key', primary_key=True)), + ('session_data', models.TextField(verbose_name='session data')), + ('expire_date', models.DateTimeField(verbose_name='expire date', db_index=True)), + ], + options={ + 'db_table': 'django_session', + 'verbose_name': 'session', + 'verbose_name_plural': 'sessions', + }, + bases=(models.Model,), + ), + ] diff --git a/django/contrib/sessions/migrations/__init__.py b/django/contrib/sessions/migrations/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/django/contrib/sessions/models.py b/django/contrib/sessions/models.py index 1ab42c03e1..674118f216 100644 --- a/django/contrib/sessions/models.py +++ b/django/contrib/sessions/models.py @@ -1,3 +1,5 @@ +from __future__ import unicode_literals + from django.db import models from django.utils.translation import ugettext_lazy as _