Skip to content

Commit 7d4d4a4

Browse files
authored
chore: remove deprecated script documentation; fix mise confusion in .tool-versions (#630)
* chore: remove deprecated script * chore: fix mise confusion in .tool-versions
1 parent 588b1cb commit 7d4d4a4

File tree

2 files changed

+1
-30
lines changed

2 files changed

+1
-30
lines changed

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
erlang 27.1.2
2-
elixir 1.18.4
2+
elixir 1.18.4-otp-27

documentation/topics/development/migrations-and-tasks.md

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -23,35 +23,6 @@ For more information on generating migrations, run `mix help ash_postgres.genera
2323
>
2424
> If you have are using schema-based multitenancy, you will also need to define a `all_tenants/0` function in your repo module. See `AshPostgres.Repo` for more.
2525
26-
### Regenerating Migrations
27-
28-
Often, you will run into a situation where you want to make a slight change to a resource after you've already generated and run migrations. If you are using git and would like to undo those changes, then regenerate the migrations, this script may prove useful:
29-
30-
```bash
31-
#!/bin/bash
32-
33-
# Get count of untracked migrations
34-
N_MIGRATIONS=$(git ls-files --others priv/repo/migrations | wc -l)
35-
36-
# Rollback untracked migrations
37-
mix ash_postgres.rollback -n $N_MIGRATIONS
38-
39-
# Delete untracked migrations and snapshots
40-
git ls-files --others priv/repo/migrations | xargs rm
41-
git ls-files --others priv/resource_snapshots | xargs rm
42-
43-
# Regenerate migrations
44-
mix ash.codegen --name $1
45-
46-
# Run migrations if flag
47-
if echo $* | grep -e "-m" -q
48-
then
49-
mix ash.migrate
50-
fi
51-
```
52-
53-
After saving this file to something like `regen.sh`, make it executable with `chmod +x regen.sh`. Now you can run it with `./regen.sh name_of_operation`. If you would like the migrations to automatically run after regeneration, add the `-m` flag: `./regen.sh name_of_operation -m`.
54-
5526
## Running Migrations in Production
5627

5728
Define a module similar to the following:

0 commit comments

Comments
 (0)