replace ammo added on with purchased on
This commit is contained in:
CHANGELOG.md
lib
cannery
ammo
cannery_web
components
live
ammo_group_live
ammo_type_live
container_live
priv
gettext
actions.potdefault.poterrors.potprompts.pot
de
LC_MESSAGES
en
LC_MESSAGES
es
LC_MESSAGES
fr
LC_MESSAGES
ga
LC_MESSAGES
repo
test
@@ -0,0 +1,19 @@
|
||||
defmodule Cannery.Repo.Migrations.AddPurchaseDateToAmmoGroup do
|
||||
use Ecto.Migration
|
||||
|
||||
def up do
|
||||
alter table(:ammo_groups) do
|
||||
add :purchased_on, :date
|
||||
end
|
||||
|
||||
flush()
|
||||
|
||||
execute("UPDATE ammo_groups SET purchased_on = inserted_at::DATE WHERE purchased_on IS NULL")
|
||||
end
|
||||
|
||||
def down do
|
||||
alter table(:ammo_groups) do
|
||||
remove :purchased_on
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user