Open MrRedBobr opened 2 years ago
For now it can be fixed with process variable:
@Column({
type: 'geography',
nullable: true,
spatialFeatureType: 'Point',
srid: 4326,
...(!process?.env?.TYPEORM_GENERATE && { precision: 15 }), //pay attantion
transformer: {
from(point: GeographyPoint): LocationDto {
if (point) {
const [lat, lng] = point.coordinates;
return { lat, lng };
} else {
return null;
}
},
to(location: LocationDto): GeographyPoint {
return location
? {
type: 'Point',
coordinates: [location.lat, location.lng],
}
: null;
},
},
})
location?: LocationInput;
Paist this string in ormconfig.js:
process.env.TYPEORM_GENERATE = true;
Issue Description
"Precision" for the geography column duplicates the migration.
Steps to Reproduce
Create geography column.
Generate migration and run it.
Change precision for this column.
In the new migration we can see duplicate
}