diff --git a/backend/.gen/haystack/haystack/model/contacts.go b/backend/.gen/haystack/haystack/model/contacts.go index da61883..1383cb0 100644 --- a/backend/.gen/haystack/haystack/model/contacts.go +++ b/backend/.gen/haystack/haystack/model/contacts.go @@ -9,6 +9,7 @@ package model import ( "github.com/google/uuid" + "time" ) type Contacts struct { @@ -17,4 +18,5 @@ type Contacts struct { Description *string PhoneNumber *string Email *string + CreatedAt *time.Time } diff --git a/backend/.gen/haystack/haystack/model/events.go b/backend/.gen/haystack/haystack/model/events.go index 42ee4d1..a18556b 100644 --- a/backend/.gen/haystack/haystack/model/events.go +++ b/backend/.gen/haystack/haystack/model/events.go @@ -20,4 +20,5 @@ type Events struct { EndDateTime *time.Time LocationID *uuid.UUID OrganizerID *uuid.UUID + CreatedAt *time.Time } diff --git a/backend/.gen/haystack/haystack/model/image_contacts.go b/backend/.gen/haystack/haystack/model/image_contacts.go index 7139e7f..1168963 100644 --- a/backend/.gen/haystack/haystack/model/image_contacts.go +++ b/backend/.gen/haystack/haystack/model/image_contacts.go @@ -9,10 +9,12 @@ package model import ( "github.com/google/uuid" + "time" ) type ImageContacts struct { ID uuid.UUID `sql:"primary_key"` ImageID uuid.UUID ContactID uuid.UUID + CreatedAt *time.Time } diff --git a/backend/.gen/haystack/haystack/model/image_events.go b/backend/.gen/haystack/haystack/model/image_events.go index 66cc398..0162272 100644 --- a/backend/.gen/haystack/haystack/model/image_events.go +++ b/backend/.gen/haystack/haystack/model/image_events.go @@ -9,10 +9,12 @@ package model import ( "github.com/google/uuid" + "time" ) type ImageEvents struct { - ID uuid.UUID `sql:"primary_key"` - EventID uuid.UUID - ImageID uuid.UUID + ID uuid.UUID `sql:"primary_key"` + EventID uuid.UUID + ImageID uuid.UUID + CreatedAt *time.Time } diff --git a/backend/.gen/haystack/haystack/model/image_locations.go b/backend/.gen/haystack/haystack/model/image_locations.go index 8feca46..d954957 100644 --- a/backend/.gen/haystack/haystack/model/image_locations.go +++ b/backend/.gen/haystack/haystack/model/image_locations.go @@ -9,10 +9,12 @@ package model import ( "github.com/google/uuid" + "time" ) type ImageLocations struct { ID uuid.UUID `sql:"primary_key"` LocationID uuid.UUID ImageID uuid.UUID + CreatedAt *time.Time } diff --git a/backend/.gen/haystack/haystack/model/image_notes.go b/backend/.gen/haystack/haystack/model/image_notes.go index 755a16c..021af48 100644 --- a/backend/.gen/haystack/haystack/model/image_notes.go +++ b/backend/.gen/haystack/haystack/model/image_notes.go @@ -9,10 +9,12 @@ package model import ( "github.com/google/uuid" + "time" ) type ImageNotes struct { - ID uuid.UUID `sql:"primary_key"` - ImageID uuid.UUID - NoteID uuid.UUID + ID uuid.UUID `sql:"primary_key"` + ImageID uuid.UUID + NoteID uuid.UUID + CreatedAt *time.Time } diff --git a/backend/.gen/haystack/haystack/model/locations.go b/backend/.gen/haystack/haystack/model/locations.go index 0fbdeba..a9efbce 100644 --- a/backend/.gen/haystack/haystack/model/locations.go +++ b/backend/.gen/haystack/haystack/model/locations.go @@ -9,6 +9,7 @@ package model import ( "github.com/google/uuid" + "time" ) type Locations struct { @@ -16,4 +17,5 @@ type Locations struct { Name string Address *string Description *string + CreatedAt *time.Time } diff --git a/backend/.gen/haystack/haystack/model/logs.go b/backend/.gen/haystack/haystack/model/logs.go index f91d73b..7f2ebe5 100644 --- a/backend/.gen/haystack/haystack/model/logs.go +++ b/backend/.gen/haystack/haystack/model/logs.go @@ -9,9 +9,11 @@ package model import ( "github.com/google/uuid" + "time" ) type Logs struct { - Log string - ImageID uuid.UUID + Log string + ImageID uuid.UUID + CreatedAt *time.Time } diff --git a/backend/.gen/haystack/haystack/model/notes.go b/backend/.gen/haystack/haystack/model/notes.go index 68ad546..dd6f792 100644 --- a/backend/.gen/haystack/haystack/model/notes.go +++ b/backend/.gen/haystack/haystack/model/notes.go @@ -9,6 +9,7 @@ package model import ( "github.com/google/uuid" + "time" ) type Notes struct { @@ -16,4 +17,5 @@ type Notes struct { Name string Description *string Content string + CreatedAt *time.Time } diff --git a/backend/.gen/haystack/haystack/model/user_contacts.go b/backend/.gen/haystack/haystack/model/user_contacts.go index c48c9a6..2ea1363 100644 --- a/backend/.gen/haystack/haystack/model/user_contacts.go +++ b/backend/.gen/haystack/haystack/model/user_contacts.go @@ -9,10 +9,12 @@ package model import ( "github.com/google/uuid" + "time" ) type UserContacts struct { ID uuid.UUID `sql:"primary_key"` UserID uuid.UUID ContactID uuid.UUID + CreatedAt *time.Time } diff --git a/backend/.gen/haystack/haystack/model/user_events.go b/backend/.gen/haystack/haystack/model/user_events.go index ecd993c..63ad70d 100644 --- a/backend/.gen/haystack/haystack/model/user_events.go +++ b/backend/.gen/haystack/haystack/model/user_events.go @@ -9,10 +9,12 @@ package model import ( "github.com/google/uuid" + "time" ) type UserEvents struct { - ID uuid.UUID `sql:"primary_key"` - EventID uuid.UUID - UserID uuid.UUID + ID uuid.UUID `sql:"primary_key"` + EventID uuid.UUID + UserID uuid.UUID + CreatedAt *time.Time } diff --git a/backend/.gen/haystack/haystack/model/user_images.go b/backend/.gen/haystack/haystack/model/user_images.go index d6b4998..b7dddc4 100644 --- a/backend/.gen/haystack/haystack/model/user_images.go +++ b/backend/.gen/haystack/haystack/model/user_images.go @@ -9,10 +9,12 @@ package model import ( "github.com/google/uuid" + "time" ) type UserImages struct { - ID uuid.UUID `sql:"primary_key"` - ImageID uuid.UUID - UserID uuid.UUID + ID uuid.UUID `sql:"primary_key"` + ImageID uuid.UUID + UserID uuid.UUID + CreatedAt *time.Time } diff --git a/backend/.gen/haystack/haystack/model/user_locations.go b/backend/.gen/haystack/haystack/model/user_locations.go index 95c3a7e..2869d60 100644 --- a/backend/.gen/haystack/haystack/model/user_locations.go +++ b/backend/.gen/haystack/haystack/model/user_locations.go @@ -9,10 +9,12 @@ package model import ( "github.com/google/uuid" + "time" ) type UserLocations struct { ID uuid.UUID `sql:"primary_key"` LocationID uuid.UUID UserID uuid.UUID + CreatedAt *time.Time } diff --git a/backend/.gen/haystack/haystack/model/user_notes.go b/backend/.gen/haystack/haystack/model/user_notes.go index e770bb3..ce39ae5 100644 --- a/backend/.gen/haystack/haystack/model/user_notes.go +++ b/backend/.gen/haystack/haystack/model/user_notes.go @@ -9,10 +9,12 @@ package model import ( "github.com/google/uuid" + "time" ) type UserNotes struct { - ID uuid.UUID `sql:"primary_key"` - UserID uuid.UUID - NoteID uuid.UUID + ID uuid.UUID `sql:"primary_key"` + UserID uuid.UUID + NoteID uuid.UUID + CreatedAt *time.Time } diff --git a/backend/.gen/haystack/haystack/table/contacts.go b/backend/.gen/haystack/haystack/table/contacts.go index e849d5d..7371f49 100644 --- a/backend/.gen/haystack/haystack/table/contacts.go +++ b/backend/.gen/haystack/haystack/table/contacts.go @@ -22,6 +22,7 @@ type contactsTable struct { Description postgres.ColumnString PhoneNumber postgres.ColumnString Email postgres.ColumnString + CreatedAt postgres.ColumnTimestampz AllColumns postgres.ColumnList MutableColumns postgres.ColumnList @@ -67,8 +68,9 @@ func newContactsTableImpl(schemaName, tableName, alias string) contactsTable { DescriptionColumn = postgres.StringColumn("description") PhoneNumberColumn = postgres.StringColumn("phone_number") EmailColumn = postgres.StringColumn("email") - allColumns = postgres.ColumnList{IDColumn, NameColumn, DescriptionColumn, PhoneNumberColumn, EmailColumn} - mutableColumns = postgres.ColumnList{NameColumn, DescriptionColumn, PhoneNumberColumn, EmailColumn} + CreatedAtColumn = postgres.TimestampzColumn("created_at") + allColumns = postgres.ColumnList{IDColumn, NameColumn, DescriptionColumn, PhoneNumberColumn, EmailColumn, CreatedAtColumn} + mutableColumns = postgres.ColumnList{NameColumn, DescriptionColumn, PhoneNumberColumn, EmailColumn, CreatedAtColumn} ) return contactsTable{ @@ -80,6 +82,7 @@ func newContactsTableImpl(schemaName, tableName, alias string) contactsTable { Description: DescriptionColumn, PhoneNumber: PhoneNumberColumn, Email: EmailColumn, + CreatedAt: CreatedAtColumn, AllColumns: allColumns, MutableColumns: mutableColumns, diff --git a/backend/.gen/haystack/haystack/table/events.go b/backend/.gen/haystack/haystack/table/events.go index 2bdb14b..b5e61f4 100644 --- a/backend/.gen/haystack/haystack/table/events.go +++ b/backend/.gen/haystack/haystack/table/events.go @@ -24,6 +24,7 @@ type eventsTable struct { EndDateTime postgres.ColumnTimestamp LocationID postgres.ColumnString OrganizerID postgres.ColumnString + CreatedAt postgres.ColumnTimestampz AllColumns postgres.ColumnList MutableColumns postgres.ColumnList @@ -71,8 +72,9 @@ func newEventsTableImpl(schemaName, tableName, alias string) eventsTable { EndDateTimeColumn = postgres.TimestampColumn("end_date_time") LocationIDColumn = postgres.StringColumn("location_id") OrganizerIDColumn = postgres.StringColumn("organizer_id") - allColumns = postgres.ColumnList{IDColumn, NameColumn, DescriptionColumn, StartDateTimeColumn, EndDateTimeColumn, LocationIDColumn, OrganizerIDColumn} - mutableColumns = postgres.ColumnList{NameColumn, DescriptionColumn, StartDateTimeColumn, EndDateTimeColumn, LocationIDColumn, OrganizerIDColumn} + CreatedAtColumn = postgres.TimestampzColumn("created_at") + allColumns = postgres.ColumnList{IDColumn, NameColumn, DescriptionColumn, StartDateTimeColumn, EndDateTimeColumn, LocationIDColumn, OrganizerIDColumn, CreatedAtColumn} + mutableColumns = postgres.ColumnList{NameColumn, DescriptionColumn, StartDateTimeColumn, EndDateTimeColumn, LocationIDColumn, OrganizerIDColumn, CreatedAtColumn} ) return eventsTable{ @@ -86,6 +88,7 @@ func newEventsTableImpl(schemaName, tableName, alias string) eventsTable { EndDateTime: EndDateTimeColumn, LocationID: LocationIDColumn, OrganizerID: OrganizerIDColumn, + CreatedAt: CreatedAtColumn, AllColumns: allColumns, MutableColumns: mutableColumns, diff --git a/backend/.gen/haystack/haystack/table/image_contacts.go b/backend/.gen/haystack/haystack/table/image_contacts.go index a94589e..ac44341 100644 --- a/backend/.gen/haystack/haystack/table/image_contacts.go +++ b/backend/.gen/haystack/haystack/table/image_contacts.go @@ -20,6 +20,7 @@ type imageContactsTable struct { ID postgres.ColumnString ImageID postgres.ColumnString ContactID postgres.ColumnString + CreatedAt postgres.ColumnTimestampz AllColumns postgres.ColumnList MutableColumns postgres.ColumnList @@ -63,8 +64,9 @@ func newImageContactsTableImpl(schemaName, tableName, alias string) imageContact IDColumn = postgres.StringColumn("id") ImageIDColumn = postgres.StringColumn("image_id") ContactIDColumn = postgres.StringColumn("contact_id") - allColumns = postgres.ColumnList{IDColumn, ImageIDColumn, ContactIDColumn} - mutableColumns = postgres.ColumnList{ImageIDColumn, ContactIDColumn} + CreatedAtColumn = postgres.TimestampzColumn("created_at") + allColumns = postgres.ColumnList{IDColumn, ImageIDColumn, ContactIDColumn, CreatedAtColumn} + mutableColumns = postgres.ColumnList{ImageIDColumn, ContactIDColumn, CreatedAtColumn} ) return imageContactsTable{ @@ -74,6 +76,7 @@ func newImageContactsTableImpl(schemaName, tableName, alias string) imageContact ID: IDColumn, ImageID: ImageIDColumn, ContactID: ContactIDColumn, + CreatedAt: CreatedAtColumn, AllColumns: allColumns, MutableColumns: mutableColumns, diff --git a/backend/.gen/haystack/haystack/table/image_events.go b/backend/.gen/haystack/haystack/table/image_events.go index 385cce2..62a0c92 100644 --- a/backend/.gen/haystack/haystack/table/image_events.go +++ b/backend/.gen/haystack/haystack/table/image_events.go @@ -17,9 +17,10 @@ type imageEventsTable struct { postgres.Table // Columns - ID postgres.ColumnString - EventID postgres.ColumnString - ImageID postgres.ColumnString + ID postgres.ColumnString + EventID postgres.ColumnString + ImageID postgres.ColumnString + CreatedAt postgres.ColumnTimestampz AllColumns postgres.ColumnList MutableColumns postgres.ColumnList @@ -60,20 +61,22 @@ func newImageEventsTable(schemaName, tableName, alias string) *ImageEventsTable func newImageEventsTableImpl(schemaName, tableName, alias string) imageEventsTable { var ( - IDColumn = postgres.StringColumn("id") - EventIDColumn = postgres.StringColumn("event_id") - ImageIDColumn = postgres.StringColumn("image_id") - allColumns = postgres.ColumnList{IDColumn, EventIDColumn, ImageIDColumn} - mutableColumns = postgres.ColumnList{EventIDColumn, ImageIDColumn} + IDColumn = postgres.StringColumn("id") + EventIDColumn = postgres.StringColumn("event_id") + ImageIDColumn = postgres.StringColumn("image_id") + CreatedAtColumn = postgres.TimestampzColumn("created_at") + allColumns = postgres.ColumnList{IDColumn, EventIDColumn, ImageIDColumn, CreatedAtColumn} + mutableColumns = postgres.ColumnList{EventIDColumn, ImageIDColumn, CreatedAtColumn} ) return imageEventsTable{ Table: postgres.NewTable(schemaName, tableName, alias, allColumns...), //Columns - ID: IDColumn, - EventID: EventIDColumn, - ImageID: ImageIDColumn, + ID: IDColumn, + EventID: EventIDColumn, + ImageID: ImageIDColumn, + CreatedAt: CreatedAtColumn, AllColumns: allColumns, MutableColumns: mutableColumns, diff --git a/backend/.gen/haystack/haystack/table/image_locations.go b/backend/.gen/haystack/haystack/table/image_locations.go index 70cf057..b209bdd 100644 --- a/backend/.gen/haystack/haystack/table/image_locations.go +++ b/backend/.gen/haystack/haystack/table/image_locations.go @@ -20,6 +20,7 @@ type imageLocationsTable struct { ID postgres.ColumnString LocationID postgres.ColumnString ImageID postgres.ColumnString + CreatedAt postgres.ColumnTimestampz AllColumns postgres.ColumnList MutableColumns postgres.ColumnList @@ -63,8 +64,9 @@ func newImageLocationsTableImpl(schemaName, tableName, alias string) imageLocati IDColumn = postgres.StringColumn("id") LocationIDColumn = postgres.StringColumn("location_id") ImageIDColumn = postgres.StringColumn("image_id") - allColumns = postgres.ColumnList{IDColumn, LocationIDColumn, ImageIDColumn} - mutableColumns = postgres.ColumnList{LocationIDColumn, ImageIDColumn} + CreatedAtColumn = postgres.TimestampzColumn("created_at") + allColumns = postgres.ColumnList{IDColumn, LocationIDColumn, ImageIDColumn, CreatedAtColumn} + mutableColumns = postgres.ColumnList{LocationIDColumn, ImageIDColumn, CreatedAtColumn} ) return imageLocationsTable{ @@ -74,6 +76,7 @@ func newImageLocationsTableImpl(schemaName, tableName, alias string) imageLocati ID: IDColumn, LocationID: LocationIDColumn, ImageID: ImageIDColumn, + CreatedAt: CreatedAtColumn, AllColumns: allColumns, MutableColumns: mutableColumns, diff --git a/backend/.gen/haystack/haystack/table/image_notes.go b/backend/.gen/haystack/haystack/table/image_notes.go index c0e50c1..6a23f61 100644 --- a/backend/.gen/haystack/haystack/table/image_notes.go +++ b/backend/.gen/haystack/haystack/table/image_notes.go @@ -17,9 +17,10 @@ type imageNotesTable struct { postgres.Table // Columns - ID postgres.ColumnString - ImageID postgres.ColumnString - NoteID postgres.ColumnString + ID postgres.ColumnString + ImageID postgres.ColumnString + NoteID postgres.ColumnString + CreatedAt postgres.ColumnTimestampz AllColumns postgres.ColumnList MutableColumns postgres.ColumnList @@ -60,20 +61,22 @@ func newImageNotesTable(schemaName, tableName, alias string) *ImageNotesTable { func newImageNotesTableImpl(schemaName, tableName, alias string) imageNotesTable { var ( - IDColumn = postgres.StringColumn("id") - ImageIDColumn = postgres.StringColumn("image_id") - NoteIDColumn = postgres.StringColumn("note_id") - allColumns = postgres.ColumnList{IDColumn, ImageIDColumn, NoteIDColumn} - mutableColumns = postgres.ColumnList{ImageIDColumn, NoteIDColumn} + IDColumn = postgres.StringColumn("id") + ImageIDColumn = postgres.StringColumn("image_id") + NoteIDColumn = postgres.StringColumn("note_id") + CreatedAtColumn = postgres.TimestampzColumn("created_at") + allColumns = postgres.ColumnList{IDColumn, ImageIDColumn, NoteIDColumn, CreatedAtColumn} + mutableColumns = postgres.ColumnList{ImageIDColumn, NoteIDColumn, CreatedAtColumn} ) return imageNotesTable{ Table: postgres.NewTable(schemaName, tableName, alias, allColumns...), //Columns - ID: IDColumn, - ImageID: ImageIDColumn, - NoteID: NoteIDColumn, + ID: IDColumn, + ImageID: ImageIDColumn, + NoteID: NoteIDColumn, + CreatedAt: CreatedAtColumn, AllColumns: allColumns, MutableColumns: mutableColumns, diff --git a/backend/.gen/haystack/haystack/table/locations.go b/backend/.gen/haystack/haystack/table/locations.go index c3f13fc..d42d0a8 100644 --- a/backend/.gen/haystack/haystack/table/locations.go +++ b/backend/.gen/haystack/haystack/table/locations.go @@ -21,6 +21,7 @@ type locationsTable struct { Name postgres.ColumnString Address postgres.ColumnString Description postgres.ColumnString + CreatedAt postgres.ColumnTimestampz AllColumns postgres.ColumnList MutableColumns postgres.ColumnList @@ -65,8 +66,9 @@ func newLocationsTableImpl(schemaName, tableName, alias string) locationsTable { NameColumn = postgres.StringColumn("name") AddressColumn = postgres.StringColumn("address") DescriptionColumn = postgres.StringColumn("description") - allColumns = postgres.ColumnList{IDColumn, NameColumn, AddressColumn, DescriptionColumn} - mutableColumns = postgres.ColumnList{NameColumn, AddressColumn, DescriptionColumn} + CreatedAtColumn = postgres.TimestampzColumn("created_at") + allColumns = postgres.ColumnList{IDColumn, NameColumn, AddressColumn, DescriptionColumn, CreatedAtColumn} + mutableColumns = postgres.ColumnList{NameColumn, AddressColumn, DescriptionColumn, CreatedAtColumn} ) return locationsTable{ @@ -77,6 +79,7 @@ func newLocationsTableImpl(schemaName, tableName, alias string) locationsTable { Name: NameColumn, Address: AddressColumn, Description: DescriptionColumn, + CreatedAt: CreatedAtColumn, AllColumns: allColumns, MutableColumns: mutableColumns, diff --git a/backend/.gen/haystack/haystack/table/logs.go b/backend/.gen/haystack/haystack/table/logs.go index 978719f..fccc691 100644 --- a/backend/.gen/haystack/haystack/table/logs.go +++ b/backend/.gen/haystack/haystack/table/logs.go @@ -17,8 +17,9 @@ type logsTable struct { postgres.Table // Columns - Log postgres.ColumnString - ImageID postgres.ColumnString + Log postgres.ColumnString + ImageID postgres.ColumnString + CreatedAt postgres.ColumnTimestampz AllColumns postgres.ColumnList MutableColumns postgres.ColumnList @@ -59,18 +60,20 @@ func newLogsTable(schemaName, tableName, alias string) *LogsTable { func newLogsTableImpl(schemaName, tableName, alias string) logsTable { var ( - LogColumn = postgres.StringColumn("log") - ImageIDColumn = postgres.StringColumn("image_id") - allColumns = postgres.ColumnList{LogColumn, ImageIDColumn} - mutableColumns = postgres.ColumnList{LogColumn, ImageIDColumn} + LogColumn = postgres.StringColumn("log") + ImageIDColumn = postgres.StringColumn("image_id") + CreatedAtColumn = postgres.TimestampzColumn("created_at") + allColumns = postgres.ColumnList{LogColumn, ImageIDColumn, CreatedAtColumn} + mutableColumns = postgres.ColumnList{LogColumn, ImageIDColumn, CreatedAtColumn} ) return logsTable{ Table: postgres.NewTable(schemaName, tableName, alias, allColumns...), //Columns - Log: LogColumn, - ImageID: ImageIDColumn, + Log: LogColumn, + ImageID: ImageIDColumn, + CreatedAt: CreatedAtColumn, AllColumns: allColumns, MutableColumns: mutableColumns, diff --git a/backend/.gen/haystack/haystack/table/notes.go b/backend/.gen/haystack/haystack/table/notes.go index 859d5c6..1004a79 100644 --- a/backend/.gen/haystack/haystack/table/notes.go +++ b/backend/.gen/haystack/haystack/table/notes.go @@ -21,6 +21,7 @@ type notesTable struct { Name postgres.ColumnString Description postgres.ColumnString Content postgres.ColumnString + CreatedAt postgres.ColumnTimestampz AllColumns postgres.ColumnList MutableColumns postgres.ColumnList @@ -65,8 +66,9 @@ func newNotesTableImpl(schemaName, tableName, alias string) notesTable { NameColumn = postgres.StringColumn("name") DescriptionColumn = postgres.StringColumn("description") ContentColumn = postgres.StringColumn("content") - allColumns = postgres.ColumnList{IDColumn, NameColumn, DescriptionColumn, ContentColumn} - mutableColumns = postgres.ColumnList{NameColumn, DescriptionColumn, ContentColumn} + CreatedAtColumn = postgres.TimestampzColumn("created_at") + allColumns = postgres.ColumnList{IDColumn, NameColumn, DescriptionColumn, ContentColumn, CreatedAtColumn} + mutableColumns = postgres.ColumnList{NameColumn, DescriptionColumn, ContentColumn, CreatedAtColumn} ) return notesTable{ @@ -77,6 +79,7 @@ func newNotesTableImpl(schemaName, tableName, alias string) notesTable { Name: NameColumn, Description: DescriptionColumn, Content: ContentColumn, + CreatedAt: CreatedAtColumn, AllColumns: allColumns, MutableColumns: mutableColumns, diff --git a/backend/.gen/haystack/haystack/table/user_contacts.go b/backend/.gen/haystack/haystack/table/user_contacts.go index 954f9a2..53ce58e 100644 --- a/backend/.gen/haystack/haystack/table/user_contacts.go +++ b/backend/.gen/haystack/haystack/table/user_contacts.go @@ -20,6 +20,7 @@ type userContactsTable struct { ID postgres.ColumnString UserID postgres.ColumnString ContactID postgres.ColumnString + CreatedAt postgres.ColumnTimestampz AllColumns postgres.ColumnList MutableColumns postgres.ColumnList @@ -63,8 +64,9 @@ func newUserContactsTableImpl(schemaName, tableName, alias string) userContactsT IDColumn = postgres.StringColumn("id") UserIDColumn = postgres.StringColumn("user_id") ContactIDColumn = postgres.StringColumn("contact_id") - allColumns = postgres.ColumnList{IDColumn, UserIDColumn, ContactIDColumn} - mutableColumns = postgres.ColumnList{UserIDColumn, ContactIDColumn} + CreatedAtColumn = postgres.TimestampzColumn("created_at") + allColumns = postgres.ColumnList{IDColumn, UserIDColumn, ContactIDColumn, CreatedAtColumn} + mutableColumns = postgres.ColumnList{UserIDColumn, ContactIDColumn, CreatedAtColumn} ) return userContactsTable{ @@ -74,6 +76,7 @@ func newUserContactsTableImpl(schemaName, tableName, alias string) userContactsT ID: IDColumn, UserID: UserIDColumn, ContactID: ContactIDColumn, + CreatedAt: CreatedAtColumn, AllColumns: allColumns, MutableColumns: mutableColumns, diff --git a/backend/.gen/haystack/haystack/table/user_events.go b/backend/.gen/haystack/haystack/table/user_events.go index 5090222..4c5718d 100644 --- a/backend/.gen/haystack/haystack/table/user_events.go +++ b/backend/.gen/haystack/haystack/table/user_events.go @@ -17,9 +17,10 @@ type userEventsTable struct { postgres.Table // Columns - ID postgres.ColumnString - EventID postgres.ColumnString - UserID postgres.ColumnString + ID postgres.ColumnString + EventID postgres.ColumnString + UserID postgres.ColumnString + CreatedAt postgres.ColumnTimestampz AllColumns postgres.ColumnList MutableColumns postgres.ColumnList @@ -60,20 +61,22 @@ func newUserEventsTable(schemaName, tableName, alias string) *UserEventsTable { func newUserEventsTableImpl(schemaName, tableName, alias string) userEventsTable { var ( - IDColumn = postgres.StringColumn("id") - EventIDColumn = postgres.StringColumn("event_id") - UserIDColumn = postgres.StringColumn("user_id") - allColumns = postgres.ColumnList{IDColumn, EventIDColumn, UserIDColumn} - mutableColumns = postgres.ColumnList{EventIDColumn, UserIDColumn} + IDColumn = postgres.StringColumn("id") + EventIDColumn = postgres.StringColumn("event_id") + UserIDColumn = postgres.StringColumn("user_id") + CreatedAtColumn = postgres.TimestampzColumn("created_at") + allColumns = postgres.ColumnList{IDColumn, EventIDColumn, UserIDColumn, CreatedAtColumn} + mutableColumns = postgres.ColumnList{EventIDColumn, UserIDColumn, CreatedAtColumn} ) return userEventsTable{ Table: postgres.NewTable(schemaName, tableName, alias, allColumns...), //Columns - ID: IDColumn, - EventID: EventIDColumn, - UserID: UserIDColumn, + ID: IDColumn, + EventID: EventIDColumn, + UserID: UserIDColumn, + CreatedAt: CreatedAtColumn, AllColumns: allColumns, MutableColumns: mutableColumns, diff --git a/backend/.gen/haystack/haystack/table/user_images.go b/backend/.gen/haystack/haystack/table/user_images.go index 5e82a2b..e820699 100644 --- a/backend/.gen/haystack/haystack/table/user_images.go +++ b/backend/.gen/haystack/haystack/table/user_images.go @@ -17,9 +17,10 @@ type userImagesTable struct { postgres.Table // Columns - ID postgres.ColumnString - ImageID postgres.ColumnString - UserID postgres.ColumnString + ID postgres.ColumnString + ImageID postgres.ColumnString + UserID postgres.ColumnString + CreatedAt postgres.ColumnTimestampz AllColumns postgres.ColumnList MutableColumns postgres.ColumnList @@ -60,20 +61,22 @@ func newUserImagesTable(schemaName, tableName, alias string) *UserImagesTable { func newUserImagesTableImpl(schemaName, tableName, alias string) userImagesTable { var ( - IDColumn = postgres.StringColumn("id") - ImageIDColumn = postgres.StringColumn("image_id") - UserIDColumn = postgres.StringColumn("user_id") - allColumns = postgres.ColumnList{IDColumn, ImageIDColumn, UserIDColumn} - mutableColumns = postgres.ColumnList{ImageIDColumn, UserIDColumn} + IDColumn = postgres.StringColumn("id") + ImageIDColumn = postgres.StringColumn("image_id") + UserIDColumn = postgres.StringColumn("user_id") + CreatedAtColumn = postgres.TimestampzColumn("created_at") + allColumns = postgres.ColumnList{IDColumn, ImageIDColumn, UserIDColumn, CreatedAtColumn} + mutableColumns = postgres.ColumnList{ImageIDColumn, UserIDColumn, CreatedAtColumn} ) return userImagesTable{ Table: postgres.NewTable(schemaName, tableName, alias, allColumns...), //Columns - ID: IDColumn, - ImageID: ImageIDColumn, - UserID: UserIDColumn, + ID: IDColumn, + ImageID: ImageIDColumn, + UserID: UserIDColumn, + CreatedAt: CreatedAtColumn, AllColumns: allColumns, MutableColumns: mutableColumns, diff --git a/backend/.gen/haystack/haystack/table/user_locations.go b/backend/.gen/haystack/haystack/table/user_locations.go index 3208f25..adc41a1 100644 --- a/backend/.gen/haystack/haystack/table/user_locations.go +++ b/backend/.gen/haystack/haystack/table/user_locations.go @@ -20,6 +20,7 @@ type userLocationsTable struct { ID postgres.ColumnString LocationID postgres.ColumnString UserID postgres.ColumnString + CreatedAt postgres.ColumnTimestampz AllColumns postgres.ColumnList MutableColumns postgres.ColumnList @@ -63,8 +64,9 @@ func newUserLocationsTableImpl(schemaName, tableName, alias string) userLocation IDColumn = postgres.StringColumn("id") LocationIDColumn = postgres.StringColumn("location_id") UserIDColumn = postgres.StringColumn("user_id") - allColumns = postgres.ColumnList{IDColumn, LocationIDColumn, UserIDColumn} - mutableColumns = postgres.ColumnList{LocationIDColumn, UserIDColumn} + CreatedAtColumn = postgres.TimestampzColumn("created_at") + allColumns = postgres.ColumnList{IDColumn, LocationIDColumn, UserIDColumn, CreatedAtColumn} + mutableColumns = postgres.ColumnList{LocationIDColumn, UserIDColumn, CreatedAtColumn} ) return userLocationsTable{ @@ -74,6 +76,7 @@ func newUserLocationsTableImpl(schemaName, tableName, alias string) userLocation ID: IDColumn, LocationID: LocationIDColumn, UserID: UserIDColumn, + CreatedAt: CreatedAtColumn, AllColumns: allColumns, MutableColumns: mutableColumns, diff --git a/backend/.gen/haystack/haystack/table/user_notes.go b/backend/.gen/haystack/haystack/table/user_notes.go index 9241cc1..0c9d638 100644 --- a/backend/.gen/haystack/haystack/table/user_notes.go +++ b/backend/.gen/haystack/haystack/table/user_notes.go @@ -17,9 +17,10 @@ type userNotesTable struct { postgres.Table // Columns - ID postgres.ColumnString - UserID postgres.ColumnString - NoteID postgres.ColumnString + ID postgres.ColumnString + UserID postgres.ColumnString + NoteID postgres.ColumnString + CreatedAt postgres.ColumnTimestampz AllColumns postgres.ColumnList MutableColumns postgres.ColumnList @@ -60,20 +61,22 @@ func newUserNotesTable(schemaName, tableName, alias string) *UserNotesTable { func newUserNotesTableImpl(schemaName, tableName, alias string) userNotesTable { var ( - IDColumn = postgres.StringColumn("id") - UserIDColumn = postgres.StringColumn("user_id") - NoteIDColumn = postgres.StringColumn("note_id") - allColumns = postgres.ColumnList{IDColumn, UserIDColumn, NoteIDColumn} - mutableColumns = postgres.ColumnList{UserIDColumn, NoteIDColumn} + IDColumn = postgres.StringColumn("id") + UserIDColumn = postgres.StringColumn("user_id") + NoteIDColumn = postgres.StringColumn("note_id") + CreatedAtColumn = postgres.TimestampzColumn("created_at") + allColumns = postgres.ColumnList{IDColumn, UserIDColumn, NoteIDColumn, CreatedAtColumn} + mutableColumns = postgres.ColumnList{UserIDColumn, NoteIDColumn, CreatedAtColumn} ) return userNotesTable{ Table: postgres.NewTable(schemaName, tableName, alias, allColumns...), //Columns - ID: IDColumn, - UserID: UserIDColumn, - NoteID: NoteIDColumn, + ID: IDColumn, + UserID: UserIDColumn, + NoteID: NoteIDColumn, + CreatedAt: CreatedAtColumn, AllColumns: allColumns, MutableColumns: mutableColumns, diff --git a/backend/schema.sql b/backend/schema.sql index daff7e2..cf4d16f 100644 --- a/backend/schema.sql +++ b/backend/schema.sql @@ -29,9 +29,13 @@ CREATE TABLE haystack.user_images_to_process ( CREATE TABLE haystack.user_images ( id uuid PRIMARY KEY DEFAULT gen_random_uuid(), image_id uuid NOT NULL UNIQUE REFERENCES haystack.image (id), - user_id uuid NOT NULL REFERENCES haystack.users (id) + user_id uuid NOT NULL REFERENCES haystack.users (id), + + created_at TIMESTAMP WITH TIME ZONE DEFAULT now() ); +/* ===== DEPRECATED ===== */ + CREATE TABLE haystack.user_tags ( id uuid PRIMARY KEY DEFAULT gen_random_uuid(), tag VARCHAR(32) UNIQUE NOT NULL, @@ -56,23 +60,31 @@ CREATE TABLE haystack.image_links ( image_id UUID NOT NULL REFERENCES haystack.image (id) ); +/* ===== END DEPRECATED ===== */ + CREATE TABLE haystack.locations ( id uuid PRIMARY KEY DEFAULT gen_random_uuid(), name TEXT NOT NULL, address TEXT, - description TEXT + description TEXT, + + created_at TIMESTAMP WITH TIME ZONE DEFAULT now() ); CREATE TABLE haystack.image_locations ( id uuid PRIMARY KEY DEFAULT gen_random_uuid(), location_id UUID NOT NULL REFERENCES haystack.locations (id), - image_id UUID NOT NULL REFERENCES haystack.image (id) + image_id UUID NOT NULL REFERENCES haystack.image (id), + + created_at TIMESTAMP WITH TIME ZONE DEFAULT now() ); CREATE TABLE haystack.user_locations ( id uuid PRIMARY KEY DEFAULT gen_random_uuid(), location_id UUID NOT NULL REFERENCES haystack.locations (id), - user_id UUID NOT NULL REFERENCES haystack.users (id) + user_id UUID NOT NULL REFERENCES haystack.users (id), + + created_at TIMESTAMP WITH TIME ZONE DEFAULT now() ); CREATE TABLE haystack.contacts ( @@ -83,19 +95,25 @@ CREATE TABLE haystack.contacts ( description TEXT, phone_number TEXT, - email TEXT + email TEXT, + + created_at TIMESTAMP WITH TIME ZONE DEFAULT now() ); CREATE TABLE haystack.user_contacts ( id uuid PRIMARY KEY DEFAULT gen_random_uuid(), user_id UUID NOT NULL REFERENCES haystack.users (id), - contact_id UUID NOT NULL REFERENCES haystack.contacts (id) + contact_id UUID NOT NULL REFERENCES haystack.contacts (id), + + created_at TIMESTAMP WITH TIME ZONE DEFAULT now() ); CREATE TABLE haystack.image_contacts ( id uuid PRIMARY KEY DEFAULT gen_random_uuid(), image_id UUID NOT NULL REFERENCES haystack.image (id), - contact_id UUID NOT NULL REFERENCES haystack.contacts (id) + contact_id UUID NOT NULL REFERENCES haystack.contacts (id), + + created_at TIMESTAMP WITH TIME ZONE DEFAULT now() ); CREATE TABLE haystack.events ( @@ -109,19 +127,25 @@ CREATE TABLE haystack.events ( end_date_time TIMESTAMP, location_id UUID REFERENCES haystack.locations (id), - organizer_id UUID REFERENCES haystack.contacts (id) + organizer_id UUID REFERENCES haystack.contacts (id), + + created_at TIMESTAMP WITH TIME ZONE DEFAULT now() ); CREATE TABLE haystack.image_events ( id uuid PRIMARY KEY DEFAULT gen_random_uuid(), event_id UUID NOT NULL REFERENCES haystack.events (id), - image_id UUID NOT NULL REFERENCES haystack.image (id) + image_id UUID NOT NULL REFERENCES haystack.image (id), + + created_at TIMESTAMP WITH TIME ZONE DEFAULT now() ); CREATE TABLE haystack.user_events ( id uuid PRIMARY KEY DEFAULT gen_random_uuid(), event_id UUID NOT NULL REFERENCES haystack.events (id), - user_id UUID NOT NULL REFERENCES haystack.users (id) + user_id UUID NOT NULL REFERENCES haystack.users (id), + + created_at TIMESTAMP WITH TIME ZONE DEFAULT now() ); CREATE TABLE haystack.notes ( @@ -131,24 +155,32 @@ CREATE TABLE haystack.notes ( name TEXT NOT NULL, description TEXT, - content TEXT NOT NULL + content TEXT NOT NULL, + + created_at TIMESTAMP WITH TIME ZONE DEFAULT now() ); CREATE TABLE haystack.image_notes ( id uuid PRIMARY KEY DEFAULT gen_random_uuid(), image_id UUID NOT NULL REFERENCES haystack.image (id), - note_id UUID NOT NULL REFERENCES haystack.notes (id) + note_id UUID NOT NULL REFERENCES haystack.notes (id), + + created_at TIMESTAMP WITH TIME ZONE DEFAULT now() ); CREATE TABLE haystack.user_notes ( id uuid PRIMARY KEY DEFAULT gen_random_uuid(), user_id UUID NOT NULL REFERENCES haystack.users (id), - note_id UUID NOT NULL REFERENCES haystack.notes (id) + note_id UUID NOT NULL REFERENCES haystack.notes (id), + + created_at TIMESTAMP WITH TIME ZONE DEFAULT now() ); CREATE TABLE haystack.logs ( log TEXT NOT NULL, - image_id UUID NOT NULL REFERENCES haystack.image (id) + image_id UUID NOT NULL REFERENCES haystack.image (id), + + created_at TIMESTAMP WITH TIME ZONE DEFAULT now() ); /* -----| Indexes |----- */