Table office.stores
# Column Name Nullable Data Type Max Length Description
1store_idinteger0
2office_idinteger0
3store_codecharacter varying12
4store_namecharacter varying50
5addresscharacter varying50
6store_type_idinteger0
7allow_salesboolean0
8sales_tax_idinteger0
9default_cash_account_idbigint0
10default_cash_repository_idinteger0
11audit_user_idinteger0Contains the id of the user who last inserted or updated the corresponding row.
12audit_tstimestamp with time zone0Contains the date and timestamp of the last insert or update action.

Foreign Keys

# Column Name Key Name References
2 office_id stores_office_id_fkey office.offices.office_id
6 store_type_id stores_store_type_id_fkey office.store_types.store_type_id
8 sales_tax_id stores_sales_tax_id_fkey core.sales_taxes.sales_tax_id
9 default_cash_account_id stores_default_cash_account_id_fkey core.accounts.account_id
10 default_cash_repository_id stores_default_cash_repository_id_fkey office.cash_repositories.cash_repository_id
11 audit_user_id stores_audit_user_id_fkey office.users.user_id

Indices

Index Name Owner Access Method Definition Description
stores_pkey postgres btree store_id
stores_store_name_uix postgres btree office_id upper(store_name::text)
stores_store_code_uix postgres btree office_id upper(store_code::text)

Check Constraints

Constraint Name Description
store_default_cash_repository_chk
CHECK (office.get_office_id_by_cash_repository_id(default_cash_repository_id) = office_id)
stores_default_cash_account_id_chk
CHECK (core.is_cash_equivalent(default_cash_account_id))
stores_sales_tax_id_chk
CHECK (core.get_office_id_by_sales_tax_id(sales_tax_id) = office_id)

Default Values

# Column Name Default
1 store_id nextval('office.stores_store_id_seq'::regclass)
7 allow_sales true
12 audit_ts now()

Triggers

Trigger Name Targets On Event Timing Condition Order Orientation Description