{backup,snapshot}: Rename common code to export
This commit is contained in:
parent
b3a827e042
commit
bf57c0d5a6
14 changed files with 145 additions and 133 deletions
18
internal/models/export.go
Normal file
18
internal/models/export.go
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// ExportTable is the name of the table the [Export] model is stored in.
|
||||
// NOTE(twiesing): It is called snapshot for legacy reasons
|
||||
const ExportTable = "snapshot"
|
||||
|
||||
// Export represents an entry in the export log
|
||||
type Export struct {
|
||||
Pk uint `gorm:"column:pk;primaryKey"`
|
||||
|
||||
Slug string `gorm:"column:slug"` // slug of instance
|
||||
Created time.Time `gorm:"column:created"` // time the backup was created
|
||||
|
||||
Path string `gorm:"column:path;not null"` // path the export is stored at
|
||||
Packed bool `gorm:"column:packed;not null"` // was the export packed, or was it staging only?
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// SnapshotTable is the name of the table the [SnapshotLog] model is stored in
|
||||
const SnapshotTable = "snapshot"
|
||||
|
||||
// Snapshot represents an entry in the snapshot log
|
||||
type Snapshot struct {
|
||||
Pk uint `gorm:"column:pk;primaryKey"`
|
||||
|
||||
Slug string `gorm:"column:slug"` // slug of instance
|
||||
Created time.Time `gorm:"column:created"` // time the backup was created
|
||||
|
||||
Path string `gorm:"column:path;not null"` // path the backup is stored at
|
||||
Packed bool `gorm:"column:packed;not null"` // was the backup packed, or was it staging only?
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue