Make xmet_igra_station.state column nullable
This commit is contained in:
		
							parent
							
								
									60f5093c63
								
							
						
					
					
						commit
						951ec6b48b
					
				
					 2 changed files with 4 additions and 1 deletions
				
			
		|  | @ -95,7 +95,7 @@ create table xmet_igra_station ( | ||||||
|     year_start INTEGER NOT NULL, |     year_start INTEGER NOT NULL, | ||||||
|     year_end   INTEGER NOT NULL, |     year_end   INTEGER NOT NULL, | ||||||
|     name       TEXT NOT NULL, |     name       TEXT NOT NULL, | ||||||
|     state      TEXT NOT NULL, |     state      TEXT, | ||||||
|     elevation  FLOAT NOT NULL |     elevation  FLOAT NOT NULL | ||||||
| ); | ); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -243,6 +243,9 @@ class IGRAStation(DatabaseTable): | ||||||
|         station.elevation  = float(cols(line, 32, 37)) |         station.elevation  = float(cols(line, 32, 37)) | ||||||
|         station.location   = shapely.Point(lon, lat) |         station.location   = shapely.Point(lon, lat) | ||||||
| 
 | 
 | ||||||
|  |         if station.state == '': | ||||||
|  |             station.state = None | ||||||
|  | 
 | ||||||
|         return station |         return station | ||||||
| 
 | 
 | ||||||
|     @staticmethod |     @staticmethod | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue