aboutsummaryrefslogtreecommitdiff
path: root/carer/mtwerk/migrations/0001_initial.py
blob: d5c856aabcf9a39da0f05e100ecb7a6b8039a3da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# Generated by Django 5.2.7 on 2025-10-28 22:06

import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Hit',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('amt_hit_id', models.CharField(max_length=30, unique=True)),
                ('amt_group_id', models.CharField(max_length=30)),
                ('status', models.SmallIntegerField()),
                ('review_status', models.SmallIntegerField()),
                ('creation_time', models.DateTimeField()),
                ('expiration', models.DateTimeField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('modified_at', models.DateTimeField(auto_now=True)),
                ('max_assignments', models.IntegerField(default=1)),
                ('assignment_pending_count', models.IntegerField(default=0)),
                ('assignment_available_count', models.IntegerField(default=0)),
                ('assignment_completed_count', models.IntegerField(default=0)),
            ],
            options={
                'db_table': 'mtwerk_hit',
            },
        ),
        migrations.CreateModel(
            name='Assignment',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('amt_assignment_id', models.CharField(max_length=30, unique=True)),
                ('amt_worker_id', models.CharField(max_length=30)),
                ('status', models.SmallIntegerField()),
                ('auto_approval_time', models.DateTimeField(null=True)),
                ('accept_time', models.DateTimeField(null=True)),
                ('submit_time', models.DateTimeField(null=True)),
                ('approval_time', models.DateTimeField(null=True)),
                ('rejection_time', models.DateTimeField(null=True)),
                ('requester_feedback', models.CharField(max_length=1024, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('modified_at', models.DateTimeField(auto_now=True)),
                ('tsid', models.UUIDField(null=True)),
                ('hit', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='mtwerk.hit')),
            ],
            options={
                'db_table': 'mtwerk_assignment',
            },
        ),
        migrations.CreateModel(
            name='HitType',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('amt_hit_type_id', models.CharField(max_length=30, unique=True)),
                ('title', models.CharField(max_length=200)),
                ('description', models.CharField(max_length=2000)),
                ('reward', models.DecimalField(decimal_places=2, max_digits=8)),
                ('assignment_duration', models.PositiveIntegerField()),
                ('auto_approval_delay', models.PositiveIntegerField()),
                ('keywords', models.CharField(max_length=256)),
                ('min_active', models.IntegerField(default=0)),
            ],
            options={
                'db_table': 'mtwerk_hittype',
                'indexes': [models.Index(fields=['amt_hit_type_id'], name='mtwerk_hitt_amt_hit_05dd10_idx'), models.Index(fields=['min_active'], name='mtwerk_hitt_min_act_e18222_idx')],
            },
        ),
        migrations.AddField(
            model_name='hit',
            name='hit_type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='mtwerk.hittype'),
        ),
        migrations.CreateModel(
            name='Question',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('url', models.URLField()),
                ('height', models.IntegerField(default=1200)),
            ],
            options={
                'db_table': 'mtwerk_question',
                'unique_together': {('url', 'height')},
            },
        ),
        migrations.AddField(
            model_name='hit',
            name='question',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='mtwerk.question'),
        ),
        migrations.CreateModel(
            name='Bonus',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('payout_event_id', models.UUIDField(unique=True)),
                ('amt_worker_id', models.CharField(max_length=30, null=True)),
                ('amount', models.DecimalField(decimal_places=2, max_digits=10)),
                ('grant_time', models.DateTimeField()),
                ('reason', models.CharField(max_length=1024)),
                ('assignment', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='mtwerk.assignment')),
            ],
            options={
                'indexes': [models.Index(fields=['amt_worker_id'], name='mtwerk_bonu_amt_wor_77d514_idx'), models.Index(fields=['grant_time'], name='mtwerk_bonu_grant_t_d43c6c_idx')],
            },
        ),
        migrations.AddIndex(
            model_name='assignment',
            index=models.Index(fields=['amt_worker_id'], name='mtwerk_assi_amt_wor_7dbe42_idx'),
        ),
        migrations.AddIndex(
            model_name='assignment',
            index=models.Index(fields=['status'], name='mtwerk_assi_status_4e01de_idx'),
        ),
        migrations.AddIndex(
            model_name='assignment',
            index=models.Index(fields=['submit_time'], name='mtwerk_assi_submit__429d3e_idx'),
        ),
        migrations.AddIndex(
            model_name='assignment',
            index=models.Index(fields=['created_at'], name='mtwerk_assi_created_9292fa_idx'),
        ),
        migrations.AddIndex(
            model_name='assignment',
            index=models.Index(fields=['modified_at'], name='mtwerk_assi_modifie_44f1d0_idx'),
        ),
        migrations.AddIndex(
            model_name='assignment',
            index=models.Index(fields=['tsid'], name='mtwerk_assi_tsid_bd796d_idx'),
        ),
        migrations.AddIndex(
            model_name='hit',
            index=models.Index(fields=['status'], name='mtwerk_hit_status_ae726f_idx'),
        ),
        migrations.AddIndex(
            model_name='hit',
            index=models.Index(fields=['review_status'], name='mtwerk_hit_review__a9f420_idx'),
        ),
        migrations.AddIndex(
            model_name='hit',
            index=models.Index(fields=['creation_time'], name='mtwerk_hit_creatio_48e0fd_idx'),
        ),
        migrations.AddIndex(
            model_name='hit',
            index=models.Index(fields=['created_at'], name='mtwerk_hit_created_f1614b_idx'),
        ),
        migrations.AddIndex(
            model_name='hit',
            index=models.Index(fields=['modified_at'], name='mtwerk_hit_modifie_45c2ed_idx'),
        ),
    ]