0001_squashed.py 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. import ipam.fields
  2. from utilities.json import CustomFieldJSONEncoder
  3. from django.db import migrations, models
  4. import django.db.models.deletion
  5. class Migration(migrations.Migration):
  6. initial = True
  7. dependencies = []
  8. replaces = [
  9. ('circuits', '0001_initial'),
  10. ]
  11. operations = [
  12. migrations.CreateModel(
  13. name='Circuit',
  14. fields=[
  15. ('created', models.DateField(auto_now_add=True, null=True)),
  16. ('last_updated', models.DateTimeField(auto_now=True, null=True)),
  17. ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=CustomFieldJSONEncoder)),
  18. ('id', models.BigAutoField(primary_key=True, serialize=False)),
  19. ('cid', models.CharField(max_length=100)),
  20. ('status', models.CharField(default='active', max_length=50)),
  21. ('install_date', models.DateField(blank=True, null=True)),
  22. ('commit_rate', models.PositiveIntegerField(blank=True, null=True)),
  23. ('description', models.CharField(blank=True, max_length=200)),
  24. ('comments', models.TextField(blank=True)),
  25. ],
  26. options={
  27. 'ordering': ['provider', 'cid'],
  28. },
  29. ),
  30. migrations.CreateModel(
  31. name='CircuitTermination',
  32. fields=[
  33. ('created', models.DateField(auto_now_add=True, null=True)),
  34. ('last_updated', models.DateTimeField(auto_now=True, null=True)),
  35. ('id', models.BigAutoField(primary_key=True, serialize=False)),
  36. ('_cable_peer_id', models.PositiveIntegerField(blank=True, null=True)),
  37. ('mark_connected', models.BooleanField(default=False)),
  38. ('term_side', models.CharField(max_length=1)),
  39. ('port_speed', models.PositiveIntegerField(blank=True, null=True)),
  40. ('upstream_speed', models.PositiveIntegerField(blank=True, null=True)),
  41. ('xconnect_id', models.CharField(blank=True, max_length=50)),
  42. ('pp_info', models.CharField(blank=True, max_length=100)),
  43. ('description', models.CharField(blank=True, max_length=200)),
  44. ],
  45. options={
  46. 'ordering': ['circuit', 'term_side'],
  47. },
  48. ),
  49. migrations.CreateModel(
  50. name='CircuitType',
  51. fields=[
  52. ('created', models.DateField(auto_now_add=True, null=True)),
  53. ('last_updated', models.DateTimeField(auto_now=True, null=True)),
  54. ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=CustomFieldJSONEncoder)),
  55. ('id', models.BigAutoField(primary_key=True, serialize=False)),
  56. ('name', models.CharField(max_length=100, unique=True)),
  57. ('slug', models.SlugField(max_length=100, unique=True)),
  58. ('description', models.CharField(blank=True, max_length=200)),
  59. ],
  60. options={
  61. 'ordering': ('name',),
  62. },
  63. ),
  64. migrations.CreateModel(
  65. name='Provider',
  66. fields=[
  67. ('created', models.DateField(auto_now_add=True, null=True)),
  68. ('last_updated', models.DateTimeField(auto_now=True, null=True)),
  69. ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=CustomFieldJSONEncoder)),
  70. ('id', models.BigAutoField(primary_key=True, serialize=False)),
  71. ('name', models.CharField(max_length=100, unique=True)),
  72. ('slug', models.SlugField(max_length=100, unique=True)),
  73. ('asn', ipam.fields.ASNField(blank=True, null=True)),
  74. ('account', models.CharField(blank=True, max_length=30)),
  75. ('portal_url', models.URLField(blank=True)),
  76. ('noc_contact', models.TextField(blank=True)),
  77. ('admin_contact', models.TextField(blank=True)),
  78. ('comments', models.TextField(blank=True)),
  79. ],
  80. options={
  81. 'ordering': ['name'],
  82. },
  83. ),
  84. migrations.CreateModel(
  85. name='ProviderNetwork',
  86. fields=[
  87. ('created', models.DateField(auto_now_add=True, null=True)),
  88. ('last_updated', models.DateTimeField(auto_now=True, null=True)),
  89. ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=CustomFieldJSONEncoder)),
  90. ('id', models.BigAutoField(primary_key=True, serialize=False)),
  91. ('name', models.CharField(max_length=100)),
  92. ('description', models.CharField(blank=True, max_length=200)),
  93. ('comments', models.TextField(blank=True)),
  94. (
  95. 'provider',
  96. models.ForeignKey(
  97. on_delete=django.db.models.deletion.PROTECT, related_name='networks', to='circuits.provider'
  98. ),
  99. ),
  100. ],
  101. options={
  102. 'ordering': ('provider', 'name'),
  103. },
  104. ),
  105. ]