diff --git a/backend/.gen/haystack/haystack/model/events.go b/backend/.gen/haystack/haystack/model/events.go index 1c21e6a..19e9bb6 100644 --- a/backend/.gen/haystack/haystack/model/events.go +++ b/backend/.gen/haystack/haystack/model/events.go @@ -9,11 +9,14 @@ package model import ( "github.com/google/uuid" + "time" ) type Events struct { - ID uuid.UUID `sql:"primary_key"` - Name string - Description *string - LocationID *uuid.UUID + ID uuid.UUID `sql:"primary_key"` + Name string + Description *string + StartDateTime *time.Time + EndDateTime *time.Time + LocationID *uuid.UUID } diff --git a/backend/.gen/haystack/haystack/model/locations.go b/backend/.gen/haystack/haystack/model/locations.go index c91c521..0fbdeba 100644 --- a/backend/.gen/haystack/haystack/model/locations.go +++ b/backend/.gen/haystack/haystack/model/locations.go @@ -15,6 +15,5 @@ type Locations struct { ID uuid.UUID `sql:"primary_key"` Name string Address *string - Coordinates *string Description *string } diff --git a/backend/.gen/haystack/haystack/table/events.go b/backend/.gen/haystack/haystack/table/events.go index 965e789..50803f3 100644 --- a/backend/.gen/haystack/haystack/table/events.go +++ b/backend/.gen/haystack/haystack/table/events.go @@ -17,10 +17,12 @@ type eventsTable struct { postgres.Table // Columns - ID postgres.ColumnString - Name postgres.ColumnString - Description postgres.ColumnString - LocationID postgres.ColumnString + ID postgres.ColumnString + Name postgres.ColumnString + Description postgres.ColumnString + StartDateTime postgres.ColumnTimestamp + EndDateTime postgres.ColumnTimestamp + LocationID postgres.ColumnString AllColumns postgres.ColumnList MutableColumns postgres.ColumnList @@ -61,22 +63,26 @@ func newEventsTable(schemaName, tableName, alias string) *EventsTable { func newEventsTableImpl(schemaName, tableName, alias string) eventsTable { var ( - IDColumn = postgres.StringColumn("id") - NameColumn = postgres.StringColumn("name") - DescriptionColumn = postgres.StringColumn("description") - LocationIDColumn = postgres.StringColumn("location_id") - allColumns = postgres.ColumnList{IDColumn, NameColumn, DescriptionColumn, LocationIDColumn} - mutableColumns = postgres.ColumnList{NameColumn, DescriptionColumn, LocationIDColumn} + IDColumn = postgres.StringColumn("id") + NameColumn = postgres.StringColumn("name") + DescriptionColumn = postgres.StringColumn("description") + StartDateTimeColumn = postgres.TimestampColumn("start_date_time") + EndDateTimeColumn = postgres.TimestampColumn("end_date_time") + LocationIDColumn = postgres.StringColumn("location_id") + allColumns = postgres.ColumnList{IDColumn, NameColumn, DescriptionColumn, StartDateTimeColumn, EndDateTimeColumn, LocationIDColumn} + mutableColumns = postgres.ColumnList{NameColumn, DescriptionColumn, StartDateTimeColumn, EndDateTimeColumn, LocationIDColumn} ) return eventsTable{ Table: postgres.NewTable(schemaName, tableName, alias, allColumns...), //Columns - ID: IDColumn, - Name: NameColumn, - Description: DescriptionColumn, - LocationID: LocationIDColumn, + ID: IDColumn, + Name: NameColumn, + Description: DescriptionColumn, + StartDateTime: StartDateTimeColumn, + EndDateTime: EndDateTimeColumn, + LocationID: LocationIDColumn, AllColumns: allColumns, MutableColumns: mutableColumns, diff --git a/backend/.gen/haystack/haystack/table/locations.go b/backend/.gen/haystack/haystack/table/locations.go index 0664d79..c3f13fc 100644 --- a/backend/.gen/haystack/haystack/table/locations.go +++ b/backend/.gen/haystack/haystack/table/locations.go @@ -20,7 +20,6 @@ type locationsTable struct { ID postgres.ColumnString Name postgres.ColumnString Address postgres.ColumnString - Coordinates postgres.ColumnString Description postgres.ColumnString AllColumns postgres.ColumnList @@ -65,10 +64,9 @@ func newLocationsTableImpl(schemaName, tableName, alias string) locationsTable { IDColumn = postgres.StringColumn("id") NameColumn = postgres.StringColumn("name") AddressColumn = postgres.StringColumn("address") - CoordinatesColumn = postgres.StringColumn("coordinates") DescriptionColumn = postgres.StringColumn("description") - allColumns = postgres.ColumnList{IDColumn, NameColumn, AddressColumn, CoordinatesColumn, DescriptionColumn} - mutableColumns = postgres.ColumnList{NameColumn, AddressColumn, CoordinatesColumn, DescriptionColumn} + allColumns = postgres.ColumnList{IDColumn, NameColumn, AddressColumn, DescriptionColumn} + mutableColumns = postgres.ColumnList{NameColumn, AddressColumn, DescriptionColumn} ) return locationsTable{ @@ -78,7 +76,6 @@ func newLocationsTableImpl(schemaName, tableName, alias string) locationsTable { ID: IDColumn, Name: NameColumn, Address: AddressColumn, - Coordinates: CoordinatesColumn, Description: DescriptionColumn, AllColumns: allColumns, diff --git a/backend/schema.sql b/backend/schema.sql index a71f268..1a6bcde 100644 --- a/backend/schema.sql +++ b/backend/schema.sql @@ -54,7 +54,6 @@ CREATE TABLE haystack.locations ( id uuid PRIMARY KEY DEFAULT gen_random_uuid(), name TEXT NOT NULL, address TEXT, - coordinates TEXT, -- Horrible for now. GoJet doesnt support custom types. description TEXT ); @@ -77,6 +76,9 @@ CREATE TABLE haystack.events ( name TEXT NOT NULL, description TEXT, + start_date_time TIMESTAMP, + end_date_time TIMESTAMP, + location_id UUID REFERENCES haystack.locations (id) );