[1.7.x] Added database migration for contrib.sessions.

refs #22170.

Backport of 37a8f5aeed from master
This commit is contained in:
Tim Graham 2014-06-16 10:18:42 -04:00
parent f7709b3ce4
commit a15bf2cd4e
3 changed files with 29 additions and 0 deletions

View File

@ -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,),
),
]

View File

@ -1,3 +1,5 @@
from __future__ import unicode_literals
from django.db import models
from django.utils.translation import ugettext_lazy as _