railwayapp-templates / postgres-ssl

MIT License
13 stars 36 forks source link

Type Geograph #14

Closed DerrickNgigi closed 4 months ago

DerrickNgigi commented 5 months ago

I get this error while migrating my database from Render.

  // geolocation
  @Column({
    type: 'geography',
    spatialFeatureType: 'Point',
    srid: 4326,
    nullable: true,
  })
  @ApiProperty({
    description: 'GeoLocation of the farmhub',
    type: String,
    example: {
      type: 'Point',
      coordinates: [116.443987, 39.920843],
    },
  })
  GeoLocation: Point;

QueryFailedError: type "geography" does not exist at PostgresQueryRunner.query (/home/beaver/ifoodsos/nccgbackend/src/driver/postgres/PostgresQueryRunner.ts:331:19) at processTicksAndRejections (node:internal/process/task_queues:95:5) at PostgresQueryRunner.executeQueries (/home/beaver/ifoodsos/nccgbackend/src/query-runner/BaseQueryRunner.ts:660:13) at PostgresQueryRunner.createTable (/home/beaver/ifoodsos/nccgbackend/src/driver/postgres/PostgresQueryRunner.ts:610:9) at RdbmsSchemaBuilder.createNewTables (/home/beaver/ifoodsos/nccgbackend/src/schema-builder/RdbmsSchemaBuilder.ts:635:13) at RdbmsSchemaBuilder.executeSchemaSyncOperationsInProperOrder (/home/beaver/ifoodsos/nccgbackend/src/schema-builder/RdbmsSchemaBuilder.ts:225:9) at RdbmsSchemaBuilder.build (/home/beaver/ifoodsos/nccgbackend/src/schema-builder/RdbmsSchemaBuilder.ts:95:13) at DataSource.synchronize (/home/beaver/ifoodsos/nccgbackend/src/data-source/DataSource.ts:339:9) at DataSource.initialize (/home/beaver/ifoodsos/nccgbackend/src/data-source/DataSource.ts:277:43) QueryFailedError: type "geography" does not exist

brody192 commented 5 months ago

This template is just plain Postgres database, you would likely want to use the PostGIS template - https://railway.app/template/postgis