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.

75 lines
4.2 KiB

  1. # Generated by Django 3.2.8 on 2021-12-21 14:15
  2. import api.models
  3. from django.db import migrations, models
  4. import django.db.models.deletion
  5. class Migration(migrations.Migration):
  6. dependencies = [
  7. ('api', '0019_auto_20211124_0506'),
  8. ]
  9. operations = [
  10. migrations.CreateModel(
  11. name='CategoryType',
  12. fields=[
  13. ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  14. ('text', models.CharField(db_index=True, max_length=100)),
  15. ('prefix_key', models.CharField(blank=True, choices=[('ctrl', 'ctrl'), ('shift', 'shift'), ('ctrl shift', 'ctrl shift')], max_length=10, null=True)),
  16. ('suffix_key', models.CharField(blank=True, choices=[('0', '0'), ('1', '1'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6'), ('7', '7'), ('8', '8'), ('9', '9'), ('a', 'a'), ('b', 'b'), ('c', 'c'), ('d', 'd'), ('e', 'e'), ('f', 'f'), ('g', 'g'), ('h', 'h'), ('i', 'i'), ('j', 'j'), ('k', 'k'), ('l', 'l'), ('m', 'm'), ('n', 'n'), ('o', 'o'), ('p', 'p'), ('q', 'q'), ('r', 'r'), ('s', 's'), ('t', 't'), ('u', 'u'), ('v', 'v'), ('w', 'w'), ('x', 'x'), ('y', 'y'), ('z', 'z')], max_length=1, null=True)),
  17. ('background_color', models.CharField(default=api.models.generate_random_hex_color, max_length=7)),
  18. ('text_color', models.CharField(default='#ffffff', max_length=7)),
  19. ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)),
  20. ('updated_at', models.DateTimeField(auto_now=True)),
  21. ],
  22. options={
  23. 'ordering': ['created_at'],
  24. 'abstract': False,
  25. },
  26. ),
  27. migrations.CreateModel(
  28. name='SpanType',
  29. fields=[
  30. ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  31. ('text', models.CharField(db_index=True, max_length=100)),
  32. ('prefix_key', models.CharField(blank=True, choices=[('ctrl', 'ctrl'), ('shift', 'shift'), ('ctrl shift', 'ctrl shift')], max_length=10, null=True)),
  33. ('suffix_key', models.CharField(blank=True, choices=[('0', '0'), ('1', '1'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6'), ('7', '7'), ('8', '8'), ('9', '9'), ('a', 'a'), ('b', 'b'), ('c', 'c'), ('d', 'd'), ('e', 'e'), ('f', 'f'), ('g', 'g'), ('h', 'h'), ('i', 'i'), ('j', 'j'), ('k', 'k'), ('l', 'l'), ('m', 'm'), ('n', 'n'), ('o', 'o'), ('p', 'p'), ('q', 'q'), ('r', 'r'), ('s', 's'), ('t', 't'), ('u', 'u'), ('v', 'v'), ('w', 'w'), ('x', 'x'), ('y', 'y'), ('z', 'z')], max_length=1, null=True)),
  34. ('background_color', models.CharField(default=api.models.generate_random_hex_color, max_length=7)),
  35. ('text_color', models.CharField(default='#ffffff', max_length=7)),
  36. ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)),
  37. ('updated_at', models.DateTimeField(auto_now=True)),
  38. ],
  39. options={
  40. 'ordering': ['created_at'],
  41. 'abstract': False,
  42. },
  43. ),
  44. migrations.AlterUniqueTogether(
  45. name='label',
  46. unique_together=set(),
  47. ),
  48. migrations.AddConstraint(
  49. model_name='label',
  50. constraint=models.UniqueConstraint(fields=('project', 'text'), name='api_label_is_unique'),
  51. ),
  52. migrations.AddField(
  53. model_name='spantype',
  54. name='project',
  55. field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.project'),
  56. ),
  57. migrations.AddField(
  58. model_name='categorytype',
  59. name='project',
  60. field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.project'),
  61. ),
  62. migrations.AddConstraint(
  63. model_name='spantype',
  64. constraint=models.UniqueConstraint(fields=('project', 'text'), name='api_spantype_is_unique'),
  65. ),
  66. migrations.AddConstraint(
  67. model_name='categorytype',
  68. constraint=models.UniqueConstraint(fields=('project', 'text'), name='api_categorytype_is_unique'),
  69. ),
  70. ]