File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 Entity ,
66 Index ,
77 OneToMany ,
8- PrimaryColumn ,
8+ PrimaryGeneratedColumn ,
99 UpdateDateColumn ,
1010} from 'typeorm' ;
1111import type { ContentPreferenceOrganization } from './contentPreference/ContentPreferenceOrganization' ;
@@ -20,8 +20,7 @@ export type OrganizationLink = z.infer<typeof organizationLinksSchema>;
2020@Entity ( )
2121@Index ( 'IDX_organization_subflags_subscriptionid' , { synchronize : false } )
2222export class Organization {
23- @PrimaryColumn ( {
24- type : 'text' ,
23+ @PrimaryGeneratedColumn ( {
2524 primaryKeyConstraintName : 'PK_organization_organization_id' ,
2625 } )
2726 id : string ;
Original file line number Diff line number Diff line change 1+ import { MigrationInterface , QueryRunner } from 'typeorm' ;
2+
3+ export class OrganizationGenerationId1761817857874
4+ implements MigrationInterface
5+ {
6+ name = 'OrganizationGenerationId.ts1761817857874' ;
7+
8+ public async up ( queryRunner : QueryRunner ) : Promise < void > {
9+ await queryRunner . query (
10+ `ALTER TABLE "organization" ALTER COLUMN "id" SET DEFAULT uuid_generate_v4()` ,
11+ ) ;
12+ }
13+
14+ public async down ( queryRunner : QueryRunner ) : Promise < void > {
15+ await queryRunner . query (
16+ `ALTER TABLE "organization" ALTER COLUMN "id" SET DEFAULT NULL` ,
17+ ) ;
18+ }
19+ }
You can’t perform that action at this time.
0 commit comments