CCrypto VPN public website https://vpn.ccrypto.org/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

74 lines
3.2 KiB

  1. # -*- coding: utf-8 -*-
  2. from __future__ import unicode_literals
  3. from django.db import migrations, models
  4. import django.db.models.deletion
  5. import lambdainst.models
  6. from django.conf import settings
  7. import datetime
  8. class Migration(migrations.Migration):
  9. dependencies = [
  10. migrations.swappable_dependency(settings.AUTH_USER_MODEL),
  11. ]
  12. operations = [
  13. migrations.CreateModel(
  14. name='GiftCode',
  15. fields=[
  16. ('id', models.AutoField(serialize=False, primary_key=True, verbose_name='ID', auto_created=True)),
  17. ('code', models.CharField(default=lambdainst.models.random_gift_code, max_length=32)),
  18. ('time', models.DurationField(default=datetime.timedelta(30))),
  19. ('created', models.DateTimeField(null=True, auto_now_add=True)),
  20. ('single_use', models.BooleanField(default=True)),
  21. ('free_only', models.BooleanField(default=True)),
  22. ('available', models.BooleanField(default=True)),
  23. ('comment', models.TextField(blank=True)),
  24. ('created_by', models.ForeignKey(related_name='created_giftcode_set', null=True, blank=True, to=settings.AUTH_USER_MODEL)),
  25. ],
  26. options={
  27. 'verbose_name_plural': 'Gift Codes',
  28. 'verbose_name': 'Gift Code',
  29. },
  30. ),
  31. migrations.CreateModel(
  32. name='GiftCodeUser',
  33. fields=[
  34. ('id', models.AutoField(serialize=False, primary_key=True, verbose_name='ID', auto_created=True)),
  35. ('date', models.DateTimeField(null=True, auto_now_add=True)),
  36. ('code', models.ForeignKey(to='lambdainst.GiftCode')),
  37. ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
  38. ],
  39. options={
  40. 'verbose_name_plural': 'Gift Code Users',
  41. 'verbose_name': 'Gift Code User',
  42. },
  43. ),
  44. migrations.CreateModel(
  45. name='VPNUser',
  46. fields=[
  47. ('id', models.AutoField(serialize=False, primary_key=True, verbose_name='ID', auto_created=True)),
  48. ('notes', models.TextField(blank=True)),
  49. ('expiration', models.DateTimeField(null=True, blank=True)),
  50. ('last_expiry_notice', models.DateTimeField(null=True, blank=True)),
  51. ('notify_expiration', models.BooleanField(default=True)),
  52. ('trial_periods_given', models.IntegerField(default=0)),
  53. ('last_vpn_auth', models.DateTimeField(null=True, blank=True)),
  54. ('referrer_used', models.BooleanField(default=False)),
  55. ('referrer', models.ForeignKey(related_name='referrals', null=True, on_delete=django.db.models.deletion.SET_NULL, blank=True, to=settings.AUTH_USER_MODEL)),
  56. ('user', models.OneToOneField(to=settings.AUTH_USER_MODEL)),
  57. ],
  58. options={
  59. 'verbose_name_plural': 'VPN Users',
  60. 'verbose_name': 'VPN User',
  61. },
  62. ),
  63. migrations.AddField(
  64. model_name='giftcode',
  65. name='users',
  66. field=models.ManyToManyField(through='lambdainst.GiftCodeUser', to=settings.AUTH_USER_MODEL),
  67. ),
  68. ]