-
Notifications
You must be signed in to change notification settings - Fork 18
/
schema.sql
3 lines (3 loc) · 1.13 KB
/
schema.sql
1
2
3
/* (Beta) Export of data model AgriParcelOperation of the subject dataModel.Agrifood for a PostgreSQL database. Pending translation of enumerations and multityped attributes */
CREATE TYPE operationType_type AS ENUM ('fertiliser','inspection','pesticide','water','other');CREATE TYPE result_type AS ENUM ('ok','aborted','failed');CREATE TYPE status_type AS ENUM ('planned','ongoing','finished','scheduled','cancelled');CREATE TYPE AgriParcelOperation_type AS ENUM ('AgriParcelOperation');CREATE TYPE waterSource_type AS ENUM ('borehole','rainfall','river','rainwater capture','water dam','commercial supply');
CREATE TABLE AgriParcelOperation (alternateName TEXT, dataProvider TEXT, dateCreated TIMESTAMP, dateModified TIMESTAMP, description TEXT, endedAt TIMESTAMP, id TEXT PRIMARY KEY, irrigationRecord TEXT, name TEXT, operationType operationType_type, owner JSON, plannedEndAt TIMESTAMP, plannedStartAt TIMESTAMP, quantity NUMERIC, relatedSource JSON, reportedAt TIMESTAMP, result result_type, seeAlso JSON, source TEXT, startedAt TIMESTAMP, status status_type, type AgriParcelOperation_type, waterSource waterSource_type, workOrder TEXT, workRecord TEXT);