public.reviews¶
Columns¶
| Name | Type | Default | Nullable | Children | Parents | Comment |
|---|---|---|---|---|---|---|
| created_at | timestamp with time zone | false | ||||
| created_by_id | bigint | false | public.users | |||
| id | bigint | false | ||||
| is_active | boolean | false | ||||
| message | text | false | ||||
| placement_id | bigint | false | public.placements | |||
| rating | smallint | false | ||||
| type | varchar(3) | false | ||||
| updated_at | timestamp with time zone | false |
Constraints¶
| Name | Type | Definition |
|---|---|---|
| rating_between_1_and_5 | CHECK | CHECK (((rating >= 1) AND (rating <= 5))) |
| reviews_created_by_id_a3759a65_fk_users_id | FOREIGN KEY | FOREIGN KEY (created_by_id) REFERENCES users(id) DEFERRABLE INITIALLY DEFERRED |
| reviews_pkey | PRIMARY KEY | PRIMARY KEY (id) |
| reviews_placement_id_6b5677ba_fk_placements_id | FOREIGN KEY | FOREIGN KEY (placement_id) REFERENCES placements(id) DEFERRABLE INITIALLY DEFERRED |
| reviews_rating_check | CHECK | CHECK ((rating >= 0)) |
Indexes¶
| Name | Definition |
|---|---|
| reviews_created_53b5d6_idx | CREATE INDEX reviews_created_53b5d6_idx ON public.reviews USING btree (created_at) |
| reviews_created_by_id_a3759a65 | CREATE INDEX reviews_created_by_id_a3759a65 ON public.reviews USING btree (created_by_id) |
| reviews_pkey | CREATE UNIQUE INDEX reviews_pkey ON public.reviews USING btree (id) |
| reviews_placement_id_6b5677ba | CREATE INDEX reviews_placement_id_6b5677ba ON public.reviews USING btree (placement_id) |
| uniq_active_review_per_placement_and_type | CREATE UNIQUE INDEX uniq_active_review_per_placement_and_type ON public.reviews USING btree (placement_id, type) WHERE is_active |
Generated by tbls