Table office.offices
This table stores information on various braches of the entity.
# Column Name Nullable Data Type Max Length Description
1office_idinteger0The primary key of this table, which is also a serial field.
2office_codecharacter varying12The code given to the office.
3office_namecharacter varying150The name given to the office which is also a unique field.
4nick_namecharacter varying50Another name of the office.
5registration_datedate0The date of registration of the office.
6currency_codecharacter varying12Foreign key to the table core.currencies.
7po_boxcharacter varying128The Post Box number of the office.
8address_line_1character varying128The address of the office.
9address_line_2character varying128The address of the office.
10streetcharacter varying50The name of the street where the office is located.
11citycharacter varying50The name of the city where the office is located.
12statecharacter varying50The name of the state where the office is located.
13zip_codecharacter varying24ZIP code of the office.
14countrycharacter varying50The name of the county where the office is located.
15phonecharacter varying24Phone number of the office.
16faxcharacter varying24Fax number of the office.
17emailcharacter varying128E-mail address of the office.
18urlcharacter varying50Web address of the office.
19registration_numbercharacter varying24The registration number of the enntity..
20pan_numbercharacter varying24Permanent Office Number of the entity.
21allow_transaction_postingboolean0
22parent_office_idinteger0Foreign key to the table office.offices.
23audit_user_idinteger0Contains the id of the user who last inserted or updated the corresponding row.
24audit_tstimestamp with time zone0Contains the date and timestamp of the last insert or update action.

Foreign Keys

# Column Name Key Name References
6 currency_code offices_currency_code_fkey core.currencies.currency_code
22 parent_office_id offices_parent_office_id_fkey office.offices.office_id
23 audit_user_id offices_audit_user_id_fkey office.users.user_id

Indices

Index Name Owner Access Method Definition Description
offices_pkey postgres btree office_id
offices_nick_name_uix postgres btree upper(nick_name::text)
offices_office_name_uix postgres btree upper(office_name::text)
offices_office_code_uix postgres btree upper(office_code::text)

Check Constraints

Constraint Name Description
offices_check_if_parent_chk
CHECK (office.is_parent_office(office_id::integer_strict, parent_office_id::integer_strict) = false AND parent_office_id <> office_id)

Default Values

# Column Name Default
1 office_id nextval('office.offices_office_id_seq'::regclass)
21 allow_transaction_posting true
24 audit_ts now()

Triggers

Trigger Name Targets On Event Timing Condition Order Orientation Description