Skip to content

Conversation

@ndthang15
Copy link
Owner

No description provided.

Copy link
Owner Author

@ndthang15 ndthang15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good 👍

create type gender_type
as enum ('male', 'female');
end if;
end $$;
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rất tốt khi dùng transaction block trong Flyway. Sẽ tốt hơn nếu để cả file vào 1 transaction (Ví dụ: đưa do $$ begin lên đầu file, và end $$ xuống cuối cùng của file).

end $$;

CREATE TABLE IF NOT EXISTS sso_organization (
organization_id SERIAL NOT NULL,
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
organization_id SERIAL NOT NULL,
organization_id SERIAL NOT NULL generated always as identity,

);

CREATE TABLE IF NOT EXISTS sso_role (
role_id uuid NOT NULL,
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Đặt thêm default để ID này có thể tự sinh nếu câu INSERT không gen sẵn uuid truyền vào.

Suggested change
role_id uuid NOT NULL,
role_id uuid NOT NULL DEFAULT uuid_generate_v4(),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants