|
| 1 | +# Generated by Django 4.2.22 on 2025-07-02 12:01 |
| 2 | + |
| 3 | +from django.db import migrations, models |
| 4 | +import django.db.models.deletion |
| 5 | + |
| 6 | + |
| 7 | +class Migration(migrations.Migration): |
| 8 | + |
| 9 | + initial = True |
| 10 | + |
| 11 | + dependencies = [ |
| 12 | + ] |
| 13 | + |
| 14 | + operations = [ |
| 15 | + migrations.CreateModel( |
| 16 | + name='BlockPrefix', |
| 17 | + fields=[ |
| 18 | + ('id', models.AutoField(primary_key=True, serialize=False)), |
| 19 | + ('name', models.CharField(max_length=100, unique=True)), |
| 20 | + ], |
| 21 | + ), |
| 22 | + migrations.CreateModel( |
| 23 | + name='BlockType', |
| 24 | + fields=[ |
| 25 | + ('id', models.AutoField(primary_key=True, serialize=False)), |
| 26 | + ('name', models.CharField(max_length=100, unique=True)), |
| 27 | + ], |
| 28 | + ), |
| 29 | + migrations.CreateModel( |
| 30 | + name='Category', |
| 31 | + fields=[ |
| 32 | + ('id', models.AutoField(primary_key=True, serialize=False)), |
| 33 | + ('name', models.CharField(max_length=100)), |
| 34 | + ('sort_order', models.IntegerField()), |
| 35 | + ('blocktype', models.ForeignKey(default=1, on_delete=django.db.models.deletion.PROTECT, related_name='+', to='xcosblocks.blocktype')), |
| 36 | + ], |
| 37 | + ), |
| 38 | + migrations.CreateModel( |
| 39 | + name='NewBlock', |
| 40 | + fields=[ |
| 41 | + ('id', models.AutoField(primary_key=True, serialize=False)), |
| 42 | + ('name', models.CharField(max_length=100)), |
| 43 | + ('block_name', models.CharField(max_length=200, null=True, unique=True)), |
| 44 | + ('initial_display_parameter', models.CharField(blank=True, max_length=100, null=True)), |
| 45 | + ('simulation_function', models.CharField(blank=True, max_length=100, null=True)), |
| 46 | + ('block_image_path', models.CharField(blank=True, max_length=100, null=True)), |
| 47 | + ('block_width', models.IntegerField(default=40)), |
| 48 | + ('block_height', models.IntegerField(default=40)), |
| 49 | + ('super_block', models.CharField(max_length=10000, null=True)), |
| 50 | + ('blockprefix', models.ForeignKey(default=1, on_delete=django.db.models.deletion.PROTECT, related_name='+', to='xcosblocks.blockprefix')), |
| 51 | + ('categories', models.ManyToManyField(to='xcosblocks.category')), |
| 52 | + ('main_category', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='+', to='xcosblocks.category')), |
| 53 | + ], |
| 54 | + ), |
| 55 | + migrations.CreateModel( |
| 56 | + name='ParameterDataType', |
| 57 | + fields=[ |
| 58 | + ('id', models.AutoField(primary_key=True, serialize=False)), |
| 59 | + ('name', models.CharField(max_length=100, unique=True)), |
| 60 | + ], |
| 61 | + ), |
| 62 | + migrations.CreateModel( |
| 63 | + name='NewBlockPort', |
| 64 | + fields=[ |
| 65 | + ('id', models.AutoField(primary_key=True, serialize=False)), |
| 66 | + ('port_order', models.IntegerField()), |
| 67 | + ('port_name', models.CharField(max_length=100)), |
| 68 | + ('port_number', models.CharField(max_length=10)), |
| 69 | + ('port_x', models.IntegerField(default=1)), |
| 70 | + ('port_y', models.IntegerField(default=1)), |
| 71 | + ('port_orientation', models.CharField(max_length=100)), |
| 72 | + ('port_part', models.IntegerField(default=1)), |
| 73 | + ('port_dmg', models.IntegerField(default=1)), |
| 74 | + ('port_type', models.CharField(max_length=100)), |
| 75 | + ('block', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='xcosblocks.newblock')), |
| 76 | + ], |
| 77 | + ), |
| 78 | + migrations.CreateModel( |
| 79 | + name='NewBlockParameter', |
| 80 | + fields=[ |
| 81 | + ('id', models.AutoField(primary_key=True, serialize=False)), |
| 82 | + ('p_order', models.IntegerField()), |
| 83 | + ('p_label', models.CharField(max_length=100)), |
| 84 | + ('p_help', models.CharField(blank=True, max_length=100, null=True)), |
| 85 | + ('p_value_initial', models.CharField(blank=True, max_length=100)), |
| 86 | + ('block', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='xcosblocks.newblock')), |
| 87 | + ('p_type', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='+', to='xcosblocks.parameterdatatype')), |
| 88 | + ], |
| 89 | + ), |
| 90 | + migrations.AddConstraint( |
| 91 | + model_name='newblockport', |
| 92 | + constraint=models.UniqueConstraint(fields=('block', 'port_order'), name='unique_blocktemp_port_order'), |
| 93 | + ), |
| 94 | + migrations.AddConstraint( |
| 95 | + model_name='newblockparameter', |
| 96 | + constraint=models.UniqueConstraint(fields=('block', 'p_order'), name='unique_block_p_order'), |
| 97 | + ), |
| 98 | + migrations.AddConstraint( |
| 99 | + model_name='newblock', |
| 100 | + constraint=models.UniqueConstraint(fields=('main_category', 'name'), name='unique_main_category_name'), |
| 101 | + ), |
| 102 | + migrations.AddConstraint( |
| 103 | + model_name='category', |
| 104 | + constraint=models.UniqueConstraint(fields=('blocktype', 'name'), name='unique_blocktype_name'), |
| 105 | + ), |
| 106 | + ] |
0 commit comments