Maker guide

Fields, perspectives and relationships

Define the schema on the maker site.

The schema is the fields, the perspectives that group them, and the relationships between perspectives. The maker site has a page for each. Read Entities and perspectives first if the model is new to you.

Fields

Fields lists the field catalogue: each field's system name, type, display name and the perspectives that use it. The search box filters the list.

Fields: each field's system name, type and display name, and the perspectives that use it.
Fields
The field catalogue: every field, its type, and the perspectives that use it.

The field catalogue: every field, its type, and the perspectives that use it.

To add one, press New field… and enter its system name (the JSON key, such as creditLimit). Then choose:

  • the type: Text, Integer, Decimal, Boolean, DateTime, Reference or Json. It can't change once saved.
  • the display name, which forms and views show;
  • an optional description.

Then Save. Display names and descriptions can be changed later.

Perspectives

Perspectives shows each perspective's id, its relationships, its display name and description, and its fields.

The Customer perspective's fields, in order, with Account Number required.
Perspectives
A perspective's fields, in order, with the ones it requires ticked.

A perspective's fields, in order, with the ones it requires ticked.

  • Add fields from the catalogue.
  • Tick the fields the perspective requires. Requiredness belongs to the perspective, so the same field can be required in one and optional in another.
  • Remove fields. A field that a relationship uses can't be removed while the relationship exists.
  • Drag fields into order, or use Alt+↑ and Alt+↓. The order is the one forms use for All fields.

New perspective… asks for the name. Press Save to send your changes.

Making a field required doesn't re-check the entities already stored. They'll fail validation the next time they're saved without it.

Relationships

Relationships lists the relationships between perspectives, with their kind and ends. New relationship… asks for the name. Then, for each end, choose:

  • the perspective;
  • the multiplicity, One or Many;
  • for a Many end, the reference field, from that perspective's Reference fields.
The CustomerOrders relationship: one customer, many orders through the order's customer field.
Relationships
Relationships between perspectives, such as a customer's orders, which the database keeps consistent.

Relationships between perspectives, such as a customer's orders, which the database keeps consistent.

Save defines it. The database checks the data already stored, and refuses the relationship (listing the problems) if any entity breaks it. Delete asks first; the data and the field's index are kept.

You wantFromTo
A customer's ordersCustomer, OneOrder, Many, field customer
A staff member's managerStaff, Many, field managerStaff, One
A badge for one staff memberBadge, One, field holderStaff, One

See Relationships for what the database enforces.

Other ways to change the schema

  • occtl: occtl schema field set, occtl schema perspective set, occtl schema relationship set.
  • OmniCore Admin: the Fields, Perspectives and Relationships tabs.
  • A plugin's manifest, applied when the plugin is installed.
  • The REST API.