Commit e306b23f authored by BERJON Matthieu's avatar BERJON Matthieu
Browse files

Update of the migration



To keep track of the migrations, I save the current status of the first
one. It differ in the last one because the migration process doesn't
rely on this initial django migration file anymore but on a plain SQL
script.
Signed-off-by: BERJON Matthieu's avatarMatthieu Berjon <matthieu.berjon@inria.fr>
parent 4eca6bcc
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-03-20 15:02
# Generated by Django 1.11 on 2018-03-23 16:42
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
......@@ -11,205 +12,178 @@ class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='DockerOs',
name='AllgoUser',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(blank=True, max_length=255)),
('version', models.CharField(blank=True, max_length=255)),
('docker_name', models.CharField(blank=True, max_length=255)),
('sshkey', models.CharField(max_length=40)),
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='allgouser', to=settings.AUTH_USER_MODEL)),
],
options={
'db_table': 'docker_os',
'db_table': 'allgo_user',
},
),
migrations.CreateModel(
name='Webapp',
name='DockerOs',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(blank=True, max_length=255, unique=True)),
('description', models.TextField(blank=True, null=True)),
('contact', models.CharField(blank=True, max_length=255, null=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now_add=True)),
('logo_file_name', models.CharField(blank=True, max_length=255, null=True)),
('logo_content_type', models.CharField(blank=True, max_length=255, null=True)),
('logo_file_size', models.IntegerField(blank=True, null=True)),
('logo_updated_at', models.DateTimeField(blank=True, null=True)),
('user_other', models.IntegerField(blank=True, null=True)),
('default_quota', models.IntegerField(blank=True, null=True)),
('docker_os', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='poc.DockerOs')),
('name', models.CharField(blank=True, max_length=255)),
('version', models.CharField(blank=True, max_length=255)),
('docker_name', models.CharField(blank=True, max_length=255)),
('readme', models.IntegerField(blank=True, null=True)),
('entrypoint', models.CharField(blank=True, max_length=255)),
('exec_time', models.IntegerField(blank=True, null=True)),
('private', models.IntegerField(blank=True, null=True)),
('access_token', models.CharField(blank=True, max_length=255, null=True)),
('sandbox_state', models.IntegerField(null=True)),
('sandbox_version_id', models.IntegerField(blank=True, null=True)),
('default_job_queue_id', models.IntegerField(null=True)),
('memory_limit', models.BigIntegerField(blank=True, null=True)),
],
options={
'db_table': 'webapps',
'db_table': 'docker_os',
},
),
migrations.CreateModel(
name='WebappParameter',
name='Job',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('value', models.CharField(blank=True, max_length=255, null=True)),
('name', models.CharField(blank=True, max_length=255, null=True)),
('detail', models.CharField(blank=True, max_length=255, null=True)),
('webapp', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='poc.Webapp')),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now_add=True)),
('param', models.CharField(blank=True, max_length=255, null=True)),
('datasize', models.IntegerField(blank=True, null=True)),
('version', models.CharField(blank=True, max_length=255, null=True)),
('exec_time', models.IntegerField(blank=True, null=True)),
('access_token', models.CharField(blank=True, max_length=255, null=True)),
('state', models.IntegerField()),
('result', models.IntegerField()),
('container_id', models.IntegerField(blank=True, null=True)),
],
options={
'db_table': 'webapp_parameters',
'db_table': 'jobs',
},
),
migrations.CreateModel(
name='WebappVersion',
name='JobQueue',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('number', models.CharField(blank=True, max_length=255)),
('changelog', models.CharField(blank=True, max_length=255)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now_add=True)),
('webapp', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='poc.Webapp')),
('docker_image_size', models.FloatField(blank=True, null=True)),
('state', models.IntegerField(null=True)),
('published', models.IntegerField()),
('name', models.CharField(max_length=255)),
('timeout', models.IntegerField(blank=True, null=True)),
('is_default', models.IntegerField()),
],
options={
'db_table': 'webapp_versions',
'db_table': 'job_queues',
},
),
migrations.CreateModel(
name='User',
name='JobUploads',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('email', models.CharField(max_length=255, unique=True)),
('encrypted_password', models.CharField(max_length=255)),
('reset_password_token', models.CharField(max_length=255, null=True, unique=True)),
('reset_password_sent_at', models.DateTimeField(blank=True, null=True)),
('remember_created_at', models.DateTimeField(blank=True, null=True)),
('sign_in_count', models.IntegerField()),
('current_sign_in_at', models.DateTimeField(blank=True, null=True)),
('last_sign_in_at', models.DateTimeField(blank=True, null=True)),
('current_sign_in_ip', models.CharField(blank=True, max_length=255, null=True)),
('last_sign_in_ip', models.CharField(blank=True, max_length=255, null=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now_add=True)),
('admin', models.IntegerField(default=False)),
('confirmation_token', models.CharField(blank=True, max_length=255, null=True, unique=True)),
('confirmed_at', models.DateTimeField(blank=True, null=True)),
('confirmation_sent_at', models.DateTimeField(blank=True, null=True)),
('sshkey', models.TextField(blank=True, null=True)),
('auth_token', models.CharField(blank=True, max_length=255, null=True)),
# ('webapp', models.ManyToManyField(through='poc.Quota', to='poc.Webapp')),
('job_file_file_name', models.CharField(blank=True, max_length=255)),
('job_file_content_type', models.CharField(blank=True, max_length=255)),
('job_file_file_size', models.IntegerField(blank=True, null=True)),
('job_file_updated_at', models.DateTimeField(auto_now_add=True, null=True)),
('job', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='jobuploadjob', to='poc.Job')),
],
options={
'db_table': 'users',
'db_table': 'job_uploads',
},
),
migrations.CreateModel(
name='Quota',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='poc.User')),
('webapp', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='poc.Webapp')),
('quantity', models.BigIntegerField(blank=True, null=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now_add=True)),
('quantity', models.BigIntegerField(blank=True, null=True)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='quotauser', to=settings.AUTH_USER_MODEL)),
],
options={
'db_table': 'quotas',
},
),
migrations.CreateModel(
name='JobQueue',
name='Webapp',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=255)),
('timeout', models.IntegerField(blank=True, null=True)),
('is_default', models.IntegerField()),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now_add=True)),
('name', models.CharField(blank=True, max_length=255, unique=True)),
('description', models.TextField(blank=True, null=True)),
('contact', models.CharField(blank=True, max_length=255, null=True)),
('logo_file_name', models.CharField(blank=True, max_length=255, null=True)),
('logo_content_type', models.CharField(blank=True, max_length=255, null=True)),
('logo_file_size', models.IntegerField(blank=True, null=True)),
('logo_updated_at', models.DateTimeField(blank=True, null=True)),
('user_other', models.IntegerField(blank=True, null=True)),
('default_quota', models.IntegerField(blank=True, null=True)),
('docker_name', models.CharField(blank=True, max_length=255)),
('readme', models.IntegerField(blank=True, null=True)),
('entrypoint', models.CharField(blank=True, max_length=255)),
('exec_time', models.IntegerField(blank=True, null=True)),
('private', models.IntegerField(blank=True, null=True)),
('access_token', models.CharField(blank=True, max_length=255, null=True)),
('sandbox_state', models.IntegerField(null=True)),
('memory_limit', models.BigIntegerField(blank=True, null=True)),
('docker_os', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='webappdockeros', to='poc.DockerOs')),
('job_queue', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='webappjobqueue', to='poc.JobQueue')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='webappuser', to=settings.AUTH_USER_MODEL)),
],
options={
'db_table': 'job_queues',
'db_table': 'webapps',
},
),
migrations.CreateModel(
name='Job',
name='WebappParameter',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('webapp', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='poc.Webapp')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='poc.User')),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now_add=True)),
('param', models.CharField(blank=True, null=True, max_length=255)),
('datasize', models.IntegerField(blank=True, null=True)),
('version', models.CharField(blank=True, null=True, max_length=255)),
('exec_time', models.IntegerField(blank=True, null=True)),
('size_generated_data', models.IntegerField(blank=True, null=True)),
('ipaddress', models.CharField(blank=True, null=True, max_length=255)),
('access_token', models.CharField(blank=True, null=True, max_length=255)),
('state', models.IntegerField()),
('container_id', models.IntegerField(blank=True, null=True)),
('queue', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='poc.JobQueue')),
('result', models.IntegerField()),
('value', models.CharField(blank=True, max_length=255, null=True)),
('name', models.CharField(blank=True, max_length=255, null=True)),
('detail', models.CharField(blank=True, max_length=255, null=True)),
('webapp', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='webappparameters', to='poc.Webapp')),
],
options={
'db_table': 'jobs',
'db_table': 'webapp_parameters',
},
),
migrations.CreateModel(
name='JobUploads',
name='WebappVersion',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('job_file_file_name', models.CharField(blank=True, max_length=255)),
('job_file_content_type', models.CharField(blank=True, max_length=255)),
('job_file_file_size', models.IntegerField(blank=True, null=True)),
('job_file_updated_at', models.DateTimeField(auto_now_add=True, null=True)),
('type', models.CharField(blank=True, null=True, max_length=255)),
('job', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='poc.Job')),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now_add=True)),
('number', models.CharField(blank=True, max_length=255)),
('changelog', models.CharField(blank=True, max_length=255)),
('docker_image_size', models.FloatField(blank=True, null=True)),
('state', models.IntegerField(null=True)),
('published', models.IntegerField()),
('webapp', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='webappversion', to='poc.Webapp')),
],
options={
'db_table': 'job_uploads',
'db_table': 'webapp_versions',
},
),
migrations.AddField(
model_name='user',
name='webapp',
field=models.ManyToManyField(through='poc.Quota', to='poc.Webapp'),
),
"""
migrations.AddField(
model_name='quota',
name='user',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='poc.User'),
name='webapp',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='quotawebapp', to='poc.Webapp'),
),
migrations.AddField(
model_name='quota',
name='webapp',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='poc.Webapp'),
model_name='job',
name='queue',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='jobqueue', to='poc.JobQueue'),
),
migrations.AddField(
model_name='job',
name='user',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='poc.User'),
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='jobuser', to='poc.AllgoUser'),
),
migrations.AddField(
model_name='job',
name='webapp',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='poc.Webapp'),
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='jobwebapp', to='poc.Webapp'),
),
"""
]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment