Fix locations integrity issue
This commit is contained in:
		
							parent
							
								
									847d4b372a
								
							
						
					
					
						commit
						528dfcc57e
					
				
					 2 changed files with 24 additions and 2 deletions
				
			
		
							
								
								
									
										23
									
								
								ccdb/locations/migrations/0002_remove_site_fk_dupes.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								ccdb/locations/migrations/0002_remove_site_fk_dupes.py
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,23 @@
 | 
			
		|||
# -*- coding: utf-8 -*-
 | 
			
		||||
from __future__ import unicode_literals
 | 
			
		||||
 | 
			
		||||
from django.db import migrations, models
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class Migration(migrations.Migration):
 | 
			
		||||
 | 
			
		||||
    dependencies = [
 | 
			
		||||
        ('locations', '0001_initial'),
 | 
			
		||||
    ]
 | 
			
		||||
 | 
			
		||||
    operations = [
 | 
			
		||||
        migrations.RemoveField(
 | 
			
		||||
            model_name='municipallocation',
 | 
			
		||||
            name='site',
 | 
			
		||||
        ),
 | 
			
		||||
        migrations.AlterField(
 | 
			
		||||
            model_name='studylocation',
 | 
			
		||||
            name='site',
 | 
			
		||||
            field=models.ForeignKey(to='locations.Site'),
 | 
			
		||||
        ),
 | 
			
		||||
    ]
 | 
			
		||||
| 
						 | 
				
			
			@ -33,7 +33,6 @@ class Site(models.Model):
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
class MunicipalLocation(models.Model):
 | 
			
		||||
    site = models.ForeignKey(Site)
 | 
			
		||||
    name = models.CharField(max_length=100)
 | 
			
		||||
    code = models.CharField(max_length=10, blank=True)
 | 
			
		||||
    municipal_location_type = models.CharField(max_length=50, blank=True)
 | 
			
		||||
| 
						 | 
				
			
			@ -49,7 +48,7 @@ class MunicipalLocation(models.Model):
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
class StudyLocation(models.Model):
 | 
			
		||||
    site = models.ForeignKey(Site, blank=True, null=True)
 | 
			
		||||
    site = models.ForeignKey(Site)
 | 
			
		||||
    name = models.CharField(max_length=100)
 | 
			
		||||
    code = models.CharField(max_length=10, blank=True)
 | 
			
		||||
    study_location_type = models.CharField(max_length=50, blank=True)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue