@@ -9,28 +9,28 @@ import (
99
1010// EnvironmentVersion represents a snapshot of environment files at a point in time
1111type EnvironmentVersion struct {
12- ID uuid.UUID `gorm:"type:text;primary_key" json:"id"`
13- EnvironmentID uuid.UUID `gorm:"type:text;not null;index:idx_env_version" json:"environment_id"`
14- Environment Environment `gorm:"foreignKey:EnvironmentID" json:"environment,omitempty"`
12+ ID uuid.UUID `gorm:"type:text;primary_key" json:"id"`
13+ EnvironmentID uuid.UUID `gorm:"type:text;not null;index:idx_env_version" json:"environment_id"`
14+ Environment Environment `gorm:"foreignKey:EnvironmentID" json:"environment,omitempty"`
1515
1616 // Version tracking
17- VersionNumber int `gorm:"not null;index:idx_env_version" json:"version_number"` // Auto-incrementing per environment
17+ VersionNumber int `gorm:"not null;index:idx_env_version" json:"version_number"` // Auto-incrementing per environment
1818
1919 // File contents (stored as TEXT in database)
20- LockFileContent string `gorm:"type:text;not null" json:"lock_file_content"` // pixi.lock content
21- ManifestContent string `gorm:"type:text;not null" json:"manifest_content"` // pixi.toml content
22- PackageMetadata string `gorm:"type:text;not null" json:"package_metadata"` // JSON of package list
20+ LockFileContent string `gorm:"type:text;not null" json:"lock_file_content"` // pixi.lock content
21+ ManifestContent string `gorm:"type:text;not null" json:"manifest_content"` // pixi.toml content
22+ PackageMetadata string `gorm:"type:text;not null" json:"package_metadata"` // JSON of package list
2323
2424 // Context
25- JobID * uuid.UUID `gorm:"type:text;index" json:"job_id,omitempty"` // Job that triggered this version
26- Job * Job `gorm:"foreignKey:JobID" json:"job,omitempty"`
27- CreatedBy uuid.UUID `gorm:"type:text;not null" json:"created_by"` // User who triggered the change
28- CreatedByUser User `gorm:"foreignKey:CreatedBy" json:"created_by_user,omitempty"`
29- Description string `gorm:"type:text" json:"description,omitempty"` // Optional description of changes
25+ JobID * uuid.UUID `gorm:"type:text;index" json:"job_id,omitempty"` // Job that triggered this version
26+ Job * Job `gorm:"foreignKey:JobID" json:"job,omitempty"`
27+ CreatedBy uuid.UUID `gorm:"type:text;not null" json:"created_by"` // User who triggered the change
28+ CreatedByUser User `gorm:"foreignKey:CreatedBy" json:"created_by_user,omitempty"`
29+ Description string `gorm:"type:text" json:"description,omitempty"` // Optional description of changes
3030
3131 // Timestamps
32- CreatedAt time.Time `json:"created_at"`
33- DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
32+ CreatedAt time.Time `json:"created_at"`
33+ DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
3434}
3535
3636// BeforeCreate hook to generate UUID and version number
0 commit comments