Skip to content

Commit

Permalink
fix migration file
Browse files Browse the repository at this point in the history
  • Loading branch information
rachit77 committed Nov 29, 2024
1 parent ac9fa26 commit 5089d5c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions db/migrations/0006.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ALTER TABLE data_node.offchain_data
ADD COLUMN IF NOT EXISTS batch_num BIGINT NOT NULL DEFAULT 0;

-- Rename the 'missing_batches' table to 'unresolved_batches'
ALTER TABLE missing_batches RENAME TO unresolved_batches;
ALTER TABLE data_node.missing_batches RENAME TO unresolved_batches;

-- Create an index for the 'batch_num' column for better performance
CREATE INDEX IF NOT EXISTS idx_batch_num ON data_node.offchain_data(batch_num);
Expand All @@ -17,7 +17,7 @@ UPDATE data_node.sync_tasks SET block = 0 WHERE task = 'L1';
ALTER TABLE data_node.offchain_data DROP COLUMN batch_num;

-- Rename the 'unresolved_batches' table back to 'missing_batches'
ALTER TABLE unresolved_batches RENAME TO missing_batches;
ALTER TABLE data_node.unresolved_batches RENAME TO missing_batches;

-- Drop the index created on 'batch_num'
DROP INDEX IF EXISTS idx_batch_num;

0 comments on commit 5089d5c

Please sign in to comment.