Skip to content

Commit

Permalink
feat[#115]: change user entity to remove user id generation
Browse files Browse the repository at this point in the history
  • Loading branch information
shimisnow committed Apr 4, 2024
1 parent f7f6720 commit 84982b1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
-- DROP TABLE public.users;

CREATE TABLE public.users (
user_id uuid DEFAULT uuid_generate_v4() NOT NULL,
user_id uuid NOT NULL,
"name" varchar(30) NOT NULL,
surname varchar(50) NOT NULL,
email varchar(100) NOT NULL,
Expand Down
5 changes: 3 additions & 2 deletions apps/user-service/src/app/database/entities/user.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
Column,
CreateDateColumn,
Entity,
PrimaryGeneratedColumn,
PrimaryColumn,
UpdateDateColumn,
} from 'typeorm';

Expand All @@ -13,8 +13,9 @@ import {
name: 'users',
})
export class UserEntity {
@PrimaryGeneratedColumn('uuid', {
@PrimaryColumn({
name: 'user_id',
type: 'uuid',
primaryKeyConstraintName: 'pk_users',
})
userId: string;
Expand Down
2 changes: 1 addition & 1 deletion deployment/database/info/06-users.table.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
-- DROP TABLE public.users;

CREATE TABLE public.users (
user_id uuid DEFAULT uuid_generate_v4() NOT NULL,
user_id uuid NOT NULL,
"name" varchar(30) NOT NULL,
surname varchar(50) NOT NULL,
email varchar(100) NOT NULL,
Expand Down

0 comments on commit 84982b1

Please sign in to comment.