Skip to content

Commit

Permalink
satellitedb: add salt to projects table
Browse files Browse the repository at this point in the history
Change-Id: I53691849efc169c495566648c12ae3d639614c3d
  • Loading branch information
kimbotsao authored and cam-a committed Aug 11, 2022
1 parent 8b338fb commit c3e7b14
Show file tree
Hide file tree
Showing 9 changed files with 1,745 additions and 948 deletions.
1 change: 1 addition & 0 deletions satellite/satellitedb/dbx/satellitedb.dbx
Expand Up @@ -396,6 +396,7 @@ model project (
field partner_id blob ( nullable )
field user_agent blob ( nullable )
field owner_id blob
field salt blob ( nullable )

field created_at timestamp ( autoinsert )
)
Expand Down
122 changes: 80 additions & 42 deletions satellite/satellitedb/dbx/satellitedb.dbx.go

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions satellite/satellitedb/dbx/satellitedb.dbx.pgx.sql
Expand Up @@ -251,6 +251,7 @@ CREATE TABLE projects (
partner_id bytea,
user_agent bytea,
owner_id bytea NOT NULL,
salt bytea,
created_at timestamp with time zone NOT NULL,
PRIMARY KEY ( id )
);
Expand Down
1 change: 1 addition & 0 deletions satellite/satellitedb/dbx/satellitedb.dbx.pgxcockroach.sql
Expand Up @@ -251,6 +251,7 @@ CREATE TABLE projects (
partner_id bytea,
user_agent bytea,
owner_id bytea NOT NULL,
salt bytea,
created_at timestamp with time zone NOT NULL,
PRIMARY KEY ( id )
);
Expand Down
8 changes: 8 additions & 0 deletions satellite/satellitedb/migrate.go
Expand Up @@ -2036,6 +2036,14 @@ func (db *satelliteDB) PostgresMigration() *migrate.Migration {
); `,
},
},
{
DB: &db.migrationDB,
Description: "add projects.salt",
Version: 206,
Action: migrate.SQL{
`ALTER TABLE projects ADD COLUMN salt bytea;`,
},
},
// NB: after updating testdata in `testdata`, run
// `go generate` to update `migratez.go`.
},
Expand Down
3 changes: 2 additions & 1 deletion satellite/satellitedb/migratez.go
Expand Up @@ -13,7 +13,7 @@ func (db *satelliteDB) testMigration() *migrate.Migration {
{
DB: &db.migrationDB,
Description: "Testing setup",
Version: 205,
Version: 206,
Action: migrate.SQL{`-- AUTOGENERATED BY storj.io/dbx
-- DO NOT EDIT
CREATE TABLE accounting_rollups (
Expand Down Expand Up @@ -269,6 +269,7 @@ CREATE TABLE projects (
partner_id bytea,
user_agent bytea,
owner_id bytea NOT NULL,
salt bytea,
created_at timestamp with time zone NOT NULL,
PRIMARY KEY ( id )
);
Expand Down
906 changes: 453 additions & 453 deletions satellite/satellitedb/testdata/postgres.v202.sql

Large diffs are not rendered by default.

904 changes: 452 additions & 452 deletions satellite/satellitedb/testdata/postgres.v203.sql

Large diffs are not rendered by default.

1 comment on commit c3e7b14

@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-62/19444/1

Please sign in to comment.