storj/storagenode/storagenodedb
Jeff Wendling 202e65e408 storagenode/storagenodedb: do correct generalized alter table procedure
According to the docs at https://www.sqlite.org/lang_altertable.html
doing the steps

    1. Rename old table
    2. Create new table
    3. Copy data
    4. Drop old table

is incorrect and should be

    1. Create new table
    2. Copy data
    3. Drop old table
    4. Rename new into old

Additionally, each step was being run in a different transaction,
which could cause permanent failures if a problem happened during
the migration.

Avoid both of those problems by changing up some previous migrations
that ran in this way. Since they are semantically identical, it's
fine to change up these old migrations. It will help make newer
nodes coming up for the first time more robust.

Change-Id: I43fb004fa1b6cb2fe2554f9920925420da28fb4a
2020-05-01 13:53:26 +00:00
..
storagenodedbtest all: rename CreateTables to MigrateToLatest 2020-04-30 07:21:17 +00:00
testdata storagenode/heldamount payments removed 2020-04-21 17:15:31 +00:00
bandwidthdb.go storagenode/bandwidth: fix tests to not fail for 10 hours near the end of the month 2020-01-31 16:25:52 -07:00
database.go storagenode/storagenodedb: do correct generalized alter table procedure 2020-05-01 13:53:26 +00:00
db_container.go private/dbutil/txutil: create new transactions for retries 2020-02-01 18:34:28 +00:00
deprecatedinfo.go storagenodedb: reenable utccheck in tests 2019-12-10 23:17:14 +00:00
heldamount.go storagenode/heldamount payments removed 2020-04-21 17:15:31 +00:00
migrations_test.go cmd/storagenode;storagenode/storagenodedb: add preflight database check 2020-01-16 18:44:46 +00:00
notifications.go all: simplify uuid usage 2020-04-02 05:48:58 +00:00
orders.go all: don't depend on gogo/proto directly 2020-04-08 17:32:15 +00:00
pieceexpiration.go storagenode/storagenodedb: fixes to row handling 2020-01-16 15:08:37 +00:00
pieceinfo.go all: don't depend on gogo/proto directly 2020-04-08 17:32:15 +00:00
piecespaceused.go storagenode/pieces: Track total piece size 2020-01-23 11:00:24 -07:00
pricing.go storagenode/nodestats: add pricing model, storagenode/cache: add paystub history storing 2020-04-14 19:04:00 +03:00
reputation.go storagenode/storagenodedb/reputation: add joined_at 2020-04-17 12:12:09 +00:00
satellites.go storagenode/storagenodedb: use tagsql 2020-01-19 14:39:16 +02:00
schema.go private/dbutil/pgtest: support multiple databases for testing 2020-04-28 21:55:49 +03:00
schemagen.go all: rename CreateTables to MigrateToLatest 2020-04-30 07:21:17 +00:00
storageusage.go storagenode/storagenodedb: use tagsql 2020-01-19 14:39:16 +02:00
usedserials.go storagenode/{piecestore,storagenodedb}: use context in queries 2020-01-14 20:27:26 +00:00