diff --git a/priv/repo/migrations/20230331004825_rename_shot_groups_to_shot_records.exs b/priv/repo/migrations/20230331004825_rename_shot_groups_to_shot_records.exs new file mode 100644 index 0000000..1e5cd02 --- /dev/null +++ b/priv/repo/migrations/20230331004825_rename_shot_groups_to_shot_records.exs @@ -0,0 +1,19 @@ +defmodule Cannery.Repo.Migrations.RenameShotGroupsToShotRecords do + use Ecto.Migration + + def up do + drop index(:shot_groups, [:user_id, :pack_id]) + + flush() + + rename table(:shot_groups), to: table(:shot_records) + end + + def down do + rename table(:shot_records), to: table(:shot_groups) + + flush() + + create index(:shot_groups, [:user_id, :pack_id]) + end +end