Skip to content

Commit 4d8a0ed

Browse files
committed
adding migrations for docker
1 parent ee13ca4 commit 4d8a0ed

File tree

12 files changed

+262
-6
lines changed

12 files changed

+262
-6
lines changed

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
.srcflake8
66
.xcosblocks.txt
77
__pycache__/
8-
blocks/blocks/*/migrations/*.py
9-
blocks/*/migrations/*.py
108
blocks/env*/
119
.DS_Store
1210
.env

blocks/.dockerignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ env*
88
*.pyc
99
*.sqlite3
1010
*.swp
11-
**/migrations
1211
.DS_Store
1312
**/.env.*
1413
**/build
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Generated by Django 4.2.22 on 2025-07-02 12:01
2+
3+
from django.db import migrations, models
4+
import django.utils.timezone
5+
6+
7+
class Migration(migrations.Migration):
8+
9+
initial = True
10+
11+
dependencies = [
12+
('auth', '0012_alter_user_first_name_max_length'),
13+
]
14+
15+
operations = [
16+
migrations.CreateModel(
17+
name='User',
18+
fields=[
19+
('password', models.CharField(max_length=128, verbose_name='password')),
20+
('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
21+
('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
22+
('first_name', models.CharField(blank=True, max_length=150, verbose_name='first name')),
23+
('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
24+
('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
25+
('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
26+
('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
27+
('id', models.AutoField(primary_key=True, serialize=False)),
28+
('email', models.EmailField(max_length=150, unique=True)),
29+
('username', models.CharField(max_length=150, unique=True)),
30+
('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.group', verbose_name='groups')),
31+
('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.permission', verbose_name='user permissions')),
32+
],
33+
options={
34+
'verbose_name': 'user',
35+
'verbose_name_plural': 'users',
36+
'abstract': False,
37+
},
38+
),
39+
]

blocks/authAPI/migrations/__init__.py

Whitespace-only changes.
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
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+
]

blocks/blocks/xcosblocks/migrations/__init__.py

Whitespace-only changes.

blocks/init.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ PASSWORD=''
77

88
rm -f xcosblocks.sqlite3
99

10-
./manage.py makemigrations -v0
1110
./manage.py migrate -v0
1211
./manage.py loaddata xcosblocks
1312

1413
echo "from authAPI.models import User; User.objects.create_superuser('$EMAIL', '$EMAIL', '$PASSWORD')" |
15-
./manage.py shell
14+
./manage.py shell

blocks/install.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ sed -i \
1717

1818
mkdir -p file_storage/uploads logs media/saves media/uploads
1919
make -s
20-
python manage.py makemigrations -v0 saveAPI simulationAPI xcosblocks
2120
python manage.py migrate -v0
2221
python manage.py loaddata -v0 saveAPI xcosblocks
2322

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Generated by Django 4.2.22 on 2025-07-02 12:01
2+
3+
from django.conf import settings
4+
import django.core.files.storage
5+
from django.db import migrations, models
6+
import django.db.models.deletion
7+
import uuid
8+
9+
10+
class Migration(migrations.Migration):
11+
12+
initial = True
13+
14+
dependencies = [
15+
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
16+
]
17+
18+
operations = [
19+
migrations.CreateModel(
20+
name='Book',
21+
fields=[
22+
('id', models.AutoField(primary_key=True, serialize=False)),
23+
('book_name', models.CharField(max_length=500)),
24+
('author_name', models.CharField(max_length=500)),
25+
],
26+
),
27+
migrations.CreateModel(
28+
name='BookCategory',
29+
fields=[
30+
('id', models.AutoField(primary_key=True, serialize=False)),
31+
('category_name', models.CharField(max_length=500)),
32+
],
33+
),
34+
migrations.CreateModel(
35+
name='StateSave',
36+
fields=[
37+
('id', models.AutoField(primary_key=True, serialize=False)),
38+
('save_id', models.UUIDField(default=uuid.uuid4)),
39+
('name', models.CharField(default='Untitled', max_length=100)),
40+
('description', models.CharField(max_length=400, null=True)),
41+
('shared', models.BooleanField(default=False)),
42+
('create_time', models.DateTimeField(auto_now_add=True)),
43+
('save_time', models.DateTimeField(auto_now=True, db_index=True)),
44+
('data_dump', models.TextField()),
45+
('base64_image', models.ImageField(null=True, storage=django.core.files.storage.FileSystemStorage(base_url='/files', location='/home/sunil/git/xcosblocks/blocks/file_storage'), upload_to='simulation_images')),
46+
('script_dump', models.TextField(null=True)),
47+
('owner', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
48+
],
49+
),
50+
migrations.CreateModel(
51+
name='Gallery',
52+
fields=[
53+
('id', models.AutoField(primary_key=True, serialize=False)),
54+
('save_id', models.CharField(max_length=50, unique=True)),
55+
('name', models.CharField(default='Untitled', max_length=100)),
56+
('description', models.CharField(max_length=400, null=True)),
57+
('save_time', models.DateTimeField(auto_now=True)),
58+
('data_dump', models.TextField()),
59+
('blocks', models.CharField(max_length=300, null=True)),
60+
('media', models.CharField(max_length=100, null=True)),
61+
('script_dump', models.TextField(null=True)),
62+
('book', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='examples', to='saveAPI.book')),
63+
],
64+
),
65+
migrations.AddField(
66+
model_name='book',
67+
name='category',
68+
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='saveAPI.bookcategory'),
69+
),
70+
]

blocks/saveAPI/migrations/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)