Skip to content

Commit

Permalink
satellite/satellitedb: drop _gob columns
Browse files Browse the repository at this point in the history
This concludes the saga that began with commit c053bdb, migrating away
from using gob-encoded big.Float values in the database to using
integers with an implied number of decimal places.

Nothing is using or accessing or expecting the _gob columns to exist
anymore. The transition code and the migration chore are gone. All that
remains is to drop the columns.

Change-Id: I9b15ee52f7781510a6dc91cf7c54f7f9022b1210
  • Loading branch information
thepaul authored and Storj Robot committed Aug 26, 2022
1 parent e621190 commit a57cbc4
Show file tree
Hide file tree
Showing 3 changed files with 759 additions and 4 deletions.
9 changes: 9 additions & 0 deletions satellite/satellitedb/migrate.go
Expand Up @@ -2079,6 +2079,15 @@ func (db *satelliteDB) PostgresMigration() *migrate.Migration {
`ALTER TABLE users ADD COLUMN signup_captcha double precision;`,
},
},
{
DB: &db.migrationDB,
Description: "Drop now-unused gob-encoded columns",
Version: 211,
Action: migrate.SQL{
`ALTER TABLE coinpayments_transactions DROP COLUMN amount_gob, DROP COLUMN received_gob;`,
`ALTER TABLE stripecoinpayments_tx_conversion_rates DROP COLUMN rate_gob;`,
},
},
// NB: after updating testdata in `testdata`, run
// `go generate` to update `migratez.go`.
},
Expand Down
5 changes: 1 addition & 4 deletions satellite/satellitedb/migratez.go
Expand Up @@ -13,7 +13,7 @@ func (db *satelliteDB) testMigration() *migrate.Migration {
{
DB: &db.migrationDB,
Description: "Testing setup",
Version: 210,
Version: 211,
Action: migrate.SQL{`-- AUTOGENERATED BY storj.io/dbx
-- DO NOT EDIT
CREATE TABLE accounting_rollups (
Expand Down Expand Up @@ -93,9 +93,7 @@ CREATE TABLE coinpayments_transactions (
id text NOT NULL,
user_id bytea NOT NULL,
address text NOT NULL,
amount_gob bytea,
amount_numeric int8 NOT NULL,
received_gob bytea,
received_numeric int8 NOT NULL,
status integer NOT NULL,
key text NOT NULL,
Expand Down Expand Up @@ -458,7 +456,6 @@ CREATE TABLE stripecoinpayments_invoice_project_records (
);
CREATE TABLE stripecoinpayments_tx_conversion_rates (
tx_id text NOT NULL,
rate_gob bytea,
rate_numeric double precision NOT NULL,
created_at timestamp with time zone NOT NULL,
PRIMARY KEY ( tx_id )
Expand Down

1 comment on commit a57cbc4

@storjrobot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit has been mentioned on Storj Community Forum (official). There might be relevant details there:

https://forum.storj.io/t/release-preparation-v1-63/19558/1

Please sign in to comment.