Skip to content

public.voucher

Description

Columns

Name Type Default Nullable Children Parents Comment
id uuid false public.payment public.voucher_redemption public.refund public.voucher_reservation (DC2Type:uuid)
code varchar(255) false
owner_id uuid true public.user (DC2Type:uuid)
amount_amount bigint false
amount_currency character(3) false (DC2Type:currency)
title varchar(255) NULL::character varying true
type varchar(255) 'ABSOLUTE'::character varying false
percentage integer true
created_by_id uuid true public.user (DC2Type:uuid)
expires_at timestamp(0) with time zone NULL::timestamp with time zone false (DC2Type:datetimetz_immutable)
created_at timestamp(0) with time zone NULL::timestamp with time zone false (DC2Type:datetimetz_immutable)
blocked_by_id uuid true public.user (DC2Type:uuid)
blocked_at timestamp(0) with time zone NULL::timestamp with time zone true (DC2Type:datetimetz_immutable)
allowed_redemptions integer 1 false
note text true
status varchar(255) NULL::character varying false
kind varchar(255) 'ISSUED'::character varying false
max_redemptions_per_user integer 1 false
original_kind varchar(255) NULL::character varying false

Constraints

Name Type Definition
fk_1392a5d81da661f8 FOREIGN KEY FOREIGN KEY (blocked_by_id) REFERENCES "user"(id)
fk_1392a5d87e3c61f9 FOREIGN KEY FOREIGN KEY (owner_id) REFERENCES "user"(id)
fk_1392a5d8b03a8386 FOREIGN KEY FOREIGN KEY (created_by_id) REFERENCES "user"(id)
voucher_pkey PRIMARY KEY PRIMARY KEY (id)

Indexes

Name Definition
voucher_pkey CREATE UNIQUE INDEX voucher_pkey ON public.voucher USING btree (id)
idx_1392a5d81da661f8 CREATE INDEX idx_1392a5d81da661f8 ON public.voucher USING btree (blocked_by_id)
idx_1392a5d87e3c61f9 CREATE INDEX idx_1392a5d87e3c61f9 ON public.voucher USING btree (owner_id)
idx_1392a5d8b03a8386 CREATE INDEX idx_1392a5d8b03a8386 ON public.voucher USING btree (created_by_id)
uniq_1392a5d877153098 CREATE UNIQUE INDEX uniq_1392a5d877153098 ON public.voucher USING btree (code)

Relations

er


Generated by tbls