Skip to content

Commit

Permalink
Make netid nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
akmatchev committed Apr 15, 2024
1 parent 59f8f1c commit 1d7eda2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions src/migrations/1713218553306-makenetidnullable.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import {MigrationInterface, QueryRunner} from "typeorm";

export class makenetidnullable1713218553306 implements MigrationInterface {
name = 'makenetidnullable1713218553306'

public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "User" ALTER COLUMN "netid" DROP NOT NULL`);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "User" ALTER COLUMN "netid" SET NOT NULL`);
}

}
2 changes: 1 addition & 1 deletion src/models/UserModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class UserModel {
@Column({ unique: true })
username: string;

@Column({ unique: true })
@Column({ unique: true, nullable: true })
netid: string;

@Column()
Expand Down

0 comments on commit 1d7eda2

Please sign in to comment.