Merge pull request #1846 from RafaelTaranto/fix/blacklist-migration
LAM-1418 fix: drop contraint before dropping index
This commit is contained in:
commit
ed6833182b
1 changed files with 11 additions and 7 deletions
|
|
@ -1,11 +1,15 @@
|
|||
const db = require('./db')
|
||||
|
||||
exports.up = next => db.multi([
|
||||
exports.up = next =>
|
||||
db.multi(
|
||||
[
|
||||
'ALTER TABLE public.blacklist DROP CONSTRAINT IF EXISTS blacklist_pkey;',
|
||||
'ALTER TABLE public.blacklist ADD PRIMARY KEY (address);',
|
||||
'ALTER TABLE public.blacklist DROP CONSTRAINT IF EXISTS blacklist_temp_address_key;',
|
||||
'DROP INDEX IF EXISTS blacklist_temp_address_key;',
|
||||
'CREATE UNIQUE INDEX blacklist_address_idx ON public.blacklist USING btree (address);',
|
||||
|
||||
], next)
|
||||
],
|
||||
next,
|
||||
)
|
||||
|
||||
exports.down = next => next()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue