Merge pull request #8966 from blockscout/np-hf-account-watchlist
Add ACCOUNT_WATCHLIST_NOTIFICATIONS_LIMIT_FOR_30_DAYSvb-remove-stg-suffix
commit
b7dac2a217
@ -0,0 +1,23 @@ |
||||
defmodule Explorer.Repo.Account.Migrations.AddWatchlistIdColumn do |
||||
use Ecto.Migration |
||||
|
||||
def change do |
||||
execute(""" |
||||
ALTER TABLE public.account_watchlist_notifications |
||||
DROP CONSTRAINT account_watchlist_notifications_watchlist_address_id_fkey; |
||||
""") |
||||
|
||||
alter table(:account_watchlist_notifications) do |
||||
add(:watchlist_id, :bigserial) |
||||
end |
||||
|
||||
create(index(:account_watchlist_notifications, [:watchlist_id])) |
||||
|
||||
execute(""" |
||||
UPDATE account_watchlist_notifications awn |
||||
SET watchlist_id = awa.watchlist_id |
||||
FROM account_watchlist_addresses awa |
||||
WHERE awa.id = awn.watchlist_address_id |
||||
""") |
||||
end |
||||
end |
Loading…
Reference in new issue