signoz/pkg/types/datamigration.go
Nityananda Gohain 962e75c6d4
fix: move migrations to bun (#7055)
* fix: move migrations to bun

* fix: use anonymous structs and move modes to types package

* fix: minor changes after tests

* fix: remove bun relations and add foreign keys

* fix: minor changes

* Update pkg/types/agent.go

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>

* fix: address minor comments

* fix: use bun create index

* fix: remove extra comma

---------

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
2025-02-12 09:58:49 +05:30

16 lines
407 B
Go

package types
import (
"time"
"github.com/uptrace/bun"
)
type DataMigration struct {
bun.BaseModel `bun:"table:data_migrations"`
ID int `bun:"id,pk,autoincrement"`
Version string `bun:"version,unique,notnull,type:VARCHAR(255)"`
CreatedAt time.Time `bun:"created_at,notnull,default:current_timestamp"`
Succeeded bool `bun:"succeeded,notnull,default:false"`
}