storj/satellite
Jessica Grebenschikov aeab599d21 satellitedb: removed unused id on storagenode_storage_tallies table, add index on node_id
The goal of this change is to improve the storagenode_storage_tallies table by removing the unneeded id column that is not being used but only taking up space, and also to add an index on a different column that needs it. Removing and adding a column seems simple, but ended up being more complicated because of some cockroachdb limitations.

The cockroachdb limitation when trying to remove a column from a table and create a new primary key are:
1. only allows primary key creation at table creation time (docs: https://www.cockroachlabs.com/docs/stable/primary-key.html)
2. table drop or rename is performed async and cannot be done in a transaction (issue: https://github.com/cockroachdb/cockroach/issues/12123, https://github.com/cockroachdb/cockroach/issues/22868)

To address these differences between cockroachdb  and Postgres, this PR performs different migrations for the two database. The Postgres migration is straight forward and what you would expect, but the cockroach migration has two main changes:
1. To change a primary key, use the recommended process from the cockroachdb docs to create a new table with the new primary key you want and then migrate the data.
2. In order to do 1, we needed to do the new table renaming in a separate transaction from the data migration.

Ref: SM-65

Change-Id: Idc9aee3ab57aa4d5570e3d2980afea853cd966bf
2020-03-20 14:39:44 -07:00
..
accounting satellite/orders: more efficient processing of orders 2020-03-18 09:03:30 +00:00
admin satellite/admin: add project limit modification and authorization token 2020-02-17 07:56:16 +00:00
attribution satellite: remove some unnecessary UTC() calls 2020-03-13 13:49:44 +00:00
audit satellite/{overlay, satellitedb}: account for suspended field in overlay cache 2020-03-17 17:14:56 +00:00
console satellite/payments: More Cleanup and Satellite command to ensure we have stripe customers (#3805) 2020-03-16 20:34:15 +01:00
contact satellite/overlay: rm combinedcache, fix IP naming to be network (#3798) 2020-03-12 11:37:57 -07:00
dbcleanup satellite: remove some unnecessary UTC() calls 2020-03-13 13:49:44 +00:00
downtime satellite: remove some unnecessary UTC() calls 2020-03-13 13:49:44 +00:00
gc satellite/gc: move garbage collection to its own process 2020-03-18 16:44:01 +00:00
gracefulexit satellite: remove some unnecessary UTC() calls 2020-03-13 13:49:44 +00:00
heldamount satellitedb/heldamount updated, tests added + storagenode console updated 2020-03-19 15:37:45 +02:00
inspector go.mod: update uplink 2020-02-21 16:08:12 +02:00
mailservice all: use monkit v3 2020-02-05 23:53:17 +00:00
marketingweb common: separate repository 2019-12-27 14:11:15 +02:00
metainfo private/context2: moved to storj.io/common/context2 2020-03-20 14:39:46 +00:00
metrics all: use monkit v3 2020-02-05 23:53:17 +00:00
nodestats all: use monkit v3 2020-02-05 23:53:17 +00:00
orders satellite/orders: more efficient processing of orders 2020-03-18 09:03:30 +00:00
overlay satellite/overlay: rename newNodePercentage to newNodeFraction 2020-03-19 20:09:32 +00:00
payments satellite/payments: Set proper defaults for the release (#3806) 2020-03-16 22:53:12 +01:00
referrals all: use pbgrpc 2020-02-26 21:27:47 +02:00
repair satellite/repair: add monitoring for remote_segments_healthy_percentage 2020-03-17 17:45:59 +00:00
rewards satellite: remove some unnecessary UTC() calls 2020-03-13 13:49:44 +00:00
satellitedb satellitedb: removed unused id on storagenode_storage_tallies table, add index on node_id 2020-03-20 14:39:44 -07:00
vouchers common: separate repository 2019-12-27 14:11:15 +02:00
admin.go storagenode: notifications on outdated software version 2020-03-02 16:48:02 +00:00
api.go satellite/metainfo/piecedeletion: add Service 2020-03-18 14:50:08 +00:00
core.go satellite/gc: move garbage collection to its own process 2020-03-18 16:44:01 +00:00
gc.go satellite/gc: move garbage collection to its own process 2020-03-18 16:44:01 +00:00
peer.go storagenode/cache heldamount added 2020-03-16 00:28:35 +02:00
repairer.go satellite/repair: put irreparable segments in irreparableDB 2020-03-09 21:45:16 +00:00