예제 #1
0
class Migration(migrations.Migration):

    dependencies = [
        ('app', '0008_alter_animal_typee'),
    ]

    operations = [
        migrations.CreateModel(
            name='Attachment',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('title', models.CharField(max_length=200,
                                           verbose_name='Title')),
                ('last_update', models.DateTimeField(auto_now=True)),
                ('file',
                 models.FileField(null=True,
                                  upload_to=app.models.attachment_path,
                                  verbose_name='File')),
                ('type',
                 models.CharField(blank=True,
                                  choices=[('audio', 'Audio'),
                                           ('image', 'Image'),
                                           ('text', 'Text'),
                                           ('video', 'Video'),
                                           ('other', 'Other')],
                                  default='image',
                                  help_text='Select attachment type',
                                  max_length=5,
                                  verbose_name='Attachment type')),
                ('animal',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='app.animal')),
            ],
            options={
                'ordering': ['-last_update', 'type'],
            },
        ),
    ]
예제 #2
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='File',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('file',
                 models.FileField(unique=True, upload_to=app.models.get_path)),
            ],
        ),
    ]
예제 #3
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='Channel',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
                ('channel_art',
                 models.ImageField(default='default_art.jpg',
                                   upload_to='channel/')),
                ('channel_icon',
                 models.ImageField(default='default_icon.jpg',
                                   upload_to='profile/')),
                ('slug', models.SlugField()),
                ('description', models.TextField(blank=True, null=True)),
                ('category',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='app.category')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='VideoFiles',
            fields=[
                ('id',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  primary_key=True,
                                  serialize=False)),
                ('video',
                 models.FileField(
                     upload_to=app.models.channel_directory_path)),
                ('uploaded', models.DateTimeField(auto_now_add=True)),
                ('channel',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='app.channel')),
            ],
        ),
        migrations.CreateModel(
            name='VideoDetail',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('title', models.CharField(max_length=200)),
                ('description', models.TextField()),
                ('visibility',
                 models.BooleanField(choices=[(False,
                                               'private'), (True, 'public')])),
                ('thumbnail', models.ImageField(upload_to='thumbnail/')),
                ('videofile',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to='app.videofiles')),
            ],
        ),
    ]
예제 #4
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0012_alter_user_first_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
                ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
                ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
                ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
                ('is_online', models.BooleanField(default=False)),
                ('avatar', models.FileField(blank=True, null=True, upload_to=app.models.content_file_name_user, verbose_name='Аватар')),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
                ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
            ],
            options={
                'verbose_name': 'Пользователь',
                'verbose_name_plural': 'Пользователи',
            },
            managers=[
                ('objects', app.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Game',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(blank=True, max_length=50, null=True, verbose_name='Пароль')),
                ('creator_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='creator', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='UserChar',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('biodate', models.CharField(blank=True, max_length=5, null=True, verbose_name='Биологические данные')),
                ('job', models.CharField(blank=True, max_length=5, null=True, verbose_name='Профессия')),
                ('health', models.CharField(blank=True, max_length=5, null=True, verbose_name='Здоровье')),
                ('phobia', models.CharField(blank=True, max_length=5, null=True, verbose_name='Фобия')),
                ('hobby', models.CharField(blank=True, max_length=5, null=True, verbose_name='Хобби')),
                ('addinfo', models.CharField(blank=True, max_length=5, null=True, verbose_name='Допольнительная информация')),
                ('character', models.CharField(blank=True, max_length=5, null=True, verbose_name='Характер')),
                ('baggage', models.CharField(blank=True, max_length=5, null=True, verbose_name='Багаж')),
                ('spell_1', models.CharField(blank=True, max_length=5, null=True, verbose_name='Карта способности 1')),
                ('spell_2', models.CharField(blank=True, max_length=5, null=True, verbose_name='Карта способности 2')),
                ('player', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='player', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='GameRules',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('type', models.CharField(blank=True, max_length=5, null=True, verbose_name='Тип Катастрофы')),
                ('area', models.CharField(blank=True, max_length=5, null=True, verbose_name='Площадь')),
                ('days', models.CharField(blank=True, max_length=5, null=True, verbose_name='Количество дней')),
                ('items', models.CharField(blank=True, max_length=5, null=True, verbose_name='Предметы находящие в бункере')),
                ('population', models.CharField(blank=True, max_length=5, null=True, verbose_name='Количество(%) население оставщихся людей в мире')),
                ('desc', models.CharField(blank=True, max_length=5, null=True, verbose_name='Описание')),
                ('game', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='game', to='app.game')),
            ],
        ),
    ]
예제 #5
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
        ('auth', '0011_update_proxy_permissions'),
    ]

    operations = [
        migrations.CreateModel(
            name='CustomEmailUser',
            fields=[
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('email',
                 models.EmailField(db_index=True,
                                   max_length=255,
                                   unique=True,
                                   verbose_name='email address')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_active',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
                     verbose_name='active')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('groups',
                 models.ManyToManyField(
                     blank=True,
                     help_text=
                     'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Group',
                     verbose_name='groups')),
                ('user_permissions',
                 models.ManyToManyField(
                     blank=True,
                     help_text='Specific permissions for this user.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Permission',
                     verbose_name='user permissions')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Brand',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=120)),
                ('fullname_kr',
                 models.CharField(blank=True, max_length=120, null=True)),
                ('fullname_en',
                 models.CharField(blank=True, max_length=120, null=True)),
                ('keywords',
                 models.TextField(blank=True, max_length=500, null=True)),
                ('origin',
                 models.CharField(blank=True, max_length=50, null=True)),
                ('awareness', models.FloatField(default=0)),
                ('category',
                 models.CharField(blank=True, max_length=120, null=True)),
                ('description',
                 models.TextField(blank=True, max_length=500, null=True)),
                ('image',
                 models.ImageField(default='', upload_to='brand_images')),
            ],
        ),
        migrations.CreateModel(
            name='Channel',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('object_id', models.PositiveIntegerField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('nlikes', models.IntegerField(default='0')),
                ('content_type',
                 models.ForeignKey(limit_choices_to=models.Q(
                     models.Q(('app_label', 'app'), ('model', 'brand')),
                     models.Q(('app_label', 'app'),
                              ('model', 'customchannel')),
                     _connector='OR'),
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='contenttypes.ContentType')),
            ],
        ),
        migrations.CreateModel(
            name='Customchannel',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=120)),
                ('keywords',
                 models.TextField(blank=True, max_length=500, null=True)),
                ('description',
                 models.TextField(blank=True, max_length=500, null=True)),
                ('image',
                 models.ImageField(default='',
                                   upload_to='customchannel_images')),
            ],
        ),
        migrations.CreateModel(
            name='Hashtag',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('hashtag', models.CharField(max_length=120)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Option',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('optname', models.CharField(default='init', max_length=120)),
                ('idwords',
                 models.TextField(
                     default=
                     '[{"럭셔리": "럭셔리 고급 호화 과시 명품 luxury 비싼 고가 expensive pricy pricey", "캐주얼": "캐주얼 캐쥬얼 casual 스타일리시 스타일리쉬 stylish"}, {"유니크": "유니크 독특 독창 unique 개성 only 참신 신선 특이 아이디어 철학", "대중성": "대중 popular 널리 흔한 massive mass 대중성"}, {"정통성": "정통 클래식 classic 품격 약속 신뢰 믿음 예측 견고 품질 안정", "트렌디": "트렌디 트랜디 트렌드 트랜드 유행 trend trendy 변화 새로운 민감 예민 신상 최신"}, {"포멀": "포멀 formal 노멀 normal 평범 일상 무난 기본 베이스 베이직 base basic", "액티브": "화제 인기 hot 튀는 액티브 active 앞서가는 실험 과감 선도 선구 대담"}]'
                 )),
                ('api',
                 models.CharField(default='http://127.0.0.1:8080/api',
                                  max_length=120)),
                ('id_scaletype', models.IntegerField(default='0')),
            ],
        ),
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('image',
                 models.ImageField(upload_to='posts/%Y/%m/%d/origin')),
                ('content',
                 models.TextField(blank=True, max_length=500, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('brands_related',
                 models.ManyToManyField(blank=True, to='app.Brand')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('image',
                 models.ImageField(default='', max_length=500, upload_to='')),
                ('worldcup',
                 models.TextField(blank=True, default='{}', null=True)),
                ('initial_awared', models.TextField(blank=True, null=True)),
                ('brand_bookmarks',
                 models.ManyToManyField(blank=True,
                                        related_name='brand_bookmarks_set',
                                        to='app.Brand')),
                ('brand_likes',
                 models.ManyToManyField(blank=True,
                                        related_name='brand_likes_set',
                                        to='app.Brand')),
                ('level_tested',
                 models.ManyToManyField(blank=True,
                                        related_name='leveltested_set',
                                        to='app.Brand')),
                ('myfavorite',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='myfavorite_set',
                     to='app.Brand')),
                ('post_bookmarks',
                 models.ManyToManyField(blank=True,
                                        related_name='post_bookmarks_set',
                                        to='app.Post')),
                ('post_likes',
                 models.ManyToManyField(blank=True,
                                        related_name='post_likes_set',
                                        to='app.Post')),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Feed',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('timestamp', models.DateTimeField()),
                ('nlikes', models.IntegerField(default='0')),
                ('content',
                 models.TextField(blank=True, max_length=1000, null=True)),
                ('image',
                 models.ImageField(upload_to=app.models.feed_image_path)),
                ('author',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='app.Profile')),
                ('channels',
                 models.ManyToManyField(blank=True, to='app.Channel')),
                ('hashtags',
                 models.ManyToManyField(blank=True, to='app.Hashtag')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='CommentPost',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('content',
                 models.TextField(blank=True, max_length=500, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('post',
                 models.ForeignKey(blank=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='app.Post')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='CommentBrand',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('content',
                 models.TextField(blank=True, max_length=500, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('brand',
                 models.ForeignKey(blank=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='app.Brand')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='channel',
            name='master',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to='app.Profile'),
        ),
    ]
예제 #6
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='AggAll',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('start_dat',
                 app.models.DateCharField(max_length=20,
                                          verbose_name='start date')),
                ('duration_sum',
                 models.IntegerField(
                     default=0,
                     verbose_name=
                     'Somme des durations des donnees de cette agregation')),
                ('duration_max',
                 models.IntegerField(
                     default=0,
                     verbose_name=
                     'Max des durations des donnees de cette agregation')),
                ('qa_modifications', models.IntegerField(default=0)),
                ('qa_incidents', models.IntegerField(default=0)),
                ('qa_check_done', models.BooleanField(default=False)),
                ('j',
                 app.models.DateJSONField(
                     encoder=django.core.serializers.json.DjangoJSONEncoder)),
            ],
            options={
                'db_table': 'agg_all',
            },
        ),
        migrations.CreateModel(
            name='AggDay',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('start_dat',
                 app.models.DateCharField(max_length=20,
                                          verbose_name='start date')),
                ('duration_sum',
                 models.IntegerField(
                     default=0,
                     verbose_name=
                     'Somme des durations des donnees de cette agregation')),
                ('duration_max',
                 models.IntegerField(
                     default=0,
                     verbose_name=
                     'Max des durations des donnees de cette agregation')),
                ('qa_modifications', models.IntegerField(default=0)),
                ('qa_incidents', models.IntegerField(default=0)),
                ('qa_check_done', models.BooleanField(default=False)),
                ('j',
                 app.models.DateJSONField(
                     encoder=django.core.serializers.json.DjangoJSONEncoder)),
            ],
            options={
                'db_table': 'agg_day',
            },
        ),
        migrations.CreateModel(
            name='AggHisto',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('obs_id',
                 models.IntegerField(
                     default=0,
                     verbose_name='Last obs which update this record')),
                ('agg_id',
                 models.IntegerField(
                     default=0,
                     verbose_name='Aggregation_id which update this record')),
                ('agg_level',
                 models.CharField(max_length=2,
                                  verbose_name='Aggregation level')),
                ('delta_duration',
                 models.IntegerField(
                     default=0,
                     verbose_name=
                     'Somme des durations des donnees de cette agregation')),
                ('j',
                 app.models.DateJSONField(
                     encoder=django.core.serializers.json.DjangoJSONEncoder)),
            ],
            options={
                'db_table': 'agg_histo',
            },
        ),
        migrations.CreateModel(
            name='AggHour',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('start_dat',
                 app.models.DateCharField(max_length=20,
                                          verbose_name='start date')),
                ('duration_sum',
                 models.IntegerField(
                     default=0,
                     verbose_name=
                     'Somme des durations des donnees de cette agregation')),
                ('duration_max',
                 models.IntegerField(
                     default=0,
                     verbose_name=
                     'Max des durations des donnees de cette agregation')),
                ('qa_modifications', models.IntegerField(default=0)),
                ('qa_incidents', models.IntegerField(default=0)),
                ('qa_check_done', models.BooleanField(default=False)),
                ('j',
                 app.models.DateJSONField(
                     encoder=django.core.serializers.json.DjangoJSONEncoder)),
            ],
            options={
                'db_table': 'agg_hour',
            },
        ),
        migrations.CreateModel(
            name='AggMonth',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('start_dat',
                 app.models.DateCharField(max_length=20,
                                          verbose_name='start date')),
                ('duration_sum',
                 models.IntegerField(
                     default=0,
                     verbose_name=
                     'Somme des durations des donnees de cette agregation')),
                ('duration_max',
                 models.IntegerField(
                     default=0,
                     verbose_name=
                     'Max des durations des donnees de cette agregation')),
                ('qa_modifications', models.IntegerField(default=0)),
                ('qa_incidents', models.IntegerField(default=0)),
                ('qa_check_done', models.BooleanField(default=False)),
                ('j',
                 app.models.DateJSONField(
                     encoder=django.core.serializers.json.DjangoJSONEncoder)),
            ],
            options={
                'db_table': 'agg_month',
            },
        ),
        migrations.CreateModel(
            name='AggTodo',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('priority',
                 models.IntegerField(
                     default=9,
                     null=True,
                     verbose_name=
                     'priority, 0: one current-data, 9: multiple current-data')
                 ),
                ('status',
                 models.IntegerField(
                     default=0,
                     verbose_name='status, 0: wait, 9: error, 99: processed')),
                ('j_dv',
                 app.models.DateJSONField(
                     default=dict,
                     encoder=django.core.serializers.json.DjangoJSONEncoder,
                     verbose_name='default_values coming from obs processing')
                 ),
                ('j_error',
                 app.models.DateJSONField(
                     default=dict,
                     encoder=django.core.serializers.json.DjangoJSONEncoder,
                     verbose_name='error reporting')),
            ],
            options={
                'db_table': 'agg_todo',
            },
        ),
        migrations.CreateModel(
            name='AggYear',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('start_dat',
                 app.models.DateCharField(max_length=20,
                                          verbose_name='start date')),
                ('duration_sum',
                 models.IntegerField(
                     default=0,
                     verbose_name=
                     'Somme des durations des donnees de cette agregation')),
                ('duration_max',
                 models.IntegerField(
                     default=0,
                     verbose_name=
                     'Max des durations des donnees de cette agregation')),
                ('qa_modifications', models.IntegerField(default=0)),
                ('qa_incidents', models.IntegerField(default=0)),
                ('qa_check_done', models.BooleanField(default=False)),
                ('j',
                 app.models.DateJSONField(
                     encoder=django.core.serializers.json.DjangoJSONEncoder)),
            ],
            options={
                'db_table': 'agg_year',
            },
        ),
        migrations.CreateModel(
            name='Exclusion',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('start_dat',
                 app.models.DateCharField(default='1900-01-01T00:00:00',
                                          max_length=20,
                                          verbose_name='start date')),
                ('stop_dat',
                 app.models.DateCharField(default='2100-12-31T23:59:59',
                                          max_length=20,
                                          verbose_name='stop date')),
                ('value',
                 app.models.DateJSONField(
                     default=dict,
                     encoder=django.core.serializers.json.DjangoJSONEncoder,
                     verbose_name='JsonB')),
            ],
            options={
                'db_table': 'exclusion',
            },
        ),
        migrations.CreateModel(
            name='ExtremeTodo',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('level',
                 models.CharField(max_length=2,
                                  verbose_name='Aggregation level')),
                ('start_dat',
                 app.models.DateCharField(
                     max_length=20,
                     verbose_name="start date de l agregation'")),
                ('invalid_type',
                 models.CharField(
                     max_length=3,
                     verbose_name='Type Invalidation (max or min)')),
                ('status',
                 models.IntegerField(
                     default=0,
                     verbose_name='status, 0: wait, 9: error, 99: processed')),
                ('j_invalid',
                 app.models.DateJSONField(
                     encoder=django.core.serializers.json.DjangoJSONEncoder)),
            ],
            options={
                'db_table': 'extreme_todo',
            },
        ),
        migrations.CreateModel(
            name='Observation',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('agg_start_dat',
                 app.models.DateCharField(
                     default='1900-01-01T00:00:00',
                     max_length=20,
                     verbose_name='date agregation horaire utilisée')),
                ('stop_dat',
                 app.models.DateCharField(
                     max_length=20,
                     verbose_name='stop date, date de la mesure')),
                ('duration',
                 models.IntegerField(default=0,
                                     verbose_name='duration in minutes')),
                ('qa_modifications',
                 models.IntegerField(default=0,
                                     verbose_name='qa_modifications')),
                ('qa_incidents',
                 models.IntegerField(default=0, verbose_name='qa_incidents')),
                ('qa_check_done',
                 models.BooleanField(default=False,
                                     verbose_name='qa_check_done')),
                ('j',
                 app.models.DateJSONField(
                     encoder=django.core.serializers.json.DjangoJSONEncoder)),
                ('j_agg',
                 app.models.DateJSONField(
                     encoder=django.core.serializers.json.DjangoJSONEncoder)),
            ],
            options={
                'db_table': 'obs',
            },
        ),
        migrations.CreateModel(
            name='Poste',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('meteor',
                 models.CharField(max_length=10,
                                  verbose_name='Code MeteoR.OI')),
                ('fuseau',
                 models.SmallIntegerField(
                     default=4,
                     null=True,
                     verbose_name=
                     'nombre heure entre TU et heure fuseau, default UTC+4')),
                ('meteofr',
                 models.CharField(default='',
                                  max_length=10,
                                  null=True,
                                  verbose_name='Code Meteo France')),
                ('lock_calculus',
                 models.SmallIntegerField(
                     default=0,
                     null=True,
                     verbose_name=
                     'internal field used to lock the calculus on one poste')),
                ('title',
                 models.CharField(default='',
                                  max_length=50,
                                  null=True,
                                  verbose_name='Nom clair de la station')),
                ('owner',
                 models.CharField(default='',
                                  max_length=50,
                                  null=True,
                                  verbose_name='Station Owner Name')),
                ('email',
                 models.CharField(default='',
                                  max_length=50,
                                  null=True,
                                  verbose_name='E-Mail')),
                ('phone',
                 models.CharField(default='',
                                  max_length=50,
                                  null=True,
                                  verbose_name='Phone')),
                ('address',
                 models.CharField(default='',
                                  max_length=50,
                                  null=True,
                                  verbose_name='Address')),
                ('zip',
                 models.CharField(default='',
                                  max_length=10,
                                  null=True,
                                  verbose_name='Zip')),
                ('city',
                 models.CharField(default='',
                                  max_length=50,
                                  null=True,
                                  verbose_name='City')),
                ('country',
                 models.CharField(default='',
                                  max_length=50,
                                  null=True,
                                  verbose_name='Country')),
                ('latitude',
                 models.FloatField(default=0,
                                   null=True,
                                   verbose_name='Latitude')),
                ('longitude',
                 models.FloatField(default=0,
                                   null=True,
                                   verbose_name='Longitude')),
                ('start_dat',
                 app.models.DateCharField(default='1900-01-01T00:00:00',
                                          max_length=20,
                                          null=True,
                                          verbose_name='start date')),
                ('stop_dat',
                 app.models.DateCharField(default='2100-12-31T23:59:59',
                                          max_length=20,
                                          null=True,
                                          verbose_name='stop date')),
                ('comment', models.TextField(default='', null=True)),
            ],
            options={
                'db_table': 'poste',
            },
        ),
        migrations.CreateModel(
            name='TmpAggAll',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('start_dat',
                 app.models.DateCharField(max_length=20,
                                          verbose_name='start date')),
                ('duration_sum',
                 models.IntegerField(
                     default=0,
                     verbose_name=
                     'Somme des durations des donnees de cette agregation')),
                ('duration_max',
                 models.IntegerField(
                     default=0,
                     verbose_name=
                     'Max des durations des donnees de cette agregation')),
                ('qa_modifications', models.IntegerField(default=0)),
                ('qa_incidents', models.IntegerField(default=0)),
                ('qa_check_done', models.BooleanField(default=False)),
                ('j',
                 app.models.DateJSONField(
                     encoder=django.core.serializers.json.DjangoJSONEncoder)),
            ],
            options={
                'db_table': 'tmp_agg_all',
            },
        ),
        migrations.CreateModel(
            name='TmpAggDay',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('start_dat',
                 app.models.DateCharField(max_length=20,
                                          verbose_name='start date')),
                ('duration_sum',
                 models.IntegerField(
                     default=0,
                     verbose_name=
                     'Somme des durations des donnees de cette agregation')),
                ('duration_max',
                 models.IntegerField(
                     default=0,
                     verbose_name=
                     'Max des durations des donnees de cette agregation')),
                ('qa_modifications', models.IntegerField(default=0)),
                ('qa_incidents', models.IntegerField(default=0)),
                ('qa_check_done', models.BooleanField(default=False)),
                ('j',
                 app.models.DateJSONField(
                     encoder=django.core.serializers.json.DjangoJSONEncoder)),
            ],
            options={
                'db_table': 'tmp_agg_day',
            },
        ),
        migrations.CreateModel(
            name='TmpAggHisto',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('obs_id',
                 models.IntegerField(
                     default=0,
                     verbose_name='Last obs which update this record')),
                ('agg_id',
                 models.IntegerField(
                     default=0,
                     verbose_name='Aggregation_id which update this record')),
                ('agg_level',
                 models.CharField(max_length=2,
                                  verbose_name='Aggregation level')),
                ('delta_duration',
                 models.IntegerField(
                     default=0,
                     verbose_name=
                     'Somme des durations des donnees de cette agregation')),
                ('j',
                 app.models.DateJSONField(
                     encoder=django.core.serializers.json.DjangoJSONEncoder)),
            ],
            options={
                'db_table': 'tmp_agg_histo',
            },
        ),
        migrations.CreateModel(
            name='TypeInstrument',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name',
                 models.CharField(max_length=10,
                                  verbose_name='Type de Donnees')),
                ('model_value',
                 app.models.DateJSONField(
                     default=dict,
                     encoder=django.core.serializers.json.DjangoJSONEncoder,
                     verbose_name='JsonB')),
            ],
            options={
                'db_table': 'type_instrument',
            },
        ),
        migrations.CreateModel(
            name='TmpObservation',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('agg_start_dat',
                 app.models.DateCharField(
                     default='1900-01-01T00:00:00',
                     max_length=20,
                     verbose_name='date agregation horaire utilisée')),
                ('stop_dat',
                 app.models.DateCharField(
                     max_length=20,
                     verbose_name='stop date, date de la mesure')),
                ('duration',
                 models.IntegerField(default=0,
                                     verbose_name='duration in minutes')),
                ('qa_modifications',
                 models.IntegerField(default=0,
                                     verbose_name='qa_modifications')),
                ('qa_incidents',
                 models.IntegerField(default=0, verbose_name='qa_incidents')),
                ('qa_check_done',
                 models.BooleanField(default=False,
                                     verbose_name='qa_check_done')),
                ('j',
                 app.models.DateJSONField(
                     encoder=django.core.serializers.json.DjangoJSONEncoder)),
                ('j_agg',
                 app.models.DateJSONField(
                     encoder=django.core.serializers.json.DjangoJSONEncoder)),
                ('poste',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='app.poste')),
            ],
            options={
                'db_table': 'tmp_obs',
            },
        ),
        migrations.CreateModel(
            name='TmpExtremeTodo',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('level',
                 models.CharField(max_length=2,
                                  verbose_name='Aggregation level')),
                ('start_dat',
                 app.models.DateCharField(
                     max_length=20,
                     verbose_name="start date de l agregation'")),
                ('invalid_type',
                 models.CharField(
                     max_length=3,
                     verbose_name='Type Invalidation (max or min)')),
                ('status',
                 models.IntegerField(
                     default=0,
                     verbose_name='status, 0: wait, 9: error, 99: processed')),
                ('j_invalid',
                 app.models.DateJSONField(
                     encoder=django.core.serializers.json.DjangoJSONEncoder)),
                ('poste',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='app.poste')),
            ],
            options={
                'db_table': 'tmp_extreme_todo',
            },
        ),
        migrations.CreateModel(
            name='TmpAggYear',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('start_dat',
                 app.models.DateCharField(max_length=20,
                                          verbose_name='start date')),
                ('duration_sum',
                 models.IntegerField(
                     default=0,
                     verbose_name=
                     'Somme des durations des donnees de cette agregation')),
                ('duration_max',
                 models.IntegerField(
                     default=0,
                     verbose_name=
                     'Max des durations des donnees de cette agregation')),
                ('qa_modifications', models.IntegerField(default=0)),
                ('qa_incidents', models.IntegerField(default=0)),
                ('qa_check_done', models.BooleanField(default=False)),
                ('j',
                 app.models.DateJSONField(
                     encoder=django.core.serializers.json.DjangoJSONEncoder)),
                ('poste',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='app.poste')),
            ],
            options={
                'db_table': 'tmp_agg_year',
            },
        ),
        migrations.CreateModel(
            name='TmpAggTodo',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('priority',
                 models.IntegerField(
                     default=9,
                     null=True,
                     verbose_name=
                     'priority, 0: one current-data, 9: multiple current-data')
                 ),
                ('status',
                 models.IntegerField(
                     default=0,
                     verbose_name='status, 0: wait, 9: error, 99: processed')),
                ('j_dv',
                 app.models.DateJSONField(
                     default=dict,
                     encoder=django.core.serializers.json.DjangoJSONEncoder,
                     verbose_name='default_values coming from obs processing')
                 ),
                ('j_error',
                 app.models.DateJSONField(
                     default=dict,
                     encoder=django.core.serializers.json.DjangoJSONEncoder,
                     verbose_name='error reporting')),
                ('obs',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='app.tmpobservation')),
            ],
            options={
                'db_table': 'tmp_agg_todo',
            },
        ),
        migrations.CreateModel(
            name='TmpAggMonth',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('start_dat',
                 app.models.DateCharField(max_length=20,
                                          verbose_name='start date')),
                ('duration_sum',
                 models.IntegerField(
                     default=0,
                     verbose_name=
                     'Somme des durations des donnees de cette agregation')),
                ('duration_max',
                 models.IntegerField(
                     default=0,
                     verbose_name=
                     'Max des durations des donnees de cette agregation')),
                ('qa_modifications', models.IntegerField(default=0)),
                ('qa_incidents', models.IntegerField(default=0)),
                ('qa_check_done', models.BooleanField(default=False)),
                ('j',
                 app.models.DateJSONField(
                     encoder=django.core.serializers.json.DjangoJSONEncoder)),
                ('poste',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='app.poste')),
            ],
            options={
                'db_table': 'tmp_agg_month',
            },
        ),
        migrations.CreateModel(
            name='TmpAggHour',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('start_dat',
                 app.models.DateCharField(max_length=20,
                                          verbose_name='start date')),
                ('duration_sum',
                 models.IntegerField(
                     default=0,
                     verbose_name=
                     'Somme des durations des donnees de cette agregation')),
                ('duration_max',
                 models.IntegerField(
                     default=0,
                     verbose_name=
                     'Max des durations des donnees de cette agregation')),
                ('qa_modifications', models.IntegerField(default=0)),
                ('qa_incidents', models.IntegerField(default=0)),
                ('qa_check_done', models.BooleanField(default=False)),
                ('j',
                 app.models.DateJSONField(
                     encoder=django.core.serializers.json.DjangoJSONEncoder)),
                ('poste',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='app.poste')),
            ],
            options={
                'db_table': 'tmp_agg_hour',
            },
        ),
        migrations.AddIndex(
            model_name='tmpagghisto',
            index=models.Index(fields=['agg_level', 'agg_id'],
                               name='tmp_agg_his_agg_lev_3dca1c_idx'),
        ),
        migrations.AddIndex(
            model_name='tmpagghisto',
            index=models.Index(fields=['obs_id', 'agg_level', 'agg_id'],
                               name='tmp_agg_his_obs_id_4ab179_idx'),
        ),
        migrations.AddField(
            model_name='tmpaggday',
            name='poste',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to='app.poste'),
        ),
        migrations.AddField(
            model_name='tmpaggall',
            name='poste',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to='app.poste'),
        ),
        migrations.AddField(
            model_name='observation',
            name='poste',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to='app.poste'),
        ),
        migrations.AddField(
            model_name='extremetodo',
            name='poste',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to='app.poste'),
        ),
        migrations.AddField(
            model_name='exclusion',
            name='poste',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to='app.poste'),
        ),
        migrations.AddField(
            model_name='exclusion',
            name='type_instrument',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='app.typeinstrument'),
        ),
        migrations.AddField(
            model_name='aggyear',
            name='poste',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to='app.poste'),
        ),
        migrations.AddField(
            model_name='aggtodo',
            name='obs',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='app.observation'),
        ),
        migrations.AddField(
            model_name='aggmonth',
            name='poste',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to='app.poste'),
        ),
        migrations.AddField(
            model_name='agghour',
            name='poste',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to='app.poste'),
        ),
        migrations.AddIndex(
            model_name='agghisto',
            index=models.Index(fields=['agg_level', 'agg_id'],
                               name='agg_histo_agg_lev_992eea_idx'),
        ),
        migrations.AddIndex(
            model_name='agghisto',
            index=models.Index(fields=['obs_id', 'agg_level', 'agg_id'],
                               name='agg_histo_obs_id_ef1b34_idx'),
        ),
        migrations.AddField(
            model_name='aggday',
            name='poste',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to='app.poste'),
        ),
        migrations.AddField(
            model_name='aggall',
            name='poste',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to='app.poste'),
        ),
        migrations.AlterUniqueTogether(
            name='tmpobservation',
            unique_together={('poste', 'stop_dat')},
        ),
        migrations.AlterUniqueTogether(
            name='tmpaggyear',
            unique_together={('poste', 'start_dat')},
        ),
        migrations.AlterUniqueTogether(
            name='tmpaggmonth',
            unique_together={('poste', 'start_dat')},
        ),
        migrations.AlterUniqueTogether(
            name='tmpagghour',
            unique_together={('poste', 'start_dat')},
        ),
        migrations.AlterUniqueTogether(
            name='tmpaggday',
            unique_together={('poste', 'start_dat')},
        ),
        migrations.AlterUniqueTogether(
            name='tmpaggall',
            unique_together={('poste', 'start_dat')},
        ),
        migrations.AlterUniqueTogether(
            name='observation',
            unique_together={('poste', 'stop_dat')},
        ),
        migrations.AlterUniqueTogether(
            name='aggyear',
            unique_together={('poste', 'start_dat')},
        ),
        migrations.AlterUniqueTogether(
            name='aggmonth',
            unique_together={('poste', 'start_dat')},
        ),
        migrations.AlterUniqueTogether(
            name='agghour',
            unique_together={('poste', 'start_dat')},
        ),
        migrations.AlterUniqueTogether(
            name='aggday',
            unique_together={('poste', 'start_dat')},
        ),
        migrations.AlterUniqueTogether(
            name='aggall',
            unique_together={('poste', 'start_dat')},
        ),
    ]
예제 #7
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('name',
                 models.CharField(default=None, max_length=100, unique=True)),
                ('rating', models.IntegerField(default=0)),
            ],
            options={
                'verbose_name': 'Тег',
                'verbose_name_plural': 'Теги',
            },
        ),
        migrations.CreateModel(
            name='Question',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('title', models.CharField(default=None, max_length=255)),
                ('text', models.TextField()),
                ('date', models.DateTimeField()),
                ('rating', models.IntegerField(default=0)),
                ('tags', models.ManyToManyField(default=None, to='app.Tag')),
                ('user',
                 models.ForeignKey(default=None,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='u_questions',
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Вопрос',
                'verbose_name_plural': 'Вопросы',
            },
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('photo',
                 models.ImageField(default='cat-smart.jpg',
                                   upload_to='avatars/')),
                ('rating', models.IntegerField(default=0)),
                ('user',
                 models.OneToOneField(
                     default=None,
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Профиль пользователя',
                'verbose_name_plural': 'Профили пользователей',
            },
        ),
        migrations.CreateModel(
            name='Answer',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('text', models.TextField()),
                ('is_correct', models.BooleanField(default=False)),
                ('date', models.DateTimeField()),
                ('rating', models.IntegerField(default=0)),
                ('question',
                 models.ForeignKey(default=None,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='app.question')),
                ('user',
                 models.ForeignKey(default=None,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='u_answers',
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Ответ',
                'verbose_name_plural': 'Ответы',
            },
        ),
        migrations.CreateModel(
            name='QuestionVote',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('vote',
                 models.IntegerField(choices=[(1, 'like'), (-1, 'dislike')],
                                     default=0)),
                ('question',
                 models.ForeignKey(default=None,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='vQuestions',
                                   to='app.question')),
                ('user',
                 models.ForeignKey(default=None,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='questionVotes',
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'unique_together': {('user', 'question')},
            },
            bases=(models.Model, app.models.VoteInterface),
        ),
        migrations.CreateModel(
            name='AnswerVote',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('vote',
                 models.IntegerField(choices=[(1, 'like'), (-1, 'dislike')],
                                     default=0)),
                ('answer',
                 models.ForeignKey(default=None,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='vAnswers',
                                   to='app.answer')),
                ('user',
                 models.ForeignKey(default=None,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='answerVotes',
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'unique_together': {('user', 'answer')},
            },
            bases=(models.Model, app.models.VoteInterface),
        ),
    ]