Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postgres geometry column is always being altered to type geometry in every migration despite already being type geometry #10870

Open
1 of 18 tasks
jcapogna opened this issue May 2, 2024 · 0 comments

Comments

@jcapogna
Copy link

jcapogna commented May 2, 2024

Issue description

Postgres geometry column is always being altered to type geometry in every migration despite already being type geometry

Expected Behavior

A geometry column that is not modified should not be included in migrations

Actual Behavior

When performing a migration unrelated to a column that is of type geometry, every geometry column I have in my database is included in the migration.

For example:

await queryRunner.query(`ALTER TABLE "locations" ALTER COLUMN "coordinate" TYPE geometry`);

Steps to reproduce

  1. Create an entity with a column of type geometry.

For example:

import {Point} from "geojson";

@Column("geometry")
coordinate!: Point
  1. Create your database with the initial migrations

  2. Alter another table in some way.

  3. See that the migrations include modifying the entity with the geometry type.

For example:

await queryRunner.query(`ALTER TABLE "some_other_table" ALTER COLUMN "coordinate" TYPE geometry`);

My Environment

Dependency Version
Operating System OSX
Node.js version 20.11.0
Typescript version 5.4.2
TypeORM version 0.3.20

Additional Context

No response

Relevant Database Driver(s)

  • aurora-mysql
  • aurora-postgres
  • better-sqlite3
  • cockroachdb
  • cordova
  • expo
  • mongodb
  • mysql
  • nativescript
  • oracle
  • postgres
  • react-native
  • sap
  • spanner
  • sqlite
  • sqlite-abstract
  • sqljs
  • sqlserver

Are you willing to resolve this issue by submitting a Pull Request?

No, I don’t have the time and I’m okay to wait for the community / maintainers to resolve this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant