Commit 9a10e025 authored by BERJON Matthieu's avatar BERJON Matthieu

Add the legacy database model

I added the legacy database model into the app.

In order to do that I:

- created the urls.py and views.py file (required by Django)
- created the legacy model using the inspectdb tools given by Django and
stored in models.py
- followed the process to initialize the migrations at the stage of the
model (resulting in the creation of the migrations folder)
Signed-off-by: BERJON Matthieu's avatarMatthieu Berjon <matthieu.berjon@inria.fr>
parent d23c54b9
This diff is collapsed.
# This is an auto-generated Django model module.
# You'll have to do the following manually to clean this up:
# * Rearrange models' order
# * Make sure each model has one field with primary_key=True
# * Make sure each ForeignKey has `on_delete` set to the desired behavior.
# * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table
# Feel free to rename the models, but don't rename db_table values or field names.
from __future__ import unicode_literals
from django.db import models
class ArInternalMetadata(models.Model):
key = models.CharField(primary_key=True, max_length=255)
value = models.CharField(max_length=255, blank=True, null=True)
created_at = models.DateTimeField()
updated_at = models.DateTimeField()
class Meta:
db_table = 'ar_internal_metadata'
class Users(models.Model):
email = models.CharField(unique=True, max_length=255)
encrypted_password = models.CharField(max_length=255)
reset_password_token = models.CharField(unique=True, max_length=255, blank=True, null=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(max_length=255, blank=True, null=True)
last_sign_in_ip = models.CharField(max_length=255, blank=True, null=True)
created_at = models.DateTimeField(blank=True, null=True)
updated_at = models.DateTimeField(blank=True, null=True)
admin = models.IntegerField(blank=True, null=True)
confirmation_token = models.CharField(unique=True, max_length=255, blank=True, null=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(max_length=255, blank=True, null=True)
class Meta:
db_table = 'users'
class Webapps(models.Model):
name = models.CharField(unique=True, max_length=255, blank=True, null=True)
description = models.TextField(blank=True, null=True)
contact = models.CharField(max_length=255, blank=True, null=True)
created_at = models.DateTimeField(blank=True, null=True)
updated_at = models.DateTimeField(blank=True, null=True)
logo_file_name = models.CharField(max_length=255, blank=True, null=True)
logo_content_type = models.CharField(max_length=255, blank=True, null=True)
logo_file_size = models.IntegerField(blank=True, null=True)
logo_updated_at = models.DateTimeField(blank=True, null=True)
user_id = models.IntegerField(blank=True, null=True)
default_quota = models.IntegerField(blank=True, null=True)
docker_os_id = models.IntegerField(blank=True, null=True)
docker_name = models.CharField(max_length=255, blank=True, null=True)
readme = models.IntegerField(blank=True, null=True)
entrypoint = models.CharField(max_length=255, blank=True, null=True)
exec_time = models.IntegerField(blank=True, null=True)
private = models.IntegerField(blank=True, null=True)
access_token = models.CharField(max_length=255, blank=True, null=True)
sandbox_state = models.IntegerField()
sandbox_version_id = models.IntegerField(blank=True, null=True)
default_job_queue_id = models.IntegerField()
memory_limit = models.BigIntegerField(blank=True, null=True)
class Meta:
db_table = 'webapps'
class Datasets(models.Model):
name = models.CharField(max_length=255)
size = models.IntegerField(blank=True, null=True)
extension = models.CharField(max_length=255, blank=True, null=True)
user_id = models.IntegerField(blank=True, null=True)
created_at = models.DateTimeField()
updated_at = models.DateTimeField()
file_name = models.CharField(max_length=255, blank=True, null=True)
class Meta:
db_table = 'datasets'
class DockerOs(models.Model):
name = models.CharField(max_length=255, blank=True, null=True)
version = models.CharField(max_length=255, blank=True, null=True)
docker_name = models.CharField(max_length=255, blank=True, null=True)
class Meta:
db_table = 'docker_os'
class JobQueues(models.Model):
name = models.CharField(max_length=255)
timeout = models.IntegerField(blank=True, null=True)
is_default = models.IntegerField()
created_at = models.DateTimeField()
updated_at = models.DateTimeField()
class Meta:
db_table = 'job_queues'
class JobUploads(models.Model):
job_file_file_name = models.CharField(max_length=255, blank=True, null=True)
job_file_content_type = models.CharField(max_length=255, blank=True, null=True)
job_file_file_size = models.IntegerField(blank=True, null=True)
job_file_updated_at = models.DateTimeField(blank=True, null=True)
type = models.CharField(max_length=255, blank=True, null=True)
job_id = models.IntegerField(blank=True, null=True)
class Meta:
db_table = 'job_uploads'
class Jobs(models.Model):
webapp_id = models.IntegerField(blank=True, null=True)
user_id = models.IntegerField(blank=True, null=True)
created_at = models.DateTimeField(blank=True, null=True)
updated_at = models.DateTimeField(blank=True, null=True)
param = models.CharField(max_length=255, blank=True, null=True)
datasize = models.IntegerField(blank=True, null=True)
version = models.CharField(max_length=255, blank=True, null=True)
exec_time = models.IntegerField(blank=True, null=True)
size_generated_data = models.IntegerField(blank=True, null=True)
ipaddress = models.CharField(max_length=255, blank=True, null=True)
access_token = models.CharField(max_length=255, blank=True, null=True)
state = models.IntegerField()
container_id = models.CharField(max_length=64, blank=True, null=True)
queue_id = models.IntegerField()
result = models.IntegerField()
class Meta:
db_table = 'jobs'
class Quotas(models.Model):
#user_id = models.IntegerField()
webapp_id = models.IntegerField()
quantity = models.BigIntegerField(blank=True, null=True)
created_at = models.DateTimeField(blank=True, null=True)
updated_at = models.DateTimeField(blank=True, null=True)
# Relationships
user = models.ForeignKey(Users, on_delete=models.CASCADE, null=True)
# webapp_id = models.ForeignKey(Webapps, on_delete=models.CASCADE, null=True)
class Meta:
db_table = 'quotas'
class SchemaMigrations(models.Model):
version = models.CharField(unique=True, max_length=255)
class Meta:
db_table = 'schema_migrations'
class Taggings(models.Model):
tag_id = models.IntegerField(blank=True, null=True)
taggable_id = models.IntegerField(blank=True, null=True)
taggable_type = models.CharField(max_length=255, blank=True, null=True)
tagger_id = models.IntegerField(blank=True, null=True)
tagger_type = models.CharField(max_length=255, blank=True, null=True)
context = models.CharField(max_length=128, blank=True, null=True)
created_at = models.DateTimeField(blank=True, null=True)
class Meta:
db_table = 'taggings'
unique_together = (('tag_id', 'taggable_id', 'taggable_type', 'context', 'tagger_id', 'tagger_type'),)
class Tags(models.Model):
name = models.CharField(unique=True, max_length=255, blank=True, null=True)
taggings_count = models.IntegerField(blank=True, null=True)
class Meta:
db_table = 'tags'
class WebappDemos(models.Model):
name = models.CharField(max_length=255, blank=True, null=True)
extension = models.CharField(max_length=255, blank=True, null=True)
webapp_id = models.IntegerField(blank=True, null=True)
file_type = models.CharField(max_length=255, blank=True, null=True)
class Meta:
db_table = 'webapp_demos'
class WebappParameters(models.Model):
value = models.CharField(max_length=255, blank=True, null=True)
name = models.CharField(max_length=255, blank=True, null=True)
detail = models.CharField(max_length=255, blank=True, null=True)
webapp_id = models.IntegerField(blank=True, null=True)
class Meta:
db_table = 'webapp_parameters'
class WebappVersions(models.Model):
number = models.CharField(max_length=255, blank=True, null=True)
changelog = models.CharField(max_length=255, blank=True, null=True)
created_at = models.DateTimeField(blank=True, null=True)
updated_at = models.DateTimeField(blank=True, null=True)
webapp_id = models.IntegerField(blank=True, null=True)
docker_image_size = models.FloatField(blank=True, null=True)
state = models.IntegerField()
published = models.IntegerField()
class Meta:
db_table = 'webapp_versions'
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