Skip to content

Commit

Permalink
Merge pull request #82 from cuappdev/netid
Browse files Browse the repository at this point in the history
Make netid field nullable
  • Loading branch information
akmatchev committed Apr 16, 2024
2 parents 210b976 + 1d7eda2 commit 3ecbf09
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 3ecbf09

Please sign in to comment.