- Server: PostgreSQL
localhost:5434
, version15.0 (Ubuntu 15.0-1.pgdg20.04+1)
- Local time stamp:
2023-01-16T09:15:53.0252133+01:00
- Schema's:
public
,company
,dashboard
,companies
- Schema file: /PDD.Database/Scripts/schema.sql
- Data file: /PDD.Database/Scripts/data.sql for tables business_areas, business_roles, countries, users, employee_status, business_role_types, business_areas, business_roles, countries, users, employee_status, business_role_types
- Table
public.business_areas
- Table
public.business_role_types
- Table
public.business_roles
- Table
public.companies
- Table
public.company_areas
- Table
public.company_reviews
- Table
public.countries
- Table
public.employee_records
- Table
public.employee_status
- Table
public.people
- Table
public.person_roles
- Table
public.users
- Enum
public.valid_genders
- Function
company.company_details(_id uuid)
- Function
company.company_employees(_id uuid)
- Function
company.company_reviews(_id uuid, _skip integer, _take integer)
- Function
dashboard.chart_companies_by_country(_limit integer)
- Function
dashboard.chart_employee_counts_by_area(_limit integer)
- Function
dashboard.chart_employee_counts_by_year(_limit integer)
- Function
dashboard.top_experinced_people(_limit integer)
- Function
dashboard.top_rated_companies(_limit integer)
- Function
companies.business_areas()
- Function
companies.search_companies(_search character varying, _countries int2[], _areas int2[], _sort_asc boolean, _skip integer, _take integer)
- Function
companies.search_countries(_search character varying, _skip integer, _take integer)
Business areas that companies may be involved.
- Count estimate: -1
- Source: /PDD.Database/Scripts/tables/business_areas.sql
Column | Type | Nullable | Default | Comment | |
---|---|---|---|---|---|
#id |
PK | smallint |
NO | GENERATED ALWAYS AS IDENTITY |
|
#name |
character varying |
NO |
- Stats for
public.business_areas
:
Sequence Scan | Index Scan | Rows | Vaccum | Analyze |
---|---|---|---|---|
count=0 |
count=0 |
inserted=0 , updated=0 , deleted=0 |
last=, count=0 |
last=, count=0 |
rows=0 |
rows=0 |
live=0 , dead=0 |
last auto=, rows inserted since=0 |
last auto=, rows updated since=0 |
Types or groups of business roles.
- Count estimate: -1
- Source: /PDD.Database/Scripts/tables/business_role_types.sql
Column | Type | Nullable | Default | Comment | |
---|---|---|---|---|---|
#id |
PK | smallint |
NO | GENERATED ALWAYS AS IDENTITY |
|
#name |
character varying |
NO |
- Stats for
public.business_role_types
:
Sequence Scan | Index Scan | Rows | Vaccum | Analyze |
---|---|---|---|---|
count=0 |
count=0 |
inserted=0 , updated=0 , deleted=0 |
last=, count=0 |
last=, count=0 |
rows=0 |
rows=0 |
live=0 , dead=0 |
last auto=, rows inserted since=0 |
last auto=, rows updated since=0 |
Roles in a team that employees are specialized working with.
- Count estimate: -1
- Source: /PDD.Database/Scripts/tables/business_roles.sql
Column | Type | Nullable | Default | Comment | |
---|---|---|---|---|---|
#id |
PK | smallint |
NO | GENERATED ALWAYS AS IDENTITY |
|
#name |
character varying |
NO | |||
#type |
FK ➝ business_role_types.id |
smallint |
NO |
- Stats for
public.business_roles
:
Sequence Scan | Index Scan | Rows | Vaccum | Analyze |
---|---|---|---|---|
count=0 |
count=0 |
inserted=0 , updated=0 , deleted=0 |
last=, count=0 |
last=, count=0 |
rows=0 |
rows=0 |
live=0 , dead=0 |
last auto=, rows inserted since=0 |
last auto=, rows updated since=0 |
- Count estimate: 5.000
- Source: /PDD.Database/Scripts/tables/companies.sql
Column | Type | Nullable | Default | Comment | |
---|---|---|---|---|---|
#id |
PK | uuid |
NO | gen_random_uuid() |
|
#name |
character varying |
NO | |||
#web |
character varying |
YES | |||
#linkedin |
character varying |
YES | |||
#twitter |
character varying |
YES | |||
#company_line |
character varying |
YES | company moto | ||
#about |
character varying |
YES | |||
#country |
FK ➝ countries.code , IDX |
smallint |
NO | headquaters country | |
#created_at |
timestamp with time zone |
NO | now() |
||
#modified_at |
timestamp with time zone |
NO | now() |
||
#created_by |
FK ➝ users.id |
uuid |
NO | '00000000-0000-0000-0000-000000000000'::uuid |
|
#modified_by |
FK ➝ users.id |
uuid |
NO | '00000000-0000-0000-0000-000000000000'::uuid |
- Stats for
public.companies
:
Sequence Scan | Index Scan | Rows | Vaccum | Analyze |
---|---|---|---|---|
count=0 |
count=0 |
inserted=0 , updated=0 , deleted=0 |
last=, count=0 |
last=, count=0 |
rows=0 |
rows=0 |
live=0 , dead=0 |
last auto=, rows inserted since=0 |
last auto=, rows updated since=0 |
Companies - business areas.
- Count estimate: 15.080
- Source: /PDD.Database/Scripts/tables/company_areas.sql
Column | Type | Nullable | Default | Comment | |
---|---|---|---|---|---|
#company_id |
IDX | uuid |
NO | ||
#company_id |
PK, FK ➝ companies.id |
uuid |
NO | ||
#area_id |
PK, FK ➝ business_areas.id |
smallint |
NO | ||
#created_at |
timestamp with time zone |
NO | now() |
||
#created_by |
FK ➝ users.id |
uuid |
NO | '00000000-0000-0000-0000-000000000000'::uuid |
- Stats for
public.company_areas
:
Sequence Scan | Index Scan | Rows | Vaccum | Analyze |
---|---|---|---|---|
count=0 |
count=0 |
inserted=0 , updated=0 , deleted=0 |
last=, count=0 |
last=, count=0 |
rows=0 |
rows=0 |
live=0 , dead=0 |
last auto=, rows inserted since=0 |
last auto=, rows updated since=0 |
Company reviews made by people.
- Count estimate: 137.415
- Source: /PDD.Database/Scripts/tables/company_reviews.sql
Column | Type | Nullable | Default | Comment | |
---|---|---|---|---|---|
#id |
PK | uuid |
NO | gen_random_uuid() |
|
#company_id |
FK ➝ companies.id , IDX |
uuid |
NO | company reviewed | |
#person_id |
FK ➝ people.id |
uuid |
YES | person reviewer | |
#review |
CHECK (review IS NOT NULL OR score IS NOT NULL) |
character varying |
YES | written review by a person | |
#score |
CHECK (score IS NULL OR score > 0 AND score <= 5) , CHECK (review IS NOT NULL OR score IS NOT NULL) |
smallint |
YES | score 1-5 | |
#created_at |
timestamp with time zone |
NO | now() |
||
#modified_at |
timestamp with time zone |
NO | now() |
||
#created_by |
FK ➝ users.id |
uuid |
NO | '00000000-0000-0000-0000-000000000000'::uuid |
- Stats for
public.company_reviews
:
Sequence Scan | Index Scan | Rows | Vaccum | Analyze |
---|---|---|---|---|
count=0 |
count=0 |
inserted=0 , updated=0 , deleted=0 |
last=, count=0 |
last=, count=0 |
rows=0 |
rows=0 |
live=0 , dead=0 |
last auto=, rows inserted since=0 |
last auto=, rows updated since=0 |
- Count estimate: 249
- Source: /PDD.Database/Scripts/tables/countries.sql
Column | Type | Nullable | Default | Comment | |
---|---|---|---|---|---|
#code |
PK | smallint |
NO | Contry ISO 3166 numeric code. | |
#iso2 |
IDX | character(2) |
NO | Contry ISO 3166 alpha-2 code. | |
#iso3 |
IDX | character(3) |
NO | Contry ISO 3166 alpha-3 code. | |
#name |
character varying |
NO | |||
#culture |
character varying |
YES | The CultureInfo class specifies a unique name for each culture, based on RFC 4646. The name is a combination of an ISO 639 two-letter lowercase culture code associated with a language and an ISO 3166 two-letter uppercase subculture code associated with a country or region. |
- Stats for
public.countries
:
Sequence Scan | Index Scan | Rows | Vaccum | Analyze |
---|---|---|---|---|
count=0 |
count=0 |
inserted=0 , updated=0 , deleted=0 |
last=, count=0 |
last=, count=0 |
rows=0 |
rows=0 |
live=0 , dead=0 |
last auto=, rows inserted since=0 |
last auto=, rows updated since=0 |
History of employment in companies by people.
- Count estimate: 241.260
- Source: /PDD.Database/Scripts/tables/employee_records.sql
Column | Type | Nullable | Default | Comment | |
---|---|---|---|---|---|
#id |
PK | uuid |
NO | gen_random_uuid() |
|
#company_id |
FK ➝ companies.id |
uuid |
NO | ||
#person_id |
FK ➝ people.id , IDX |
uuid |
NO | ||
#employment_started_at |
date |
NO | |||
#employment_ended_at |
date |
YES | if this is null, it means person is still working there | ||
#created_at |
timestamp with time zone |
NO | now() |
||
#created_by |
FK ➝ users.id |
uuid |
NO | '00000000-0000-0000-0000-000000000000'::uuid |
- Stats for
public.employee_records
:
Sequence Scan | Index Scan | Rows | Vaccum | Analyze |
---|---|---|---|---|
count=0 |
count=0 |
inserted=0 , updated=0 , deleted=0 |
last=, count=0 |
last=, count=0 |
rows=0 |
rows=0 |
live=0 , dead=0 |
last auto=, rows inserted since=0 |
last auto=, rows updated since=0 |
List of possible statuses in regards to employment.
- Count estimate: -1
- Source: /PDD.Database/Scripts/tables/employee_status.sql
Column | Type | Nullable | Default | Comment | |
---|---|---|---|---|---|
#id |
PK | smallint |
NO | GENERATED ALWAYS AS IDENTITY |
|
#name |
character varying |
NO |
- Stats for
public.employee_status
:
Sequence Scan | Index Scan | Rows | Vaccum | Analyze |
---|---|---|---|---|
count=0 |
count=0 |
inserted=0 , updated=0 , deleted=0 |
last=, count=0 |
last=, count=0 |
rows=0 |
rows=0 |
live=0 , dead=0 |
last auto=, rows inserted since=0 |
last auto=, rows updated since=0 |
- Count estimate: 97.994
- Source: /PDD.Database/Scripts/tables/people.sql
Column | Type | Nullable | Default | Comment | |
---|---|---|---|---|---|
#id |
PK | uuid |
NO | gen_random_uuid() |
|
#first_name |
character varying |
NO | |||
#last_name |
character varying |
NO | |||
#employee_status |
FK ➝ employee_status.id , IDX |
smallint |
YES | ||
#gender |
IDX | valid_genders user defined AS ENUM ('M', 'F') ➝ |
YES | M or F | |
#email |
character varying |
YES | |||
#linkedin |
character varying |
YES | |||
#twitter |
character varying |
YES | |||
#birth |
date |
YES | |||
#country |
FK ➝ countries.code |
smallint |
YES | ||
#created_at |
timestamp with time zone |
NO | now() |
||
#modified_at |
timestamp with time zone |
NO | now() |
||
#created_by |
FK ➝ users.id |
uuid |
NO | '00000000-0000-0000-0000-000000000000'::uuid |
|
#modified_by |
FK ➝ users.id |
uuid |
NO | '00000000-0000-0000-0000-000000000000'::uuid |
- Stats for
public.people
:
Sequence Scan | Index Scan | Rows | Vaccum | Analyze |
---|---|---|---|---|
count=0 |
count=0 |
inserted=0 , updated=0 , deleted=0 |
last=, count=0 |
last=, count=0 |
rows=0 |
rows=0 |
live=0 , dead=0 |
last auto=, rows inserted since=0 |
last auto=, rows updated since=0 |
Person - business roles
- Count estimate: 255.420
- Source: /PDD.Database/Scripts/tables/person_roles.sql
Column | Type | Nullable | Default | Comment | |
---|---|---|---|---|---|
#person_id |
IDX | uuid |
NO | ||
#person_id |
PK, FK ➝ people.id |
uuid |
NO | ||
#role_id |
IDX | smallint |
NO | ||
#role_id |
PK, FK ➝ business_roles.id |
smallint |
NO | ||
#created_at |
timestamp with time zone |
NO | now() |
||
#created_by |
FK ➝ users.id |
uuid |
NO | '00000000-0000-0000-0000-000000000000'::uuid |
- Stats for
public.person_roles
:
Sequence Scan | Index Scan | Rows | Vaccum | Analyze |
---|---|---|---|---|
count=0 |
count=0 |
inserted=0 , updated=0 , deleted=0 |
last=, count=0 |
last=, count=0 |
rows=0 |
rows=0 |
live=0 , dead=0 |
last auto=, rows inserted since=0 |
last auto=, rows updated since=0 |
System users. May or may not be a person (in people records).
- Count estimate: -1
- Source: /PDD.Database/Scripts/tables/users.sql
Column | Type | Nullable | Default | Comment | |
---|---|---|---|---|---|
#id |
PK | uuid |
NO | gen_random_uuid() |
|
#email |
IDX | character varying |
NO | lowercased | |
#name |
character varying |
YES | |||
#data |
json |
NO | '{}'::json |
json data received from external auth provider | |
#providers |
character varying[] |
NO | '{}'::character varying[] |
list of external auth providers autorized this user | |
#timezone |
character varying |
NO | timezone from browser | ||
#culture |
character varying |
NO | matching culture by browser timezone | ||
#person_id |
FK ➝ people.id |
uuid |
YES | ||
#lockout_end |
timestamp with time zone |
YES | |||
#created_at |
timestamp with time zone |
NO | now() |
- Stats for
public.users
:
Sequence Scan | Index Scan | Rows | Vaccum | Analyze |
---|---|---|---|---|
count=0 |
count=0 |
inserted=0 , updated=0 , deleted=0 |
last=, count=0 |
last=, count=0 |
rows=0 |
rows=0 |
live=0 , dead=0 |
last auto=, rows inserted since=0 |
last auto=, rows updated since=0 |
Type name | Values | Comment | Source |
---|---|---|---|
#public.valid_genders |
'M', 'F' |
There are only two genders. | /PDD.Database/Scripts/types/valid_genders.sql |
-
Returns
json
-
Language is
sql
-
Source: /PDD.Database/Scripts/functions/company/company.company_details.sql
-
Data Access Code: /PDD.Database/Extensions/Company/CompanyDetails.cs
-
Unit Tests: /PDD.DatabaseTests/Company/CompanyDetailsUnitTests.cs
-
Returns
json
-
Language is
sql
-
Source: /PDD.Database/Scripts/functions/company/company.company_employees.sql
-
Data Access Code: /PDD.Database/Extensions/Company/CompanyEmployees.cs
-
Unit Tests: /PDD.DatabaseTests/Company/CompanyEmployeesUnitTests.cs
-
Returns
json
-
Language is
plpgsql
-
Source: /PDD.Database/Scripts/functions/company/company.company_reviews.sql
-
Data Access Code: /PDD.Database/Extensions/Company/CompanyReviews.cs
-
Unit Tests: /PDD.DatabaseTests/Company/CompanyReviewsUnitTests.cs
-
Returns
json
-
Language is
sql
-
Source: /PDD.Database/Scripts/functions/dashboard/dashboard.chart_companies_by_country.sql
-
Data Access Code: /PDD.Database/Extensions/Dashboard/ChartCompaniesByCountry.cs
-
Unit Tests: /PDD.DatabaseTests/Dashboard/ChartCompaniesByCountryUnitTests.cs
Number of companies by country. JSON object where labels are country names and it only have one series with the number of companies for each country. It show only first 9 countries and 10th is summed together as other.
- Returns JSON schema:
{"labels": [string], "series: [{"data": [number]}]"}
-
Returns
json
-
Language is
sql
-
Source: /PDD.Database/Scripts/functions/dashboard/dashboard.chart_employee_counts_by_area.sql
-
Data Access Code: /PDD.Database/Extensions/Dashboard/ChartEmployeeCountsByArea.cs
-
Unit Tests: /PDD.DatabaseTests/Dashboard/ChartEmployeeCountsByAreaUnitTests.cs
Business areas, the number of employees for top 3 companies by highest number of employees. JSON object where labels are business area names and three series with number of current employees for each area, each searies for one company.
- Returns JSON schema:
{"labels": [string], "series: [{"data": [number], "label": string}]"}
-
Returns
json
-
Language is
plpgsql
-
Source: /PDD.Database/Scripts/functions/dashboard/dashboard.chart_employee_counts_by_year.sql
-
Data Access Code: /PDD.Database/Extensions/Dashboard/ChartEmployeeCountsByYear.cs
-
Unit Tests: /PDD.DatabaseTests/Dashboard/ChartEmployeeCountsByYearUnitTests.cs
Top companies by number of employees for the last ten years. JSON object with only one series where labels are last ten years names and values have data for number of employees for each year and label as company name.
- Returns JSON:
{labels: string[], series: {data: number[], label: string}[]}
- Returns
record
RECORD (
id uuid,
first_name character varying,
last_name character varying,
age integer,
country character varying,
countrycode smallint,
countryiso2 character varying,
years_of_experience integer,
number_of_companies bigint,
employee_status character varying,
roles character varying[]
)
-
Language is
sql
-
Source: /PDD.Database/Scripts/functions/dashboard/dashboard.top_experinced_people.sql
-
Data Access Code: /PDD.Database/Extensions/Dashboard/TopExperincedPeople.cs
-
Unit Tests: /PDD.DatabaseTests/Dashboard/TopExperincedPeopleUnitTests.cs
Top experienced people by the years of the working experience.
-
Returns
json
-
Language is
sql
-
Source: /PDD.Database/Scripts/functions/dashboard/dashboard.top_rated_companies.sql
-
Data Access Code: /PDD.Database/Extensions/Dashboard/TopRatedCompanies.cs
-
Unit Tests: /PDD.DatabaseTests/Dashboard/TopRatedCompaniesUnitTests.cs
Top rated companies by the user score.
- Returns
record
RECORD (
value smallint,
name character varying
)
-
Language is
sql
-
Source: /PDD.Database/Scripts/functions/companies/companies.business_areas.sql
-
Data Access Code: /PDD.Database/Extensions/Companies/BusinessAreas.cs
-
Unit Tests: /PDD.DatabaseTests/Companies/BusinessAreasUnitTests.cs
select value and name from business_areas
Function companies.search_companies(_search character varying, _countries int2[], _areas int2[], _sort_asc boolean, _skip integer, _take integer)
-
Returns
json
-
Language is
plpgsql
-
Source: /PDD.Database/Scripts/functions/companies/companies.search_companies.sql
-
Data Access Code: /PDD.Database/Extensions/Companies/SearchCompanies.cs
-
Unit Tests: /PDD.DatabaseTests/Companies/SearchCompaniesUnitTests.cs
Search companies by search string (name or company line), or by countries or areas selection.
Result is pageable JSON response {count, data: [...]}
-
Returns
json
-
Language is
plpgsql
-
Source: /PDD.Database/Scripts/functions/companies/companies.search_countries.sql
-
Data Access Code: /PDD.Database/Extensions/Companies/SearchCountries.cs
-
Unit Tests: /PDD.DatabaseTests/Companies/SearchCountriesUnitTests.cs
Search countries by name or iso2 or iso3.
Result is pageable JSON response {count, data: [...]}
Data record has value and name suitable for select type controls.
Countries with companies are sorted first by name, followed by null record (separator) and then by countries without companies sorted by name.