Direct Database Schema

🚧

Static IP Required

DDI requires your system to have a static IP address. Without one, the connection may be unstable or interrupted.

This reference documents every view (table) exposed by the Mosaic Direct Database Integration (DDI). Each table section lists its columns, data types, foreign-key relationships, and usage notes.

All views are scoped to your team automatically via the DDI connection credentials.


Quick Reference

View NameDescription
membersTeam members (employees / contractors)
rolesOrganization-level roles (positions)
portfoliosProject portfolios
projectsProjects
phasesProject phases and milestones
phase_membershipsMembers assigned to phases
work_categoriesPhase-level work categories
standard_work_categoriesOrganization-level work category templates
project_membershipsMembers assigned to projects
project_rolesRoles assigned to project members
project_scopesScope items on a project
project_scope_assignmentsMembers assigned to scope items
task_listsTask list groupings
project_tasksIndividual tasks on a project
project_task_assignmentsMembers assigned to tasks
project_notesNotes attached to projects
time_entriesLogged time entries
work_plansResource plans / schedule bars

Core Entities

Members

Team members represent the people in your organization.

View: members

ColumnTypeFKNullableDescription
idbigintnoPrimary key.
first_namestringyesFirst name.
last_namestringyesLast name.
emailstringyesEmail address.
employment_typestringyesEmployment type. See values below.
reference_numberstringyesExternal reference / employee number.
archived_atdatetimeyesWhen this member was archived. NULL if active.

employment_type values:

ValueMeaning
MemberStandard employee (default).
Contractor (Internal)Internal contractor.
Contractor (External)External contractor.
GuestGuest user.

Roles

Organization-level roles that can be assigned to project members.

View: roles

ColumnTypeFKNullableDescription
idbigintnoPrimary key.
namestringnoRole name.
is_defaultbooleannoWhether this is the default role.
created_atdatetimenoWhen this role was created.
updated_atdatetimenoWhen this role was last updated.
archived_atdatetimeyesWhen this role was archived. NULL if active.

Portfolios

Portfolios group projects together.

View: portfolios

ColumnTypeFKNullableDescription
idbigintnoPrimary key.
namestringnoPortfolio name.
archived_atdatetimeyesWhen this portfolio was archived. NULL if active.
created_atdatetimenoWhen this portfolio was created.
updated_atdatetimenoWhen this portfolio was last updated.

Projects

Projects are the primary unit of work in Mosaic.

View: projects

ColumnTypeFKNullableDescription
idbigintnoPrimary key.
project_numberstringyesThe project number.
titlestringyesProject title.
descriptionstringyesProject description.
billablebooleanyesWhether work on this project is billable.
portfolio_idbigintportfolios.idyesThe portfolio this project belongs to.
archived_atdatetimeyesWhen this project was archived. NULL if active.
created_atdatetimenoWhen this project was created.
updated_atdatetimenoWhen this project was last updated.

Project Structure

Phases

Phases divide a project into budgeted stages or milestones.

View: phases

ColumnTypeFKNullableDescription
idbigintnoPrimary key.
project_idbigintprojects.idnoParent project.
namestringyesPhase name.
phase_numberstringyesPhase number identifier.
is_budgetbooleannotrue = Phase, false = Milestone.
is_defaultbooleannoWhether this is the default phase.
is_mainbooleannoWhether this is the main phase of the project.
feenumericyesTotal budget amount for the phase.
contract_typestringyesContract type. See values below.
bill_rate_typestringyesHow billing rates are determined. See values below.
billablebooleanyesWhether work in this phase is billable.
hours_budgetnumericyesEstimated hours budget.
currency_budgetnumericyesEstimated cost budget.
budget_statusstringyesPhase budget status. See values below.
budget_fixed_fee_withstringyesHow the fixed-fee budget is calculated. See values below.
budget_hourly_withstringyesHow the hourly budget is calculated. See values below.
budget_internal_withstringyesHow the internal budget is calculated. See values below.
budget_phase_bystringyesHow the phase is budgeted. See values below.
ancestorsinteger[]yesArray of ancestor phase IDs (parent chain).
start_datedatetimeyesPhase start date.
end_datedatetimeyesPhase end date.
archived_atdatetimeyesWhen this phase was archived. NULL if active.
created_atdatetimenoWhen this phase was created.
updated_atdatetimenoWhen this phase was last updated.

contract_type values:

ValueMeaning
Fixed FeeFixed-fee contract.
HourlyHourly contract.
InternalInternal (non-client) work.

bill_rate_type values:

ValueMeaning
work_categoryRates determined by work category.
memberRates determined by team member.
roleRates determined by role.
NULLNot set.

budget_status values (phases):

ValueMeaning
not startedBudget has not started (default).
holdBudget is on hold.
activeBudget is active.
completeBudget is complete.

budget_fixed_fee_with / budget_hourly_with / budget_internal_with values:

ValueMeaning
phase_estimateUse the phase-level estimate.
member_estimatesUse member-level estimates.
spent_and_plannedUse spent + planned hours.
work_category_estimatesUse work category estimates.
phase_estimate_percentageUse phase estimate as a percentage.

budget_phase_by values:

ValueMeaning
total hoursBudget by total hours.
member estimatesBudget by member estimates.
spent and plannedBudget by spent + planned.

Phase Memberships

Associates team members with specific project phases.

View: phase_memberships

ColumnTypeFKNullableDescription
idbigintnoPrimary key.
project_membership_idbigintproject_memberships.idnoThe project membership this belongs to.
phase_idbigintphases.idnoThe phase the member is assigned to.
member_idbigintmembers.idyesThe assigned member.
created_atdatetimenoWhen this assignment was created.
updated_atdatetimenoWhen this assignment was last updated.
archived_atdatetimeyesWhen this assignment was archived. NULL if active.
ā„¹ļø

Only phase memberships with a valid project_membership_id are included in this view.


Work Categories

Phase-level work categories define billable/budgetable line items within a phase.

View: work_categories

ColumnTypeFKNullableDescription
idbigintnoPrimary key.
project_idbigintprojects.idnoParent project.
phase_idbigintphases.idnoParent phase.
standard_work_category_idbigintstandard_work_categories.idyesThe org-level template this is based on.
totalnumericyesTotal budget amount for this work category.
is_defaultbooleannoWhether this is the default work category.
billablebooleanyesWhether work in this category is billable.
start_datedatetimeyesStart date.
end_datedatetimeyesEnd date.
estimated_hoursnumericyesEstimated hours budget.
estimated_costnumericyesEstimated cost budget.
budget_statusstringyesWork category budget status. See values below.
rate_multipliernumericyesMultiplier applied to bill rates.
cost_rate_multipliernumericyesMultiplier applied to cost rates.
archived_atdatetimeyesWhen this work category was archived. NULL if active.
created_atdatetimenoWhen this work category was created.
updated_atdatetimenoWhen this work category was last updated.

budget_status values (work categories):

ValueMeaning
activeWork category is active (default).
proposalWork category is in proposal stage.
holdWork category is on hold.
completeWork category is complete.
āš ļø

Note: Work category budget_status values differ from phase budget_status values. Work categories use proposal where phases use not started.


Standard Work Categories

Organization-level work category templates. Individual work_categories on phases reference these.

View: standard_work_categories

ColumnTypeFKNullableDescription
idbigintnoPrimary key.
titlestringnoCategory name.
archivedbooleannoWhether this category is archived.
billablebooleanyesWhether work in this category is billable.
is_defaultbooleannoWhether this is the default category.
is_custombooleannoWhether this is a custom (team-created) category.
created_atdatetimenoWhen this category was created.
updated_atdatetimenoWhen this category was last updated.

People on Projects

Project Memberships

Represents a member's assignment to a project.

View: project_memberships

ColumnTypeFKNullableDescription
idbigintnoPrimary key.
project_idbigintprojects.idnoThe project.
member_idbigintmembers.idnoThe member.
archived_atdatetimeyesWhen this membership was archived. NULL if active.
created_atdatetimenoWhen this membership was created.
updated_atdatetimenoWhen this membership was last updated.

Project Roles

Assigns a role to a project member, with optional date ranges.

View: project_roles

ColumnTypeFKNullableDescription
idbigintnoPrimary key.
project_membership_idbigintproject_memberships.idnoThe project membership this role belongs to.
role_idbigintroles.idyesThe role assigned.
role_numberstringyesThe position number for this role assignment.
start_datedateyesWhen this role assignment starts.
end_datedateyesWhen this role assignment ends.
created_atdatetimenoWhen this assignment was created.
updated_atdatetimenoWhen this assignment was last updated.
archived_atdatetimeyesWhen this assignment was archived. NULL if active.

Scope & Tasks

Project Scopes

Scope items represent deliverables or work items at the project level.

View: project_scopes

ColumnTypeFKNullableDescription
idbigintnoPrimary key.
project_idbigintprojects.idnoParent project.
phase_idbigintphases.idyesAssociated phase.
standard_work_category_idbigintstandard_work_categories.idyesAssociated standard work category.
work_category_idbigintwork_categories.idyesAssociated work category.
descriptionstringyesScope item description.
created_atdatetimenoWhen this scope item was created.
updated_atdatetimenoWhen this scope item was last updated.

Project Scope Assignments

Assigns members to scope items.

View: project_scope_assignments

ColumnTypeFKNullableDescription
idbigintnoPrimary key.
member_idbigintmembers.idyesThe assigned member.
assigner_idbigintmembers.idyesThe member who made the assignment.
project_scope_idbigintproject_scopes.idnoThe scope item.
project_membership_idbigintproject_memberships.idyesThe project membership.
created_atdatetimenoWhen this assignment was created.
updated_atdatetimenoWhen this assignment was last updated.
archived_atdatetimeyesWhen this assignment was archived. NULL if active.

Task Lists

Task lists group tasks within a project.

View: task_lists

ColumnTypeFKNullableDescription
idbigintnoPrimary key.
namestringnoTask list name.
project_idbigintprojects.idnoParent project.
created_atdatetimenoWhen this task list was created.
updated_atdatetimenoWhen this task list was last updated.

Project Tasks

Individual tasks within a project.

View: project_tasks

ColumnTypeFKNullableDescription
idbigintnoPrimary key.
descriptionstringyesTask description.
project_idbigintprojects.idnoParent project.
phase_idbigintphases.idyesAssociated phase.
standard_work_category_idbigintstandard_work_categories.idyesAssociated standard work category.
work_category_idbigintwork_categories.idyesAssociated work category.
estimated_hoursnumericyesEstimated hours for this task.
task_list_idbiginttask_lists.idyesThe task list this task belongs to.
task_list_sort_rankintegeryesSort order within the task list.
work_category_sort_rankintegeryesSort order within the work category.
completed_atdatetimeyesWhen this task was completed.
archived_atdatetimeyesWhen this task was archived. NULL if active.
created_atdatetimenoWhen this task was created.
updated_atdatetimenoWhen this task was last updated.

Project Task Assignments

Assigns members to project tasks.

View: project_task_assignments

ColumnTypeFKNullableDescription
idbigintnoPrimary key.
member_idbigintmembers.idyesThe assigned member.
assigner_idbigintmembers.idyesThe member who made the assignment.
project_task_idbigintproject_tasks.idnoThe task.
project_membership_idbigintproject_memberships.idyesThe project membership.
created_atdatetimenoWhen this assignment was created.
updated_atdatetimenoWhen this assignment was last updated.
archived_atdatetimeyesWhen this assignment was archived. NULL if active.

Project Notes

Notes attached to projects.

View: project_notes

ColumnTypeFKNullableDescription
idbigintnoPrimary key.
titlestringyesNote title.
bodystringyesNote body text.
project_idbigintprojects.idnoParent project.
creator_idbigintyesIdentifier of the note creator.
created_atdatetimenoWhen this note was created.
updated_atdatetimenoWhen this note was last updated.
āš ļø

Important: creator_id is not directly joinable with the members table. It uses a different internal ID space.


Time & Resource Planning

Time Entries

Logged time records.

View: time_entries

ColumnTypeFKNullableDescription
idbigintnoPrimary key.
project_idbigintprojects.idnoParent project.
phase_idbigintphases.idyesAssociated phase.
work_category_idbigintwork_categories.idyesAssociated work category.
standard_work_category_idbigintstandard_work_categories.idyesAssociated standard work category.
descriptionstringyesEntry description.
billablebooleanyesWhether this entry is billable.
hoursnumericyesHours logged.
datedateyesDate of the time entry.
ratenumericyesBill rate applied.
cost_ratenumericyesCost rate applied.
member_idbigintmembers.idyesThe member who logged the time.
statusstringyesApproval status. See values below.
created_atdatetimenoWhen this entry was created.
updated_atdatetimenoWhen this entry was last updated.

status values:

ValueMeaning
not_submittedDraft / not yet submitted for approval.
submittedSubmitted and awaiting approval.
approvedApproved.
rejectedRejected by approver.

Work Plans

Resource allocation schedule bars that define planned work over a date range.

View: work_plans

ColumnTypeFKNullableDescription
idbigintnoPrimary key.
project_idbigintprojects.idnoParent project.
phase_idbigintphases.idyesAssociated phase.
standard_work_category_idbigintstandard_work_categories.idyesAssociated standard work category.
work_category_idbigintwork_categories.idyesAssociated work category.
descriptionstringyesWork plan description.
start_datedateyesStart date of the plan.
end_datedateyesEnd date of the plan.
daily_hoursnumericyesHours allocated per day. NULL when weekly planning is enabled.
weekly_hoursnumericyesHours allocated per week. NULL when daily planning is used.
total_hoursnumericyesTotal planned hours for the full date range.
member_idbigintmembers.idyesThe planned member.
project_membership_idbigintproject_memberships.idyesThe project membership.
effective_hoursnumericnoTotal planned hours for this work plan, computed as the sum of its per-day hour breakdowns. Should approximately equal total_hours. Defaults to 0.
created_atdatetimenoWhen this work plan was created.
updated_atdatetimenoWhen this work plan was last updated.
ā„¹ļø

Daily vs. Weekly Planning: Each work plan uses either daily or weekly hour allocation, never both.

  • When daily planning is used: daily_hours contains the value, weekly_hours is NULL.
  • When weekly planning is used: weekly_hours contains the value, daily_hours is NULL.

Relationships Overview

The following describes the key join paths between DDI views:

portfolios
 └── projects (via projects.portfolio_id)
      ā”œā”€ā”€ phases (via phases.project_id)
      │    ā”œā”€ā”€ phases.ancestors[] → other phase IDs (parent chain)
      │    ā”œā”€ā”€ work_categories (via work_categories.phase_id)
      │    └── phase_memberships (via phase_memberships.phase_id)
      ā”œā”€ā”€ project_memberships (via project_memberships.project_id)
      │    ā”œā”€ā”€ project_roles (via project_roles.project_membership_id)
      │    │    └── roles (via project_roles.role_id)
      │    ā”œā”€ā”€ phase_memberships (via phase_memberships.project_membership_id)
      │    ā”œā”€ā”€ project_task_assignments (via project_task_assignments.project_membership_id)
      │    ā”œā”€ā”€ project_scope_assignments (via project_scope_assignments.project_membership_id)
      │    └── work_plans (via work_plans.project_membership_id)
      ā”œā”€ā”€ project_scopes (via project_scopes.project_id)
      │    └── project_scope_assignments (via project_scope_assignments.project_scope_id)
      ā”œā”€ā”€ task_lists (via task_lists.project_id)
      ā”œā”€ā”€ project_tasks (via project_tasks.project_id)
      │    └── project_task_assignments (via project_task_assignments.project_task_id)
      ā”œā”€ā”€ project_notes (via project_notes.project_id)
      ā”œā”€ā”€ time_entries (via time_entries.project_id)
      └── work_plans (via work_plans.project_id)

members
 ā”œā”€ā”€ project_memberships (via project_memberships.member_id)
 ā”œā”€ā”€ phase_memberships (via phase_memberships.member_id)
 ā”œā”€ā”€ project_task_assignments (via project_task_assignments.member_id)
 ā”œā”€ā”€ project_scope_assignments (via project_scope_assignments.member_id)
 ā”œā”€ā”€ time_entries (via time_entries.member_id)
 └── work_plans (via work_plans.member_id)

standard_work_categories
 ā”œā”€ā”€ work_categories (via work_categories.standard_work_category_id)
 ā”œā”€ā”€ project_scopes (via project_scopes.standard_work_category_id)
 ā”œā”€ā”€ project_tasks (via project_tasks.standard_work_category_id)
 ā”œā”€ā”€ time_entries (via time_entries.standard_work_category_id)
 └── work_plans (via work_plans.standard_work_category_id)

Common Query Patterns

Get all active project members with their roles

SELECT
  m.first_name,
  m.last_name,
  p.title AS project_title,
  r.name AS role_name
FROM project_memberships pm
JOIN members m ON m.id = pm.member_id
JOIN projects p ON p.id = pm.project_id
LEFT JOIN project_roles pr ON pr.project_membership_id = pm.id AND pr.archived_at IS NULL
LEFT JOIN roles r ON r.id = pr.role_id
WHERE pm.archived_at IS NULL;

Get time entries with full context

SELECT
  te.date,
  te.hours,
  te.status,
  m.first_name || ' ' || m.last_name AS member_name,
  p.title AS project_title,
  ph.name AS phase_name,
  wc.id AS work_category_id
FROM time_entries te
JOIN members m ON m.id = te.member_id
JOIN projects p ON p.id = te.project_id
LEFT JOIN phases ph ON ph.id = te.phase_id
LEFT JOIN work_categories wc ON wc.id = te.work_category_id;

Compare planned vs. actual hours by project

SELECT
  p.title,
  COALESCE(SUM(wp.total_hours), 0) AS planned_hours,
  COALESCE(SUM(wp.effective_hours), 0) AS effective_hours
FROM work_plans wp
JOIN projects p ON p.id = wp.project_id
GROUP BY p.title
ORDER BY p.title;