add project location
This commit is contained in:
33
core/apps/projects/migrations/0010_projectlocation.py
Normal file
33
core/apps/projects/migrations/0010_projectlocation.py
Normal file
@@ -0,0 +1,33 @@
|
||||
# Generated by Django 5.2.4 on 2025-08-07 12:03
|
||||
|
||||
import django.db.models.deletion
|
||||
import uuid
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('projects', '0009_project_status'),
|
||||
('shared', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='ProjectLocation',
|
||||
fields=[
|
||||
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True)),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
('address', models.CharField(max_length=200)),
|
||||
('latitude', models.FloatField()),
|
||||
('longitude', models.FloatField()),
|
||||
('district', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='project_locations', to='shared.district')),
|
||||
('region', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='project_locations', to='shared.region')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Loyiha lokatsiyasi',
|
||||
'verbose_name_plural': 'Loyiha lokatsiyalari',
|
||||
},
|
||||
),
|
||||
]
|
||||
19
core/apps/projects/migrations/0011_alter_project_location.py
Normal file
19
core/apps/projects/migrations/0011_alter_project_location.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 5.2.4 on 2025-08-07 12:04
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('projects', '0010_projectlocation'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='project',
|
||||
name='location',
|
||||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='projects', to='projects.projectlocation'),
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user