0001_squashed.py 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663
  1. import dcim.fields
  2. import django.contrib.postgres.fields
  3. import django.core.serializers.json
  4. import django.core.validators
  5. from django.db import migrations, models
  6. import django.db.models.deletion
  7. import timezone_field.fields
  8. import utilities.fields
  9. import utilities.ordering
  10. import utilities.query_functions
  11. import utilities.validators
  12. class Migration(migrations.Migration):
  13. initial = True
  14. dependencies = [
  15. ]
  16. replaces = [
  17. ('dcim', '0001_initial'),
  18. ]
  19. operations = [
  20. migrations.CreateModel(
  21. name='Cable',
  22. fields=[
  23. ('created', models.DateField(auto_now_add=True, null=True)),
  24. ('last_updated', models.DateTimeField(auto_now=True, null=True)),
  25. ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=django.core.serializers.json.DjangoJSONEncoder)),
  26. ('id', models.BigAutoField(primary_key=True, serialize=False)),
  27. ('termination_a_id', models.PositiveIntegerField()),
  28. ('termination_b_id', models.PositiveIntegerField()),
  29. ('type', models.CharField(blank=True, max_length=50)),
  30. ('status', models.CharField(default='connected', max_length=50)),
  31. ('label', models.CharField(blank=True, max_length=100)),
  32. ('color', utilities.fields.ColorField(blank=True, max_length=6)),
  33. ('length', models.PositiveSmallIntegerField(blank=True, null=True)),
  34. ('length_unit', models.CharField(blank=True, max_length=50)),
  35. ('_abs_length', models.DecimalField(blank=True, decimal_places=4, max_digits=10, null=True)),
  36. ],
  37. options={
  38. 'ordering': ['pk'],
  39. },
  40. ),
  41. migrations.CreateModel(
  42. name='CablePath',
  43. fields=[
  44. ('id', models.BigAutoField(primary_key=True, serialize=False)),
  45. ('origin_id', models.PositiveIntegerField()),
  46. ('destination_id', models.PositiveIntegerField(blank=True, null=True)),
  47. ('path', dcim.fields.PathField(base_field=models.CharField(max_length=40), size=None)),
  48. ('is_active', models.BooleanField(default=False)),
  49. ('is_split', models.BooleanField(default=False)),
  50. ],
  51. ),
  52. migrations.CreateModel(
  53. name='ConsolePort',
  54. fields=[
  55. ('created', models.DateField(auto_now_add=True, null=True)),
  56. ('last_updated', models.DateTimeField(auto_now=True, null=True)),
  57. ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=django.core.serializers.json.DjangoJSONEncoder)),
  58. ('id', models.BigAutoField(primary_key=True, serialize=False)),
  59. ('name', models.CharField(max_length=64)),
  60. ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
  61. ('label', models.CharField(blank=True, max_length=64)),
  62. ('description', models.CharField(blank=True, max_length=200)),
  63. ('_cable_peer_id', models.PositiveIntegerField(blank=True, null=True)),
  64. ('mark_connected', models.BooleanField(default=False)),
  65. ('type', models.CharField(blank=True, max_length=50)),
  66. ('speed', models.PositiveSmallIntegerField(blank=True, null=True)),
  67. ],
  68. options={
  69. 'ordering': ('device', '_name'),
  70. },
  71. ),
  72. migrations.CreateModel(
  73. name='ConsolePortTemplate',
  74. fields=[
  75. ('created', models.DateField(auto_now_add=True, null=True)),
  76. ('last_updated', models.DateTimeField(auto_now=True, null=True)),
  77. ('id', models.BigAutoField(primary_key=True, serialize=False)),
  78. ('name', models.CharField(max_length=64)),
  79. ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
  80. ('label', models.CharField(blank=True, max_length=64)),
  81. ('description', models.CharField(blank=True, max_length=200)),
  82. ('type', models.CharField(blank=True, max_length=50)),
  83. ],
  84. options={
  85. 'ordering': ('device_type', '_name'),
  86. },
  87. ),
  88. migrations.CreateModel(
  89. name='ConsoleServerPort',
  90. fields=[
  91. ('created', models.DateField(auto_now_add=True, null=True)),
  92. ('last_updated', models.DateTimeField(auto_now=True, null=True)),
  93. ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=django.core.serializers.json.DjangoJSONEncoder)),
  94. ('id', models.BigAutoField(primary_key=True, serialize=False)),
  95. ('name', models.CharField(max_length=64)),
  96. ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
  97. ('label', models.CharField(blank=True, max_length=64)),
  98. ('description', models.CharField(blank=True, max_length=200)),
  99. ('_cable_peer_id', models.PositiveIntegerField(blank=True, null=True)),
  100. ('mark_connected', models.BooleanField(default=False)),
  101. ('type', models.CharField(blank=True, max_length=50)),
  102. ('speed', models.PositiveSmallIntegerField(blank=True, null=True)),
  103. ],
  104. options={
  105. 'ordering': ('device', '_name'),
  106. },
  107. ),
  108. migrations.CreateModel(
  109. name='ConsoleServerPortTemplate',
  110. fields=[
  111. ('created', models.DateField(auto_now_add=True, null=True)),
  112. ('last_updated', models.DateTimeField(auto_now=True, null=True)),
  113. ('id', models.BigAutoField(primary_key=True, serialize=False)),
  114. ('name', models.CharField(max_length=64)),
  115. ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
  116. ('label', models.CharField(blank=True, max_length=64)),
  117. ('description', models.CharField(blank=True, max_length=200)),
  118. ('type', models.CharField(blank=True, max_length=50)),
  119. ],
  120. options={
  121. 'ordering': ('device_type', '_name'),
  122. },
  123. ),
  124. migrations.CreateModel(
  125. name='Device',
  126. fields=[
  127. ('created', models.DateField(auto_now_add=True, null=True)),
  128. ('last_updated', models.DateTimeField(auto_now=True, null=True)),
  129. ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=django.core.serializers.json.DjangoJSONEncoder)),
  130. ('id', models.BigAutoField(primary_key=True, serialize=False)),
  131. ('local_context_data', models.JSONField(blank=True, null=True)),
  132. ('name', models.CharField(blank=True, max_length=64, null=True)),
  133. ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize, null=True)),
  134. ('serial', models.CharField(blank=True, max_length=50)),
  135. ('asset_tag', models.CharField(blank=True, max_length=50, null=True, unique=True)),
  136. ('position', models.PositiveSmallIntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(1)])),
  137. ('face', models.CharField(blank=True, max_length=50)),
  138. ('status', models.CharField(default='active', max_length=50)),
  139. ('vc_position', models.PositiveSmallIntegerField(blank=True, null=True, validators=[django.core.validators.MaxValueValidator(255)])),
  140. ('vc_priority', models.PositiveSmallIntegerField(blank=True, null=True, validators=[django.core.validators.MaxValueValidator(255)])),
  141. ('comments', models.TextField(blank=True)),
  142. ],
  143. options={
  144. 'ordering': ('_name', 'pk'),
  145. },
  146. ),
  147. migrations.CreateModel(
  148. name='DeviceBay',
  149. fields=[
  150. ('created', models.DateField(auto_now_add=True, null=True)),
  151. ('last_updated', models.DateTimeField(auto_now=True, null=True)),
  152. ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=django.core.serializers.json.DjangoJSONEncoder)),
  153. ('id', models.BigAutoField(primary_key=True, serialize=False)),
  154. ('name', models.CharField(max_length=64)),
  155. ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
  156. ('label', models.CharField(blank=True, max_length=64)),
  157. ('description', models.CharField(blank=True, max_length=200)),
  158. ],
  159. options={
  160. 'ordering': ('device', '_name'),
  161. },
  162. ),
  163. migrations.CreateModel(
  164. name='DeviceBayTemplate',
  165. fields=[
  166. ('created', models.DateField(auto_now_add=True, null=True)),
  167. ('last_updated', models.DateTimeField(auto_now=True, null=True)),
  168. ('id', models.BigAutoField(primary_key=True, serialize=False)),
  169. ('name', models.CharField(max_length=64)),
  170. ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
  171. ('label', models.CharField(blank=True, max_length=64)),
  172. ('description', models.CharField(blank=True, max_length=200)),
  173. ],
  174. options={
  175. 'ordering': ('device_type', '_name'),
  176. },
  177. ),
  178. migrations.CreateModel(
  179. name='DeviceRole',
  180. fields=[
  181. ('created', models.DateField(auto_now_add=True, null=True)),
  182. ('last_updated', models.DateTimeField(auto_now=True, null=True)),
  183. ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=django.core.serializers.json.DjangoJSONEncoder)),
  184. ('id', models.BigAutoField(primary_key=True, serialize=False)),
  185. ('name', models.CharField(max_length=100, unique=True)),
  186. ('slug', models.SlugField(max_length=100, unique=True)),
  187. ('color', utilities.fields.ColorField(default='9e9e9e', max_length=6)),
  188. ('vm_role', models.BooleanField(default=True)),
  189. ('description', models.CharField(blank=True, max_length=200)),
  190. ],
  191. options={
  192. 'ordering': ['name'],
  193. },
  194. ),
  195. migrations.CreateModel(
  196. name='DeviceType',
  197. fields=[
  198. ('created', models.DateField(auto_now_add=True, null=True)),
  199. ('last_updated', models.DateTimeField(auto_now=True, null=True)),
  200. ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=django.core.serializers.json.DjangoJSONEncoder)),
  201. ('id', models.BigAutoField(primary_key=True, serialize=False)),
  202. ('model', models.CharField(max_length=100)),
  203. ('slug', models.SlugField(max_length=100)),
  204. ('part_number', models.CharField(blank=True, max_length=50)),
  205. ('u_height', models.PositiveSmallIntegerField(default=1)),
  206. ('is_full_depth', models.BooleanField(default=True)),
  207. ('subdevice_role', models.CharField(blank=True, max_length=50)),
  208. ('front_image', models.ImageField(blank=True, upload_to='devicetype-images')),
  209. ('rear_image', models.ImageField(blank=True, upload_to='devicetype-images')),
  210. ('comments', models.TextField(blank=True)),
  211. ],
  212. options={
  213. 'ordering': ['manufacturer', 'model'],
  214. },
  215. ),
  216. migrations.CreateModel(
  217. name='FrontPort',
  218. fields=[
  219. ('created', models.DateField(auto_now_add=True, null=True)),
  220. ('last_updated', models.DateTimeField(auto_now=True, null=True)),
  221. ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=django.core.serializers.json.DjangoJSONEncoder)),
  222. ('id', models.BigAutoField(primary_key=True, serialize=False)),
  223. ('name', models.CharField(max_length=64)),
  224. ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
  225. ('label', models.CharField(blank=True, max_length=64)),
  226. ('description', models.CharField(blank=True, max_length=200)),
  227. ('_cable_peer_id', models.PositiveIntegerField(blank=True, null=True)),
  228. ('mark_connected', models.BooleanField(default=False)),
  229. ('type', models.CharField(max_length=50)),
  230. ('rear_port_position', models.PositiveSmallIntegerField(default=1, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(1024)])),
  231. ],
  232. options={
  233. 'ordering': ('device', '_name'),
  234. },
  235. ),
  236. migrations.CreateModel(
  237. name='FrontPortTemplate',
  238. fields=[
  239. ('created', models.DateField(auto_now_add=True, null=True)),
  240. ('last_updated', models.DateTimeField(auto_now=True, null=True)),
  241. ('id', models.BigAutoField(primary_key=True, serialize=False)),
  242. ('name', models.CharField(max_length=64)),
  243. ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
  244. ('label', models.CharField(blank=True, max_length=64)),
  245. ('description', models.CharField(blank=True, max_length=200)),
  246. ('type', models.CharField(max_length=50)),
  247. ('rear_port_position', models.PositiveSmallIntegerField(default=1, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(1024)])),
  248. ],
  249. options={
  250. 'ordering': ('device_type', '_name'),
  251. },
  252. ),
  253. migrations.CreateModel(
  254. name='Interface',
  255. fields=[
  256. ('created', models.DateField(auto_now_add=True, null=True)),
  257. ('last_updated', models.DateTimeField(auto_now=True, null=True)),
  258. ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=django.core.serializers.json.DjangoJSONEncoder)),
  259. ('id', models.BigAutoField(primary_key=True, serialize=False)),
  260. ('name', models.CharField(max_length=64)),
  261. ('label', models.CharField(blank=True, max_length=64)),
  262. ('description', models.CharField(blank=True, max_length=200)),
  263. ('_cable_peer_id', models.PositiveIntegerField(blank=True, null=True)),
  264. ('mark_connected', models.BooleanField(default=False)),
  265. ('enabled', models.BooleanField(default=True)),
  266. ('mac_address', dcim.fields.MACAddressField(blank=True, null=True)),
  267. ('mtu', models.PositiveIntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(65536)])),
  268. ('mode', models.CharField(blank=True, max_length=50)),
  269. ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize_interface)),
  270. ('type', models.CharField(max_length=50)),
  271. ('mgmt_only', models.BooleanField(default=False)),
  272. ],
  273. options={
  274. 'ordering': ('device', utilities.query_functions.CollateAsChar('_name')),
  275. },
  276. ),
  277. migrations.CreateModel(
  278. name='InterfaceTemplate',
  279. fields=[
  280. ('created', models.DateField(auto_now_add=True, null=True)),
  281. ('last_updated', models.DateTimeField(auto_now=True, null=True)),
  282. ('id', models.BigAutoField(primary_key=True, serialize=False)),
  283. ('name', models.CharField(max_length=64)),
  284. ('label', models.CharField(blank=True, max_length=64)),
  285. ('description', models.CharField(blank=True, max_length=200)),
  286. ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize_interface)),
  287. ('type', models.CharField(max_length=50)),
  288. ('mgmt_only', models.BooleanField(default=False)),
  289. ],
  290. options={
  291. 'ordering': ('device_type', '_name'),
  292. },
  293. ),
  294. migrations.CreateModel(
  295. name='InventoryItem',
  296. fields=[
  297. ('created', models.DateField(auto_now_add=True, null=True)),
  298. ('last_updated', models.DateTimeField(auto_now=True, null=True)),
  299. ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=django.core.serializers.json.DjangoJSONEncoder)),
  300. ('id', models.BigAutoField(primary_key=True, serialize=False)),
  301. ('name', models.CharField(max_length=64)),
  302. ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
  303. ('label', models.CharField(blank=True, max_length=64)),
  304. ('description', models.CharField(blank=True, max_length=200)),
  305. ('part_id', models.CharField(blank=True, max_length=50)),
  306. ('serial', models.CharField(blank=True, max_length=50)),
  307. ('asset_tag', models.CharField(blank=True, max_length=50, null=True, unique=True)),
  308. ('discovered', models.BooleanField(default=False)),
  309. ('lft', models.PositiveIntegerField(editable=False)),
  310. ('rght', models.PositiveIntegerField(editable=False)),
  311. ('tree_id', models.PositiveIntegerField(db_index=True, editable=False)),
  312. ('level', models.PositiveIntegerField(editable=False)),
  313. ],
  314. options={
  315. 'ordering': ('device__id', 'parent__id', '_name'),
  316. },
  317. ),
  318. migrations.CreateModel(
  319. name='Location',
  320. fields=[
  321. ('created', models.DateField(auto_now_add=True, null=True)),
  322. ('last_updated', models.DateTimeField(auto_now=True, null=True)),
  323. ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=django.core.serializers.json.DjangoJSONEncoder)),
  324. ('id', models.BigAutoField(primary_key=True, serialize=False)),
  325. ('name', models.CharField(max_length=100)),
  326. ('slug', models.SlugField(max_length=100)),
  327. ('description', models.CharField(blank=True, max_length=200)),
  328. ('lft', models.PositiveIntegerField(editable=False)),
  329. ('rght', models.PositiveIntegerField(editable=False)),
  330. ('tree_id', models.PositiveIntegerField(db_index=True, editable=False)),
  331. ('level', models.PositiveIntegerField(editable=False)),
  332. ],
  333. options={
  334. 'ordering': ['site', 'name'],
  335. },
  336. ),
  337. migrations.CreateModel(
  338. name='Manufacturer',
  339. fields=[
  340. ('created', models.DateField(auto_now_add=True, null=True)),
  341. ('last_updated', models.DateTimeField(auto_now=True, null=True)),
  342. ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=django.core.serializers.json.DjangoJSONEncoder)),
  343. ('id', models.BigAutoField(primary_key=True, serialize=False)),
  344. ('name', models.CharField(max_length=100, unique=True)),
  345. ('slug', models.SlugField(max_length=100, unique=True)),
  346. ('description', models.CharField(blank=True, max_length=200)),
  347. ],
  348. options={
  349. 'ordering': ['name'],
  350. },
  351. ),
  352. migrations.CreateModel(
  353. name='Platform',
  354. fields=[
  355. ('created', models.DateField(auto_now_add=True, null=True)),
  356. ('last_updated', models.DateTimeField(auto_now=True, null=True)),
  357. ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=django.core.serializers.json.DjangoJSONEncoder)),
  358. ('id', models.BigAutoField(primary_key=True, serialize=False)),
  359. ('name', models.CharField(max_length=100, unique=True)),
  360. ('slug', models.SlugField(max_length=100, unique=True)),
  361. ('napalm_driver', models.CharField(blank=True, max_length=50)),
  362. ('napalm_args', models.JSONField(blank=True, null=True)),
  363. ('description', models.CharField(blank=True, max_length=200)),
  364. ],
  365. options={
  366. 'ordering': ['name'],
  367. },
  368. ),
  369. migrations.CreateModel(
  370. name='PowerFeed',
  371. fields=[
  372. ('created', models.DateField(auto_now_add=True, null=True)),
  373. ('last_updated', models.DateTimeField(auto_now=True, null=True)),
  374. ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=django.core.serializers.json.DjangoJSONEncoder)),
  375. ('id', models.BigAutoField(primary_key=True, serialize=False)),
  376. ('_cable_peer_id', models.PositiveIntegerField(blank=True, null=True)),
  377. ('mark_connected', models.BooleanField(default=False)),
  378. ('name', models.CharField(max_length=100)),
  379. ('status', models.CharField(default='active', max_length=50)),
  380. ('type', models.CharField(default='primary', max_length=50)),
  381. ('supply', models.CharField(default='ac', max_length=50)),
  382. ('phase', models.CharField(default='single-phase', max_length=50)),
  383. ('voltage', models.SmallIntegerField(default=120, validators=[utilities.validators.ExclusionValidator([0])])),
  384. ('amperage', models.PositiveSmallIntegerField(default=20, validators=[django.core.validators.MinValueValidator(1)])),
  385. ('max_utilization', models.PositiveSmallIntegerField(default=80, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(100)])),
  386. ('available_power', models.PositiveIntegerField(default=0, editable=False)),
  387. ('comments', models.TextField(blank=True)),
  388. ],
  389. options={
  390. 'ordering': ['power_panel', 'name'],
  391. },
  392. ),
  393. migrations.CreateModel(
  394. name='PowerOutlet',
  395. fields=[
  396. ('created', models.DateField(auto_now_add=True, null=True)),
  397. ('last_updated', models.DateTimeField(auto_now=True, null=True)),
  398. ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=django.core.serializers.json.DjangoJSONEncoder)),
  399. ('id', models.BigAutoField(primary_key=True, serialize=False)),
  400. ('name', models.CharField(max_length=64)),
  401. ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
  402. ('label', models.CharField(blank=True, max_length=64)),
  403. ('description', models.CharField(blank=True, max_length=200)),
  404. ('_cable_peer_id', models.PositiveIntegerField(blank=True, null=True)),
  405. ('mark_connected', models.BooleanField(default=False)),
  406. ('type', models.CharField(blank=True, max_length=50)),
  407. ('feed_leg', models.CharField(blank=True, max_length=50)),
  408. ],
  409. options={
  410. 'ordering': ('device', '_name'),
  411. },
  412. ),
  413. migrations.CreateModel(
  414. name='PowerOutletTemplate',
  415. fields=[
  416. ('created', models.DateField(auto_now_add=True, null=True)),
  417. ('last_updated', models.DateTimeField(auto_now=True, null=True)),
  418. ('id', models.BigAutoField(primary_key=True, serialize=False)),
  419. ('name', models.CharField(max_length=64)),
  420. ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
  421. ('label', models.CharField(blank=True, max_length=64)),
  422. ('description', models.CharField(blank=True, max_length=200)),
  423. ('type', models.CharField(blank=True, max_length=50)),
  424. ('feed_leg', models.CharField(blank=True, max_length=50)),
  425. ],
  426. options={
  427. 'ordering': ('device_type', '_name'),
  428. },
  429. ),
  430. migrations.CreateModel(
  431. name='PowerPanel',
  432. fields=[
  433. ('created', models.DateField(auto_now_add=True, null=True)),
  434. ('last_updated', models.DateTimeField(auto_now=True, null=True)),
  435. ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=django.core.serializers.json.DjangoJSONEncoder)),
  436. ('id', models.BigAutoField(primary_key=True, serialize=False)),
  437. ('name', models.CharField(max_length=100)),
  438. ],
  439. options={
  440. 'ordering': ['site', 'name'],
  441. },
  442. ),
  443. migrations.CreateModel(
  444. name='PowerPort',
  445. fields=[
  446. ('created', models.DateField(auto_now_add=True, null=True)),
  447. ('last_updated', models.DateTimeField(auto_now=True, null=True)),
  448. ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=django.core.serializers.json.DjangoJSONEncoder)),
  449. ('id', models.BigAutoField(primary_key=True, serialize=False)),
  450. ('name', models.CharField(max_length=64)),
  451. ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
  452. ('label', models.CharField(blank=True, max_length=64)),
  453. ('description', models.CharField(blank=True, max_length=200)),
  454. ('_cable_peer_id', models.PositiveIntegerField(blank=True, null=True)),
  455. ('mark_connected', models.BooleanField(default=False)),
  456. ('type', models.CharField(blank=True, max_length=50)),
  457. ('maximum_draw', models.PositiveSmallIntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(1)])),
  458. ('allocated_draw', models.PositiveSmallIntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(1)])),
  459. ],
  460. options={
  461. 'ordering': ('device', '_name'),
  462. },
  463. ),
  464. migrations.CreateModel(
  465. name='PowerPortTemplate',
  466. fields=[
  467. ('created', models.DateField(auto_now_add=True, null=True)),
  468. ('last_updated', models.DateTimeField(auto_now=True, null=True)),
  469. ('id', models.BigAutoField(primary_key=True, serialize=False)),
  470. ('name', models.CharField(max_length=64)),
  471. ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
  472. ('label', models.CharField(blank=True, max_length=64)),
  473. ('description', models.CharField(blank=True, max_length=200)),
  474. ('type', models.CharField(blank=True, max_length=50)),
  475. ('maximum_draw', models.PositiveSmallIntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(1)])),
  476. ('allocated_draw', models.PositiveSmallIntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(1)])),
  477. ],
  478. options={
  479. 'ordering': ('device_type', '_name'),
  480. },
  481. ),
  482. migrations.CreateModel(
  483. name='Rack',
  484. fields=[
  485. ('created', models.DateField(auto_now_add=True, null=True)),
  486. ('last_updated', models.DateTimeField(auto_now=True, null=True)),
  487. ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=django.core.serializers.json.DjangoJSONEncoder)),
  488. ('id', models.BigAutoField(primary_key=True, serialize=False)),
  489. ('name', models.CharField(max_length=100)),
  490. ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
  491. ('facility_id', models.CharField(blank=True, max_length=50, null=True)),
  492. ('status', models.CharField(default='active', max_length=50)),
  493. ('serial', models.CharField(blank=True, max_length=50)),
  494. ('asset_tag', models.CharField(blank=True, max_length=50, null=True, unique=True)),
  495. ('type', models.CharField(blank=True, max_length=50)),
  496. ('width', models.PositiveSmallIntegerField(default=19)),
  497. ('u_height', models.PositiveSmallIntegerField(default=42, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(100)])),
  498. ('desc_units', models.BooleanField(default=False)),
  499. ('outer_width', models.PositiveSmallIntegerField(blank=True, null=True)),
  500. ('outer_depth', models.PositiveSmallIntegerField(blank=True, null=True)),
  501. ('outer_unit', models.CharField(blank=True, max_length=50)),
  502. ('comments', models.TextField(blank=True)),
  503. ],
  504. options={
  505. 'ordering': ('site', 'location', '_name', 'pk'),
  506. },
  507. ),
  508. migrations.CreateModel(
  509. name='RackReservation',
  510. fields=[
  511. ('created', models.DateField(auto_now_add=True, null=True)),
  512. ('last_updated', models.DateTimeField(auto_now=True, null=True)),
  513. ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=django.core.serializers.json.DjangoJSONEncoder)),
  514. ('id', models.BigAutoField(primary_key=True, serialize=False)),
  515. ('units', django.contrib.postgres.fields.ArrayField(base_field=models.PositiveSmallIntegerField(), size=None)),
  516. ('description', models.CharField(max_length=200)),
  517. ],
  518. options={
  519. 'ordering': ['created', 'pk'],
  520. },
  521. ),
  522. migrations.CreateModel(
  523. name='RackRole',
  524. fields=[
  525. ('created', models.DateField(auto_now_add=True, null=True)),
  526. ('last_updated', models.DateTimeField(auto_now=True, null=True)),
  527. ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=django.core.serializers.json.DjangoJSONEncoder)),
  528. ('id', models.BigAutoField(primary_key=True, serialize=False)),
  529. ('name', models.CharField(max_length=100, unique=True)),
  530. ('slug', models.SlugField(max_length=100, unique=True)),
  531. ('color', utilities.fields.ColorField(default='9e9e9e', max_length=6)),
  532. ('description', models.CharField(blank=True, max_length=200)),
  533. ],
  534. options={
  535. 'ordering': ['name'],
  536. },
  537. ),
  538. migrations.CreateModel(
  539. name='RearPort',
  540. fields=[
  541. ('created', models.DateField(auto_now_add=True, null=True)),
  542. ('last_updated', models.DateTimeField(auto_now=True, null=True)),
  543. ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=django.core.serializers.json.DjangoJSONEncoder)),
  544. ('id', models.BigAutoField(primary_key=True, serialize=False)),
  545. ('name', models.CharField(max_length=64)),
  546. ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
  547. ('label', models.CharField(blank=True, max_length=64)),
  548. ('description', models.CharField(blank=True, max_length=200)),
  549. ('_cable_peer_id', models.PositiveIntegerField(blank=True, null=True)),
  550. ('mark_connected', models.BooleanField(default=False)),
  551. ('type', models.CharField(max_length=50)),
  552. ('positions', models.PositiveSmallIntegerField(default=1, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(1024)])),
  553. ],
  554. options={
  555. 'ordering': ('device', '_name'),
  556. },
  557. ),
  558. migrations.CreateModel(
  559. name='RearPortTemplate',
  560. fields=[
  561. ('created', models.DateField(auto_now_add=True, null=True)),
  562. ('last_updated', models.DateTimeField(auto_now=True, null=True)),
  563. ('id', models.BigAutoField(primary_key=True, serialize=False)),
  564. ('name', models.CharField(max_length=64)),
  565. ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
  566. ('label', models.CharField(blank=True, max_length=64)),
  567. ('description', models.CharField(blank=True, max_length=200)),
  568. ('type', models.CharField(max_length=50)),
  569. ('positions', models.PositiveSmallIntegerField(default=1, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(1024)])),
  570. ],
  571. options={
  572. 'ordering': ('device_type', '_name'),
  573. },
  574. ),
  575. migrations.CreateModel(
  576. name='Region',
  577. fields=[
  578. ('created', models.DateField(auto_now_add=True, null=True)),
  579. ('last_updated', models.DateTimeField(auto_now=True, null=True)),
  580. ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=django.core.serializers.json.DjangoJSONEncoder)),
  581. ('id', models.BigAutoField(primary_key=True, serialize=False)),
  582. ('name', models.CharField(max_length=100, unique=True)),
  583. ('slug', models.SlugField(max_length=100, unique=True)),
  584. ('description', models.CharField(blank=True, max_length=200)),
  585. ('lft', models.PositiveIntegerField(editable=False)),
  586. ('rght', models.PositiveIntegerField(editable=False)),
  587. ('tree_id', models.PositiveIntegerField(db_index=True, editable=False)),
  588. ('level', models.PositiveIntegerField(editable=False)),
  589. ],
  590. options={
  591. 'abstract': False,
  592. },
  593. ),
  594. migrations.CreateModel(
  595. name='Site',
  596. fields=[
  597. ('created', models.DateField(auto_now_add=True, null=True)),
  598. ('last_updated', models.DateTimeField(auto_now=True, null=True)),
  599. ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=django.core.serializers.json.DjangoJSONEncoder)),
  600. ('id', models.BigAutoField(primary_key=True, serialize=False)),
  601. ('name', models.CharField(max_length=100, unique=True)),
  602. ('_name', utilities.fields.NaturalOrderingField('name', blank=True, max_length=100, naturalize_function=utilities.ordering.naturalize)),
  603. ('slug', models.SlugField(max_length=100, unique=True)),
  604. ('status', models.CharField(default='active', max_length=50)),
  605. ('facility', models.CharField(blank=True, max_length=50)),
  606. ('asn', dcim.fields.ASNField(blank=True, null=True)),
  607. ('time_zone', timezone_field.fields.TimeZoneField(blank=True)),
  608. ('description', models.CharField(blank=True, max_length=200)),
  609. ('physical_address', models.CharField(blank=True, max_length=200)),
  610. ('shipping_address', models.CharField(blank=True, max_length=200)),
  611. ('latitude', models.DecimalField(blank=True, decimal_places=6, max_digits=8, null=True)),
  612. ('longitude', models.DecimalField(blank=True, decimal_places=6, max_digits=9, null=True)),
  613. ('contact_name', models.CharField(blank=True, max_length=50)),
  614. ('contact_phone', models.CharField(blank=True, max_length=20)),
  615. ('contact_email', models.EmailField(blank=True, max_length=254)),
  616. ('comments', models.TextField(blank=True)),
  617. ],
  618. options={
  619. 'ordering': ('_name',),
  620. },
  621. ),
  622. migrations.CreateModel(
  623. name='SiteGroup',
  624. fields=[
  625. ('created', models.DateField(auto_now_add=True, null=True)),
  626. ('last_updated', models.DateTimeField(auto_now=True, null=True)),
  627. ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=django.core.serializers.json.DjangoJSONEncoder)),
  628. ('id', models.BigAutoField(primary_key=True, serialize=False)),
  629. ('name', models.CharField(max_length=100, unique=True)),
  630. ('slug', models.SlugField(max_length=100, unique=True)),
  631. ('description', models.CharField(blank=True, max_length=200)),
  632. ('lft', models.PositiveIntegerField(editable=False)),
  633. ('rght', models.PositiveIntegerField(editable=False)),
  634. ('tree_id', models.PositiveIntegerField(db_index=True, editable=False)),
  635. ('level', models.PositiveIntegerField(editable=False)),
  636. ],
  637. options={
  638. 'abstract': False,
  639. },
  640. ),
  641. migrations.CreateModel(
  642. name='VirtualChassis',
  643. fields=[
  644. ('created', models.DateField(auto_now_add=True, null=True)),
  645. ('last_updated', models.DateTimeField(auto_now=True, null=True)),
  646. ('custom_field_data', models.JSONField(blank=True, default=dict, encoder=django.core.serializers.json.DjangoJSONEncoder)),
  647. ('id', models.BigAutoField(primary_key=True, serialize=False)),
  648. ('name', models.CharField(max_length=64)),
  649. ('domain', models.CharField(blank=True, max_length=30)),
  650. ('master', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='vc_master_for', to='dcim.device')),
  651. ],
  652. options={
  653. 'verbose_name_plural': 'virtual chassis',
  654. 'ordering': ['name'],
  655. },
  656. ),
  657. ]