diff --git a/app/dashboard/migrations/0041_auto_20190718_1222.py b/app/dashboard/migrations/0041_auto_20190718_1222.py new file mode 100644 index 00000000000..bb1ae1bf303 --- /dev/null +++ b/app/dashboard/migrations/0041_auto_20190718_1222.py @@ -0,0 +1,57 @@ +# Generated by Django 2.1.7 on 2019-07-18 12:22 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('dashboard', '0040_profile_profile_wallpaper'), + ] + + operations = [ + migrations.AlterField( + model_name='bounty', + name='attached_job_description', + field=models.URLField(blank=True, db_index=True, null=True), + ), + migrations.AlterField( + model_name='bounty', + name='bounty_owner_github_username', + field=models.CharField(blank=True, db_index=True, max_length=255), + ), + migrations.AlterField( + model_name='bounty', + name='bounty_type', + field=models.CharField(blank=True, choices=[('Bug', 'Bug'), ('Security', 'Security'), ('Feature', 'Feature'), ('Unknown', 'Unknown')], db_index=True, max_length=50), + ), + migrations.AlterField( + model_name='bounty', + name='current_bounty', + field=models.BooleanField(db_index=True, default=False, help_text='Whether this bounty is the most current revision one or not'), + ), + migrations.AlterField( + model_name='bounty', + name='experience_level', + field=models.CharField(blank=True, choices=[('Beginner', 'Beginner'), ('Intermediate', 'Intermediate'), ('Advanced', 'Advanced'), ('Unknown', 'Unknown')], db_index=True, max_length=50), + ), + migrations.AlterField( + model_name='bounty', + name='featuring_date', + field=models.DateTimeField(blank=True, db_index=True, null=True), + ), + migrations.AlterField( + model_name='bounty', + name='permission_type', + field=models.CharField(choices=[('permissionless', 'permissionless'), ('approval', 'approval')], db_index=True, default='permissionless', max_length=50), + ), + migrations.AlterField( + model_name='bounty', + name='project_type', + field=models.CharField(choices=[('traditional', 'traditional'), ('contest', 'contest'), ('cooperative', 'cooperative')], db_index=True, default='traditional', max_length=50), + ), + migrations.AlterIndexTogether( + name='bounty', + index_together={('project_length', 'is_featured', 'admin_override_and_hide', 'network', 'idx_status'), ('project_length', 'current_bounty', 'network'), ('bounty_owner_github_username', 'is_featured', 'current_bounty', 'network', 'idx_status'), ('event', 'project_length', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status'), ('project_length', 'is_featured', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'web3_created'), ('event', 'bounty_owner_github_username', 'project_length', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('event', 'project_length', 'is_featured', 'experience_level', 'current_bounty', 'network', 'web3_created'), ('is_featured', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('bounty_owner_github_username', 'experience_level', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('project_length', 'is_featured', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status'), ('project_length', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('bounty_owner_github_username', 'is_featured', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'web3_created'), ('project_length', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status'), ('bounty_owner_github_username', 'project_length', 'experience_level', 'network', 'idx_status'), ('event', 'bounty_owner_github_username', 'project_length', 'is_featured', 'experience_level', 'admin_override_and_hide', 'network', 'idx_status'), ('bounty_owner_github_username', 'project_length', 'is_featured', 'experience_level', 'admin_override_and_hide', 'network', 'idx_status'), ('event', 'bounty_owner_github_username', 'project_length', 'experience_level', 'network', 'idx_status'), ('event', 'is_featured', 'current_bounty', 'network', 'web3_created'), ('event', 'bounty_owner_github_username', 'project_length', 'is_featured', 'network', 'idx_status'), ('event', 'bounty_owner_github_username', 'is_featured', 'experience_level', 'current_bounty', 'network', 'idx_status'), ('event', 'is_featured', 'network', 'idx_status'), ('event', 'bounty_owner_github_username', 'project_length', 'is_featured', 'experience_level', 'network', 'idx_status'), ('bounty_owner_github_username', 'admin_override_and_hide', 'current_bounty', 'network', 'web3_created'), ('event', 'project_length', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network'), ('event', 'bounty_owner_github_username', 'is_featured', 'experience_level', 'current_bounty', 'network'), ('event', 'is_featured', 'current_bounty', 'network'), ('event', 'bounty_owner_github_username', 'project_length', 'is_featured', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status'), ('bounty_owner_github_username', 'project_length', 'experience_level', 'current_bounty', 'network'), ('project_length', 'experience_level', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('bounty_owner_github_username', 'experience_level', 'current_bounty', 'network', 'web3_created'), ('event', 'bounty_owner_github_username', 'project_length', 'is_featured', 'admin_override_and_hide', 'network', 'idx_status'), ('event', 'project_length', 'experience_level', 'network', 'idx_status'), ('event', 'bounty_owner_github_username', 'is_featured', 'network', 'idx_status'), ('bounty_owner_github_username', 'is_featured', 'admin_override_and_hide', 'current_bounty', 'network', 'web3_created'), ('event', 'is_featured', 'experience_level', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('bounty_owner_github_username', 'current_bounty', 'network'), ('event', 'network', 'idx_status'), ('project_length', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('event', 'is_featured', 'experience_level', 'current_bounty', 'network'), ('event', 'bounty_owner_github_username', 'is_featured', 'experience_level', 'current_bounty', 'network', 'web3_created'), ('event', 'admin_override_and_hide', 'network', 'idx_status'), ('bounty_owner_github_username', 'project_length', 'is_featured', 'experience_level', 'current_bounty', 'network', 'web3_created'), ('is_featured', 'admin_override_and_hide', 'current_bounty', 'network'), ('bounty_owner_github_username', 'experience_level', 'admin_override_and_hide', 'network', 'idx_status'), ('bounty_owner_github_username', 'project_length', 'is_featured', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('event', 'bounty_owner_github_username', 'project_length', 'current_bounty', 'network'), ('project_length', 'is_featured', 'current_bounty', 'network', 'idx_status'), ('event', 'bounty_owner_github_username', 'project_length', 'is_featured', 'current_bounty', 'network', 'idx_status'), ('project_length', 'experience_level', 'current_bounty', 'network'), ('event', 'experience_level', 'network', 'idx_status'), ('event', 'project_length', 'is_featured', 'current_bounty', 'network', 'web3_created'), ('event', 'project_length', 'is_featured', 'experience_level', 'admin_override_and_hide', 'network', 'idx_status'), ('event', 'project_length', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status'), ('bounty_owner_github_username', 'project_length', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('bounty_owner_github_username', 'is_featured', 'experience_level', 'network', 'idx_status'), ('event', 'is_featured', 'admin_override_and_hide', 'network', 'idx_status'), ('bounty_owner_github_username', 'project_length', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'web3_created'), ('event', 'bounty_owner_github_username', 'is_featured', 'current_bounty', 'network'), ('event', 'project_length', 'is_featured', 'current_bounty', 'network'), ('is_featured', 'current_bounty', 'network', 'web3_created'), ('experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'web3_created'), ('event', 'bounty_owner_github_username', 'project_length', 'experience_level', 'current_bounty', 'network', 'idx_status'), ('event', 'project_length', 'is_featured', 'admin_override_and_hide', 'current_bounty', 'network', 'web3_created'), ('current_bounty', 'network', 'idx_status', 'web3_created'), ('is_featured', 'current_bounty', 'network', 'idx_status'), ('bounty_owner_github_username', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('event', 'project_length', 'is_featured', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network'), ('event', 'bounty_owner_github_username', 'project_length', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('project_length', 'experience_level', 'current_bounty', 'network', 'web3_created'), ('is_featured', 'experience_level', 'current_bounty', 'network'), ('event', 'bounty_owner_github_username', 'project_length', 'is_featured', 'current_bounty', 'network'), ('bounty_owner_github_username', 'is_featured', 'experience_level', 'current_bounty', 'network', 'idx_status'), ('event', 'project_length', 'is_featured', 'current_bounty', 'network', 'idx_status'), ('bounty_owner_github_username', 'network', 'idx_status'), ('is_featured', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'web3_created'), ('event', 'is_featured', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('bounty_owner_github_username', 'is_featured', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status'), ('project_length', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network'), ('event', 'bounty_owner_github_username', 'project_length', 'admin_override_and_hide', 'current_bounty', 'network', 'web3_created'), ('event', 'bounty_owner_github_username', 'is_featured', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('bounty_owner_github_username', 'is_featured', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network'), ('event', 'bounty_owner_github_username', 'is_featured', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status'), ('event', 'project_length', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'web3_created'), ('bounty_owner_github_username', 'project_length', 'is_featured', 'admin_override_and_hide', 'network', 'idx_status'), ('bounty_owner_github_username', 'is_featured', 'current_bounty', 'network', 'web3_created'), ('experience_level', 'admin_override_and_hide', 'network', 'idx_status'), ('bounty_owner_github_username', 'project_length', 'network', 'idx_status'), ('event', 'project_length', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('network', 'idx_status'), ('bounty_owner_github_username', 'current_bounty', 'network', 'web3_created'), ('event', 'bounty_owner_github_username', 'project_length', 'current_bounty', 'network', 'web3_created'), ('bounty_owner_github_username', 'admin_override_and_hide', 'current_bounty', 'network'), ('experience_level', 'current_bounty', 'network'), ('bounty_owner_github_username', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('event', 'project_length', 'network', 'idx_status'), ('event', 'project_length', 'admin_override_and_hide', 'current_bounty', 'network', 'web3_created'), ('project_length', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('bounty_owner_github_username', 'project_length', 'is_featured', 'current_bounty', 'network'), ('event', 'bounty_owner_github_username', 'project_length', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status'), ('bounty_owner_github_username', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'web3_created'), ('event', 'is_featured', 'experience_level', 'current_bounty', 'network', 'idx_status'), ('bounty_owner_github_username', 'project_length', 'experience_level', 'admin_override_and_hide', 'network', 'idx_status'), ('project_length', 'is_featured', 'experience_level', 'network', 'idx_status'), ('project_length', 'is_featured', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('event', 'bounty_owner_github_username', 'admin_override_and_hide', 'network', 'idx_status'), ('project_length', 'admin_override_and_hide', 'network', 'idx_status'), ('bounty_owner_github_username', 'project_length', 'is_featured', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status'), ('event', 'project_length', 'admin_override_and_hide', 'current_bounty', 'network'), ('event', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status'), ('project_length', 'network', 'idx_status'), ('bounty_owner_github_username', 'is_featured', 'network', 'idx_status'), ('is_featured', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status'), ('bounty_owner_github_username', 'experience_level', 'network', 'idx_status'), ('experience_level', 'network', 'idx_status'), ('bounty_owner_github_username', 'project_length', 'current_bounty', 'network', 'web3_created'), ('event', 'bounty_owner_github_username', 'project_length', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('event', 'project_length', 'current_bounty', 'network', 'idx_status'), ('event', 'bounty_owner_github_username', 'project_length', 'is_featured', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network'), ('current_bounty', 'network', 'idx_status'), ('event', 'bounty_owner_github_username', 'project_length', 'current_bounty', 'network', 'idx_status'), ('bounty_owner_github_username', 'is_featured', 'experience_level', 'current_bounty', 'network', 'web3_created'), ('event', 'is_featured', 'experience_level', 'admin_override_and_hide', 'network', 'idx_status'), ('event', 'bounty_owner_github_username', 'current_bounty', 'network'), ('event', 'bounty_owner_github_username', 'project_length', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'web3_created'), ('admin_override_and_hide', 'network', 'idx_status'), ('event', 'project_length', 'is_featured', 'admin_override_and_hide', 'network', 'idx_status'), ('event', 'admin_override_and_hide', 'current_bounty', 'network'), ('admin_override_and_hide', 'current_bounty', 'network', 'idx_status'), ('event', 'bounty_owner_github_username', 'project_length', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status'), ('is_featured', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('event', 'bounty_owner_github_username', 'project_length', 'is_featured', 'admin_override_and_hide', 'current_bounty', 'network', 'web3_created'), ('event', 'is_featured', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('bounty_owner_github_username', 'project_length', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status'), ('event', 'bounty_owner_github_username', 'project_length', 'is_featured', 'experience_level', 'current_bounty', 'network', 'web3_created'), ('project_length', 'admin_override_and_hide', 'current_bounty', 'network', 'web3_created'), ('bounty_owner_github_username', 'is_featured', 'admin_override_and_hide', 'network', 'idx_status'), ('bounty_owner_github_username', 'project_length', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('event', 'bounty_owner_github_username', 'project_length', 'is_featured', 'experience_level', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('event', 'bounty_owner_github_username', 'is_featured', 'admin_override_and_hide', 'current_bounty', 'network'), ('event', 'current_bounty', 'network', 'idx_status'), ('project_length', 'is_featured', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('bounty_owner_github_username', 'project_length', 'current_bounty', 'network'), ('event', 'bounty_owner_github_username', 'project_length', 'is_featured', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status'), ('event', 'bounty_owner_github_username', 'project_length', 'experience_level', 'admin_override_and_hide', 'network', 'idx_status'), ('event', 'project_length', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('event', 'bounty_owner_github_username', 'admin_override_and_hide', 'current_bounty', 'network', 'web3_created'), ('event', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network'), ('event', 'bounty_owner_github_username', 'current_bounty', 'network', 'idx_status'), ('event', 'experience_level', 'current_bounty', 'network'), ('bounty_owner_github_username', 'project_length', 'is_featured', 'admin_override_and_hide', 'current_bounty', 'network'), ('event', 'bounty_owner_github_username', 'is_featured', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network'), ('project_length', 'is_featured', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network'), ('event', 'is_featured', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status'), ('bounty_owner_github_username', 'is_featured', 'experience_level', 'admin_override_and_hide', 'network', 'idx_status'), ('bounty_owner_github_username', 'project_length', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network'), ('event', 'bounty_owner_github_username', 'current_bounty', 'network', 'web3_created'), ('event', 'bounty_owner_github_username', 'project_length', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network'), ('bounty_owner_github_username', 'project_length', 'is_featured', 'experience_level', 'current_bounty', 'network'), ('bounty_owner_github_username', 'project_length', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status'), ('bounty_owner_github_username', 'project_length', 'experience_level', 'current_bounty', 'network', 'web3_created'), ('event', 'bounty_owner_github_username', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network'), ('admin_override_and_hide', 'current_bounty', 'network'), ('bounty_owner_github_username', 'project_length', 'is_featured', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status'), ('bounty_owner_github_username', 'is_featured', 'current_bounty', 'network'), ('bounty_owner_github_username', 'is_featured', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status'), ('event', 'is_featured', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status'), ('bounty_owner_github_username', 'project_length', 'experience_level', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('bounty_owner_github_username', 'project_length', 'admin_override_and_hide', 'current_bounty', 'network', 'web3_created'), ('experience_level', 'current_bounty', 'network', 'idx_status'), ('event', 'project_length', 'is_featured', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status'), ('event', 'bounty_owner_github_username', 'is_featured', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'web3_created'), ('event', 'project_length', 'is_featured', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('event', 'bounty_owner_github_username', 'is_featured', 'current_bounty', 'network', 'idx_status'), ('bounty_owner_github_username', 'project_length', 'is_featured', 'experience_level', 'current_bounty', 'network', 'idx_status'), ('event', 'project_length', 'is_featured', 'admin_override_and_hide', 'current_bounty', 'network'), ('event', 'experience_level', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('is_featured', 'experience_level', 'current_bounty', 'network', 'idx_status'), ('event', 'project_length', 'experience_level', 'admin_override_and_hide', 'network', 'idx_status'), ('bounty_owner_github_username', 'is_featured', 'experience_level', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('event', 'bounty_owner_github_username', 'is_featured', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status'), ('event', 'bounty_owner_github_username', 'is_featured', 'experience_level', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('event', 'project_length', 'is_featured', 'experience_level', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('bounty_owner_github_username', 'is_featured', 'experience_level', 'current_bounty', 'network'), ('bounty_owner_github_username', 'project_length', 'is_featured', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('experience_level', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('event', 'bounty_owner_github_username', 'project_length', 'experience_level', 'current_bounty', 'network'), ('bounty_owner_github_username', 'project_length', 'is_featured', 'current_bounty', 'network', 'web3_created'), ('event', 'bounty_owner_github_username', 'experience_level', 'current_bounty', 'network', 'idx_status'), ('experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('bounty_owner_github_username', 'project_length', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('event', 'current_bounty', 'network', 'web3_created'), ('event', 'experience_level', 'admin_override_and_hide', 'network', 'idx_status'), ('event', 'bounty_owner_github_username', 'experience_level', 'current_bounty', 'network'), ('event', 'project_length', 'experience_level', 'current_bounty', 'network'), ('is_featured', 'experience_level', 'current_bounty', 'network', 'web3_created'), ('project_length', 'is_featured', 'experience_level', 'admin_override_and_hide', 'network', 'idx_status'), ('event', 'project_length', 'is_featured', 'experience_level', 'current_bounty', 'network', 'idx_status'), ('event', 'project_length', 'current_bounty', 'network', 'web3_created'), ('event', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status'), ('event', 'bounty_owner_github_username', 'project_length', 'experience_level', 'current_bounty', 'network', 'web3_created'), ('event', 'bounty_owner_github_username', 'project_length', 'admin_override_and_hide', 'network', 'idx_status'), ('project_length', 'experience_level', 'admin_override_and_hide', 'network', 'idx_status'), ('event', 'bounty_owner_github_username', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'web3_created'), ('event', 'bounty_owner_github_username', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('is_featured', 'admin_override_and_hide', 'current_bounty', 'network', 'web3_created'), ('event', 'bounty_owner_github_username', 'is_featured', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('event', 'bounty_owner_github_username', 'is_featured', 'experience_level', 'network', 'idx_status'), ('event', 'project_length', 'is_featured', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('event', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('event', 'bounty_owner_github_username', 'is_featured', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('event', 'admin_override_and_hide', 'current_bounty', 'network', 'web3_created'), ('project_length', 'is_featured', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status'), ('project_length', 'is_featured', 'current_bounty', 'network'), ('bounty_owner_github_username', 'is_featured', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('event', 'bounty_owner_github_username', 'project_length', 'network', 'idx_status'), ('project_length', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'web3_created'), ('event', 'project_length', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('event', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'web3_created'), ('event', 'project_length', 'current_bounty', 'network'), ('event', 'is_featured', 'admin_override_and_hide', 'current_bounty', 'network'), ('current_bounty', 'network'), ('admin_override_and_hide', 'current_bounty', 'network', 'web3_created'), ('is_featured', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('event', 'project_length', 'is_featured', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status'), ('bounty_owner_github_username', 'project_length', 'is_featured', 'admin_override_and_hide', 'current_bounty', 'network', 'web3_created'), ('bounty_owner_github_username', 'project_length', 'is_featured', 'current_bounty', 'network', 'idx_status'), ('event', 'bounty_owner_github_username', 'project_length', 'is_featured', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'web3_created'), ('event', 'is_featured', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network'), ('bounty_owner_github_username', 'current_bounty', 'network', 'idx_status'), ('current_bounty', 'network', 'web3_created'), ('event', 'bounty_owner_github_username', 'experience_level', 'current_bounty', 'network', 'web3_created'), ('is_featured', 'admin_override_and_hide', 'network', 'idx_status'), ('bounty_owner_github_username', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network'), ('event', 'bounty_owner_github_username', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('event', 'bounty_owner_github_username', 'project_length', 'admin_override_and_hide', 'current_bounty', 'network'), ('event', 'bounty_owner_github_username', 'project_length', 'is_featured', 'experience_level', 'current_bounty', 'network'), ('is_featured', 'experience_level', 'admin_override_and_hide', 'network', 'idx_status'), ('project_length', 'is_featured', 'network', 'idx_status'), ('event', 'is_featured', 'current_bounty', 'network', 'idx_status'), ('event', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('event', 'project_length', 'is_featured', 'network', 'idx_status'), ('project_length', 'is_featured', 'experience_level', 'current_bounty', 'network'), ('event', 'project_length', 'experience_level', 'current_bounty', 'network', 'web3_created'), ('bounty_owner_github_username', 'project_length', 'current_bounty', 'network', 'idx_status'), ('project_length', 'admin_override_and_hide', 'current_bounty', 'network'), ('project_length', 'is_featured', 'admin_override_and_hide', 'current_bounty', 'network', 'web3_created'), ('bounty_owner_github_username', 'project_length', 'admin_override_and_hide', 'network', 'idx_status'), ('event', 'current_bounty', 'network'), ('bounty_owner_github_username', 'project_length', 'is_featured', 'experience_level', 'network', 'idx_status'), ('event', 'bounty_owner_github_username', 'experience_level', 'admin_override_and_hide', 'network', 'idx_status'), ('project_length', 'is_featured', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('event', 'is_featured', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('bounty_owner_github_username', 'experience_level', 'current_bounty', 'network', 'idx_status'), ('bounty_owner_github_username', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status'), ('event', 'bounty_owner_github_username', 'experience_level', 'network', 'idx_status'), ('bounty_owner_github_username', 'project_length', 'is_featured', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'web3_created'), ('project_length', 'is_featured', 'experience_level', 'current_bounty', 'network', 'idx_status'), ('event', 'project_length', 'experience_level', 'current_bounty', 'network', 'idx_status'), ('event', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('event', 'project_length', 'admin_override_and_hide', 'network', 'idx_status'), ('event', 'bounty_owner_github_username', 'is_featured', 'experience_level', 'admin_override_and_hide', 'network', 'idx_status'), ('project_length', 'experience_level', 'current_bounty', 'network', 'idx_status'), ('project_length', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status'), ('event', 'bounty_owner_github_username', 'is_featured', 'admin_override_and_hide', 'current_bounty', 'network', 'web3_created'), ('is_featured', 'experience_level', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('event', 'project_length', 'is_featured', 'experience_level', 'network', 'idx_status'), ('project_length', 'experience_level', 'network', 'idx_status'), ('event', 'bounty_owner_github_username', 'network', 'idx_status'), ('event', 'bounty_owner_github_username', 'project_length', 'is_featured', 'experience_level', 'current_bounty', 'network', 'idx_status'), ('bounty_owner_github_username', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status'), ('event', 'is_featured', 'experience_level', 'current_bounty', 'network', 'web3_created'), ('event', 'bounty_owner_github_username', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status'), ('event', 'bounty_owner_github_username', 'is_featured', 'admin_override_and_hide', 'network', 'idx_status'), ('event', 'bounty_owner_github_username', 'project_length', 'is_featured', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('project_length', 'is_featured', 'experience_level', 'current_bounty', 'network', 'web3_created'), ('event', 'is_featured', 'admin_override_and_hide', 'current_bounty', 'network', 'web3_created'), ('bounty_owner_github_username', 'project_length', 'admin_override_and_hide', 'current_bounty', 'network'), ('bounty_owner_github_username', 'project_length', 'is_featured', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network'), ('is_featured', 'network', 'idx_status'), ('bounty_owner_github_username', 'is_featured', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('experience_level', 'admin_override_and_hide', 'current_bounty', 'network'), ('is_featured', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status'), ('bounty_owner_github_username', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status'), ('event', 'bounty_owner_github_username', 'project_length', 'is_featured', 'current_bounty', 'network', 'web3_created'), ('event', 'project_length', 'is_featured', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('event', 'project_length', 'experience_level', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('bounty_owner_github_username', 'project_length', 'is_featured', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('bounty_owner_github_username', 'is_featured', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('bounty_owner_github_username', 'is_featured', 'admin_override_and_hide', 'current_bounty', 'network'), ('project_length', 'is_featured', 'current_bounty', 'network', 'web3_created'), ('event', 'bounty_owner_github_username', 'admin_override_and_hide', 'current_bounty', 'network'), ('event', 'experience_level', 'current_bounty', 'network', 'web3_created'), ('event', 'bounty_owner_github_username', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('event', 'bounty_owner_github_username', 'project_length', 'is_featured', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('is_featured', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network'), ('project_length', 'is_featured', 'experience_level', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('bounty_owner_github_username', 'experience_level', 'current_bounty', 'network'), ('event', 'project_length', 'is_featured', 'experience_level', 'current_bounty', 'network'), ('event', 'bounty_owner_github_username', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status'), ('bounty_owner_github_username', 'project_length', 'is_featured', 'network', 'idx_status'), ('event', 'is_featured', 'experience_level', 'network', 'idx_status'), ('event', 'experience_level', 'current_bounty', 'network', 'idx_status'), ('event', 'bounty_owner_github_username', 'is_featured', 'current_bounty', 'network', 'web3_created'), ('bounty_owner_github_username', 'project_length', 'experience_level', 'current_bounty', 'network', 'idx_status'), ('event', 'bounty_owner_github_username', 'project_length', 'experience_level', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('bounty_owner_github_username', 'project_length', 'is_featured', 'experience_level', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('is_featured', 'experience_level', 'network', 'idx_status'), ('project_length', 'current_bounty', 'network', 'idx_status'), ('admin_override_and_hide', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('event', 'is_featured', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'web3_created'), ('project_length', 'current_bounty', 'network', 'web3_created'), ('event', 'project_length', 'is_featured', 'experience_level', 'admin_override_and_hide', 'current_bounty', 'network', 'web3_created'), ('is_featured', 'current_bounty', 'network'), ('project_length', 'is_featured', 'admin_override_and_hide', 'current_bounty', 'network'), ('event', 'bounty_owner_github_username', 'project_length', 'is_featured', 'admin_override_and_hide', 'current_bounty', 'network'), ('experience_level', 'current_bounty', 'network', 'web3_created'), ('event', 'bounty_owner_github_username', 'project_length', 'is_featured', 'admin_override_and_hide', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('event', 'bounty_owner_github_username', 'experience_level', 'current_bounty', 'network', 'idx_status', 'web3_created'), ('bounty_owner_github_username', 'admin_override_and_hide', 'network', 'idx_status')}, + ), + ] diff --git a/app/dashboard/models.py b/app/dashboard/models.py index c3d183058c1..6d76d6e28af 100644 --- a/app/dashboard/models.py +++ b/app/dashboard/models.py @@ -160,6 +160,23 @@ def has_funds(self): return self.filter(idx_status__in=Bounty.FUNDED_STATUSES) +"""Fields that bonties table should index together.""" +def get_bounty_index_together(): + import copy + index_together = [ + ["network", "idx_status"], + ["current_bounty", "network"], + ["current_bounty", "network", "idx_status"], + ["current_bounty", "network", "web3_created"], + ["current_bounty", "network", "idx_status", "web3_created"], + ] + additions = ['admin_override_and_hide', 'experience_level', 'is_featured', 'project_length', 'bounty_owner_github_username', 'event'] + for addition in additions: + for ele in copy.copy(index_together): + index_together.append([addition] + ele) + return index_together + + class Bounty(SuperModel): """Define the structure of a Bounty. @@ -236,16 +253,16 @@ class Bounty(SuperModel): value_in_token = models.DecimalField(default=1, decimal_places=2, max_digits=50) token_name = models.CharField(max_length=50) token_address = models.CharField(max_length=50) - bounty_type = models.CharField(max_length=50, choices=BOUNTY_TYPES, blank=True) + bounty_type = models.CharField(max_length=50, choices=BOUNTY_TYPES, blank=True, db_index=True) project_length = models.CharField(max_length=50, choices=PROJECT_LENGTHS, blank=True) estimated_hours = models.PositiveIntegerField(blank=True, null=True) - experience_level = models.CharField(max_length=50, choices=EXPERIENCE_LEVELS, blank=True) + experience_level = models.CharField(max_length=50, choices=EXPERIENCE_LEVELS, blank=True, db_index=True) github_url = models.URLField(db_index=True) github_issue_details = JSONField(default=dict, blank=True, null=True) github_comments = models.IntegerField(default=0) bounty_owner_address = models.CharField(max_length=50) bounty_owner_email = models.CharField(max_length=255, blank=True) - bounty_owner_github_username = models.CharField(max_length=255, blank=True) + bounty_owner_github_username = models.CharField(max_length=255, blank=True, db_index=True) bounty_owner_name = models.CharField(max_length=255, blank=True) bounty_owner_profile = models.ForeignKey( 'dashboard.Profile', null=True, on_delete=models.SET_NULL, related_name='bounties_funded', blank=True @@ -258,7 +275,7 @@ class Bounty(SuperModel): raw_data = JSONField() metadata = JSONField(default=dict, blank=True) current_bounty = models.BooleanField( - default=False, help_text=_('Whether this bounty is the most current revision one or not')) + default=False, help_text=_('Whether this bounty is the most current revision one or not'), db_index=True) _val_usd_db = models.DecimalField(default=0, decimal_places=2, max_digits=50) contract_address = models.CharField(max_length=50, default='') network = models.CharField(max_length=255, blank=True, db_index=True) @@ -282,14 +299,14 @@ class Bounty(SuperModel): fulfillment_started_on = models.DateTimeField(null=True, blank=True) canceled_on = models.DateTimeField(null=True, blank=True) canceled_bounty_reason = models.TextField(default='', blank=True, verbose_name=_('Cancelation reason')) - project_type = models.CharField(max_length=50, choices=PROJECT_TYPES, default='traditional') + project_type = models.CharField(max_length=50, choices=PROJECT_TYPES, default='traditional', db_index=True) + permission_type = models.CharField(max_length=50, choices=PERMISSION_TYPES, default='permissionless', db_index=True) bounty_categories = ArrayField(models.CharField(max_length=50, choices=BOUNTY_CATEGORIES), default=list) - permission_type = models.CharField(max_length=50, choices=PERMISSION_TYPES, default='permissionless') repo_type = models.CharField(max_length=50, choices=REPO_TYPES, default='public') snooze_warnings_for_days = models.IntegerField(default=0) is_featured = models.BooleanField( default=False, help_text=_('Whether this bounty is featured')) - featuring_date = models.DateTimeField(blank=True, null=True) + featuring_date = models.DateTimeField(blank=True, null=True, db_index=True) fee_amount = models.DecimalField(default=0, decimal_places=18, max_digits=50) fee_tx_id = models.CharField(default="0x0", max_length=255, blank=True) coupon_code = models.ForeignKey('dashboard.Coupon', blank=True, null=True, related_name='coupon', on_delete=models.SET_NULL) @@ -318,7 +335,7 @@ class Bounty(SuperModel): blank=True, help_text=_('Organization Logo - Override'), ) # TODO: Remove POST ORGS - attached_job_description = models.URLField(blank=True, null=True) + attached_job_description = models.URLField(blank=True, null=True, db_index=True) event = models.ForeignKey('dashboard.HackathonEvent', related_name='bounties', null=True, on_delete=models.SET_NULL, blank=True) # Bounty QuerySet Manager @@ -330,7 +347,7 @@ class Meta: verbose_name_plural = 'Bounties' index_together = [ ["network", "idx_status"], - ] + ] + get_bounty_index_together() def __str__(self): """Return the string representation of a Bounty."""