diff --git a/src/migrations/1713218553306-makenetidnullable.ts b/src/migrations/1713218553306-makenetidnullable.ts new file mode 100644 index 0000000..3ab4844 --- /dev/null +++ b/src/migrations/1713218553306-makenetidnullable.ts @@ -0,0 +1,14 @@ +import {MigrationInterface, QueryRunner} from "typeorm"; + +export class makenetidnullable1713218553306 implements MigrationInterface { + name = 'makenetidnullable1713218553306' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "User" ALTER COLUMN "netid" DROP NOT NULL`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "User" ALTER COLUMN "netid" SET NOT NULL`); + } + +} diff --git a/src/models/UserModel.ts b/src/models/UserModel.ts index 35247e6..e7f169b 100644 --- a/src/models/UserModel.ts +++ b/src/models/UserModel.ts @@ -16,7 +16,7 @@ export class UserModel { @Column({ unique: true }) username: string; - @Column({ unique: true }) + @Column({ unique: true, nullable: true }) netid: string; @Column()