| 1 | package chat |
| 2 | |
| 3 | import "time" |
| 4 | |
| 5 | // placeRecord is a confirmed destination of the team (spec 2026-11-26 |
| 6 | // places, slice 1): one kind, one adapter, a console host and an account. |
| 7 | // A team record, never scope.Owned: the same for every member, written |
| 8 | // only by an owner's tap. |
| 9 | type placeRecord struct { |
| 10 | ID string `gorm:"primaryKey"` |
| 11 | Kind string `gorm:"uniqueIndex:chat_place_destination,priority:1"` |
| 12 | Adapter string `gorm:"uniqueIndex:chat_place_destination,priority:2"` |
| 13 | Console string `gorm:"uniqueIndex:chat_place_destination,priority:3"` |
| 14 | AccountSqid string `gorm:"uniqueIndex:chat_place_destination,priority:4"` |
| 15 | AccountName string |
| 16 | State string |
| 17 | Revision int64 |
| 18 | ProposedBy string |
| 19 | ProposedAt *time.Time |
| 20 | ConfirmedBy string |
| 21 | ConfirmedAt *time.Time |
| 22 | CreatedAt time.Time |
| 23 | UpdatedAt time.Time |
| 24 | } |
| 25 | |
| 26 | func (placeRecord) TableName() string { return "chat_places" } |
| 27 | |
| 28 | // projectPlaceRecord binds a project to a place of one kind: for a site, |
| 29 | // the app code minted for it; AppCreatedAt and AppCreatedStep when and by |
| 30 | // which step a creation was attempted (allowed, not proven: setup is |
| 31 | // never offered again); the deploy key a runner was allowed to mint for |
| 32 | // it (name, runner, who, when, by which step; never the secret). |
| 33 | type projectPlaceRecord struct { |
| 34 | ID string `gorm:"primaryKey"` |
| 35 | ProjectID string `gorm:"uniqueIndex:chat_project_place_kind,priority:1"` |
| 36 | Kind string `gorm:"uniqueIndex:chat_project_place_kind,priority:2"` |
| 37 | PlaceID string |
| 38 | App string |
| 39 | Revision int64 |
| 40 | AppCreatedAt *time.Time |
| 41 | AppCreatedStep string |
| 42 | DeployName string |
| 43 | DeployRunner string |
| 44 | DeployMintedBy string |
| 45 | DeployMintedAt *time.Time |
| 46 | DeployStep string |
| 47 | CreatedAt time.Time |
| 48 | UpdatedAt time.Time |
| 49 | } |
| 50 | |
| 51 | func (projectPlaceRecord) TableName() string { return "chat_project_places" } |
| 52 | |