Skip to content

SAP Hana migration: Alter column to nullable does not work #9947

@LukivondemKaff

Description

@LukivondemKaff

Issue description

migrating a column from not null to nullable does not work

Expected Behavior

adding the nullable: true on the Entity should produce a statement that alters the table no be nullable.

Actual Behavior

the statement is missing the NULL at the end.
example
await queryRunner.query(ALTER TABLE "SCHEMA"."TABLE" ALTER ("COLUMN" nvarchar(64)));

But it should be:
await queryRunner.query(
ALTER TABLE "SCHEMA"."TABLE" ALTER ("COLUMN" nvarchar(64) NULL)
);

Steps to reproduce

I can not pass my project due to company restrictions.

But It is easy:
Before the change of nullable:

export class Enquiry {
@PrimaryGeneratedColumn("uuid")
ID: string;

@column({ length: 16 })
PROJECT_NR: string;

After
export class Enquiry {
@PrimaryGeneratedColumn("uuid")
ID: string;

@column({ length: 16, nullable: true })
PROJECT_NR: string;

My Environment

Dependency Version
Operating System windows
Node.js version 18
Typescript version 4.9.5
TypeORM version 0.3.11

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?

Yes, I have the time, but I don't know how to start. I would need guidance.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions