From b36d774d2ce1c0fcce3fba40c3f8b1789c095d9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20de=20Arriba?= Date: Sat, 24 Aug 2024 15:41:53 +0200 Subject: [PATCH 1/2] Update getting started guide --- guides/Getting Started.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/guides/Getting Started.md b/guides/Getting Started.md index 4725204..9c3e95f 100644 --- a/guides/Getting Started.md +++ b/guides/Getting Started.md @@ -53,8 +53,15 @@ Open the generated migration and call the `up` and `down` functions on `ErrorTra defmodule MyApp.Repo.Migrations.AddErrorTracker do use Ecto.Migration - def up, do: ErrorTracker.Migration.up() - def down, do: ErrorTracker.Migration.down() + def up do + ErrorTracker.Migration.up(version: 2) + end + + # We specify `version: 1` in `down`, ensuring that we'll roll all the way back down if + # necessary, regardless of which version we've migrated `up` to. + def down do + ErrorTracker.Migration.down(version: 1) + end end ``` From fa60d42ba700dfdd2c3119ace90b0d839c9133fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20de=20Arriba?= Date: Sat, 24 Aug 2024 15:47:00 +0200 Subject: [PATCH 2/2] Update getting started guide --- guides/Getting Started.md | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/guides/Getting Started.md b/guides/Getting Started.md index 9c3e95f..eed6427 100644 --- a/guides/Getting Started.md +++ b/guides/Getting Started.md @@ -53,15 +53,10 @@ Open the generated migration and call the `up` and `down` functions on `ErrorTra defmodule MyApp.Repo.Migrations.AddErrorTracker do use Ecto.Migration - def up do - ErrorTracker.Migration.up(version: 2) - end - - # We specify `version: 1` in `down`, ensuring that we'll roll all the way back down if - # necessary, regardless of which version we've migrated `up` to. - def down do - ErrorTracker.Migration.down(version: 1) - end + def up, do: ErrorTracker.Migration.up(version: 2) + + # We specify `version: 1` in `down`, to ensure we remove all migrations. + def down, do: ErrorTracker.Migration.down(version: 1) end ```