satellite/metainfo/metabase: add created_at and repaired_at to segments
The created_at columns is first added without a default value to avoid setting the current time to existing segments. Change-Id: Ic2fe3da238422e2949e6f3016fbac04eb89ba037
This commit is contained in:
parent
e0f07ef04e
commit
bdb33b381b
@ -282,6 +282,23 @@ func (db *DB) PostgresMigration() *migrate.Migration {
|
||||
`ALTER TABLE segments DROP COLUMN remote_pieces`,
|
||||
},
|
||||
},
|
||||
{
|
||||
DB: &db.db,
|
||||
Description: "add created_at and repaired_at columns to segments table",
|
||||
Version: 7,
|
||||
Action: migrate.SQL{
|
||||
`ALTER TABLE segments ADD COLUMN created_at TIMESTAMPTZ`,
|
||||
`ALTER TABLE segments ADD COLUMN repaired_at TIMESTAMPTZ`,
|
||||
},
|
||||
},
|
||||
{
|
||||
DB: &db.db,
|
||||
Description: "change default of created_at column in segments table to now()",
|
||||
Version: 8,
|
||||
Action: migrate.SQL{
|
||||
`ALTER TABLE segments ALTER COLUMN created_at SET DEFAULT now()`,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user