Last deployment:

Turfi Platform Documentation

Official Turfi documentation portal for users, admins, and developers.

Back to support

Documentation Search

Search only within Turfi documentation pages.

C

Turfs

Turf registry contract.

Entity: Turfs

1. Overview

  • Field-level infrastructure registry for playable surfaces attached to venues and used directly by game scheduling and event references.
  • Belongs to a venue.
  • Supplies field format and surface metadata used by games and facility operations.
  • Visible at /admin/data/registries/turfs.

2. Database Schema

Columns

columntypenullabledefaultnotes
created_atstringnodatabase default or generatedBase table field.
field_formatstring \nullyesnullBase table field.
idstringnogenerated UUID defaultBase table field.
is_activebooleannodatabase default or generatedBase table field.
is_indoorbooleannodatabase default or generatedBase table field.
is_litbooleannodatabase default or generatedBase table field.
keystringnononeBase table field.
length_mnumber \nullyesnullBase table field.
namestringnononeBase table field.
normalized_namestring \nullyesnullBase table field.
slugstring \nullyesnullBase table field.
statusstringnodatabase default or generatedLifecycle field when present.
surface_typestring \nullyesnullBase table field.
updated_atstringnodatabase default or generatedBase table field.
venue_idstringnononeRelationship-bearing column.
width_mnumber \nullyesnullBase table field.

Foreign Keys

columnreferencestableon delete
venue_ididvenuesNO ACTION

Indexes

No migration-defined indexes were discovered in the checked-in SQL history for this table.

Constraints

  • Unique: none discovered in checked-in migrations.
  • Check: none discovered in checked-in migrations.

Triggers

No migration-defined triggers were discovered in the checked-in SQL history for this table.

Views (if any)

namepurpose
v_turfsCurated admin registry read model for turfs.

3. Import Contract

Accepted Columns

  • key
  • name
  • slug
  • venue_key
  • venue
  • venue_id
  • surface_type
  • field_format
  • is_indoor
  • is_lit
  • length_m
  • width_m
  • status

Resolution Rules

  • venue_key resolves by venue key.
  • Non-suffixed venue input resolves by key, then slug, then name.

Required Fields

  • name
  • venue_key

Optional Fields

  • key
  • slug
  • venue
  • venue_id
  • surface_type
  • field_format
  • is_indoor
  • is_lit
  • length_m
  • width_m
  • status

Failure Rules

  • Venue resolution fails hard because turfs cannot exist safely without a venue.
  • Invalid surface/format/status values fail validation after normalization attempts.

4. Frontend Registry Mapping

Grid Columns

labelfieldsource
Namenamev_turfs.name / turfs.name
Venuevenue_namevenues.name
Addressaddressturf / related venue address
Citycityrelated venue.city
Provinceprovincerelated venue.province
Formatformat_nameturfs.field_format
Typetype_nameturfs.surface_type / type
Statusstatusturfs.status / derived activity flags

Filters

filterfieldtype
Searchname, venue_name, address, city, provincetext substring
Venuevenue_idselect
Formatformat_nameselect
Typetype_nameselect
Provinceprovinceselect
Statusstatusselect

Display Logic

  • Venue-enriched read rows backfill city, province, address, and sometimes status from the related venue.
  • Format and type are normalized display aliases over raw field attributes.

5. Lifecycle Rules

  • Turfs should be marked inactive instead of deleted when they have historical game usage.
  • Venue linkage is mandatory for safe operations because games reference both venue and turf.