-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Description
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.