-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fa_table] update is_primary to non-null (#496)
* add index back * set fields to nonnull * change default is_primary value * adding is_primary migration --------- Co-authored-by: bowenyang007 <[email protected]>
- Loading branch information
1 parent
9200855
commit 82ae5ff
Showing
6 changed files
with
22 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
rust/processor/src/db/postgres/migrations/2024-08-20-224736_fa_migration_fix_part1/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
-- Your SQL goes here | ||
--truncate table because there are a bunch of changes that might pose a problem with existing data | ||
TRUNCATE TABLE current_unified_fungible_asset_balances_to_be_renamed; | ||
-- removing generated fields because we're redoing them | ||
ALTER TABLE current_unified_fungible_asset_balances_to_be_renamed DROP COLUMN IF EXISTS asset_type; | ||
ALTER TABLE current_unified_fungible_asset_balances_to_be_renamed DROP COLUMN IF EXISTS token_standard; |
5 changes: 5 additions & 0 deletions
5
rust/processor/src/db/postgres/migrations/2024-08-30-170635_is_primary_nullable_fix/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
-- This file should undo anything in `up.sql` | ||
ALTER TABLE IF EXISTS current_fungible_asset_balances | ||
ALTER COLUMN is_primary DROP NOT NULL; | ||
ALTER TABLE IF EXISTS current_fungible_asset_balances | ||
ALTER COLUMN amount DROP NOT NULL; |
7 changes: 7 additions & 0 deletions
7
rust/processor/src/db/postgres/migrations/2024-08-30-170635_is_primary_nullable_fix/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
-- Your SQL goes here | ||
ALTER TABLE IF EXISTS current_fungible_asset_balances | ||
ALTER COLUMN is_primary | ||
SET NOT NULL; | ||
ALTER TABLE IF EXISTS current_fungible_asset_balances | ||
ALTER COLUMN amount | ||
SET NOT NULL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters