change existing broken migration. dont add a new migration
MODIFY
apps/omg_watcher/priv/repo/migrations/20190806111817_alter_txoutputs_ethevents_make_many_to_many_relation.exs
apps/omg_watcher/priv/repo/migrations/20190806111817_alter_txoutputs_ethevents_make_many_to_many_relation.exs
@@ -62,13 +62,9 @@ defmodule OMG.Watcher.DB.Repo.Migrations.AlterTxOutputsTableAddRootchainTxnHashD
remove(:creating_deposit)
remove(:spending_exit)
- timestamps([type: :utc_datetime])
+ timestamps(type: :utc_datetime, default: fragment("(now() at time zone 'utc')"), null: false)
end
- # how to do this in ecto correctly? do it manually
- execute("ALTER TABLE txoutputs ALTER COLUMN inserted_at SET DEFAULT (now() at time zone 'utc');")
- execute("ALTER TABLE txoutputs ALTER COLUMN updated_at SET DEFAULT (now() at time zone 'utc');")
-
create table(:ethevents_txoutputs, primary_key: false) do
add(:root_chain_txhash_event,
references(:ethevents, column: :root_chain_txhash_event, type: :binary, on_delete: :restrict),

DELETE
apps/omg_watcher/priv/repo/migrations/20190914101612_relax_timestamp_not_null_constraints_on_txoutputs_table.exs
-defmodule OMG.Watcher.DB.Repo.Migrations.RelaxTimestampNotNullConstraintsOnTxoutputsTable do
- use Ecto.Migration
-
- def change do
- alter table(:txoutputs) do
- modify :inserted_at, :utc_datetime, default: fragment("now() at time zone 'utc'"), null: true
- modify :updated_at, :utc_datetime, default: fragment("now() at time zone 'utc'"), null: true
- end
- end
-end

change existing broken migration. dont add a new migration