OpenVJ/server/migrations/0001_initial.py
2016-03-08 17:55:23 +08:00

116 lines
4.6 KiB
Python

# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-03-08 08:20
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='APIKey',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('api_key', models.CharField(max_length=40)),
('name', models.CharField(max_length=40)),
('is_valid', models.BooleanField(default=True)),
('create_time', models.DateTimeField(auto_now_add=True)),
],
options={
'db_table': 'api_key',
},
),
migrations.CreateModel(
name='OJ',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=30)),
('is_valid', models.BooleanField(default=True)),
],
options={
'db_table': 'oj',
},
),
migrations.CreateModel(
name='Problem',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('url', models.URLField()),
('submit_url', models.URLField()),
('title', models.CharField(max_length=100)),
('description', models.TextField()),
('time_limit', models.IntegerField()),
('memory_limit', models.IntegerField()),
('input_description', models.TextField()),
('output_description', models.TextField()),
('samples', models.TextField()),
('spj', models.BooleanField()),
('hint', models.TextField()),
('is_valid', models.BooleanField(default=True)),
('status', models.IntegerField()),
('task_id', models.CharField(max_length=40)),
('oj', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='server.OJ')),
],
options={
'db_table': 'problem',
},
),
migrations.CreateModel(
name='RobotStatusInfo',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('status_info', models.TextField()),
('last_update_time', models.DateTimeField(auto_now=True)),
],
options={
'db_table': 'robot_status_info',
},
),
migrations.CreateModel(
name='RobotUser',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('username', models.CharField(max_length=30)),
('password', models.CharField(max_length=30)),
('is_valid', models.BooleanField(default=True)),
('last_login_time', models.DateTimeField()),
('status', models.IntegerField(choices=[('Occupied', 1), ('free', 0)])),
('oj', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='server.OJ')),
],
options={
'db_table': 'robot_user',
},
),
migrations.CreateModel(
name='Submission',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('result', models.IntegerField()),
('cpu_time', models.IntegerField()),
('memory', models.IntegerField()),
('info', models.TextField()),
('problem', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='server.Problem')),
('robot_user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='server.RobotUser')),
],
options={
'db_table': 'submission',
},
),
migrations.AddField(
model_name='robotstatusinfo',
name='robot_user',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='server.RobotUser'),
),
migrations.AlterUniqueTogether(
name='robotuser',
unique_together=set([('oj', 'username')]),
),
]