Skip to content

Commit ec560c8

Browse files
committed
Improve docs
1 parent 93960e7 commit ec560c8

2 files changed

Lines changed: 23 additions & 16 deletions

File tree

lib/ecto/migration.ex

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,10 @@ defmodule Ecto.Migration do
1313
In order to manage migrations, Ecto creates a table called
1414
`schema_migrations` in the database, which stores all migrations
1515
that have already been executed. You can configure the name of
16-
this table with the `:migration_source` configuration option.
16+
this table with the `:migration_source` configuration option
17+
and the name of the repository that manages it with `:migration_repo`.
1718
18-
You can configure a different database for the table that
19-
manages your migrations by setting the `:migration_repo`
20-
configuration option to a different repository.
21-
22-
Ecto also locks the `schema_migrations` table when running
19+
Ecto locks the `schema_migrations` table when running
2320
migrations, guaranteeing two different servers cannot run the same
2421
migration at the same time.
2522
@@ -89,6 +86,11 @@ defmodule Ecto.Migration do
8986
9087
$ mix ecto.gen.migration add_weather_table
9188
89+
For the rest of this document, we will cover the migration APIs
90+
provided by Ecto. For a in-depth discussion of migrations and how
91+
to use them safely within your application and data, see the
92+
[Safe Ecto Migrations guide](https://fly.io/phoenix-files/safe-ecto-migrations/).
93+
9294
## Mix tasks
9395
9496
As seen above, Ecto provides many Mix tasks to help developers work
@@ -184,7 +186,7 @@ defmodule Ecto.Migration do
184186
185187
### Migrator configuration
186188
187-
These options configure how the underlying migration engine works:
189+
These options configure where Ecto stores and how Ecto runs your migrations:
188190
189191
* `:migration_source` - Version numbers of migrations will be saved in a
190192
table named `schema_migrations` by default. You can configure the name of
@@ -212,12 +214,12 @@ defmodule Ecto.Migration do
212214
213215
* `:migration_cast_version_column` - Ecto uses a `version` column of type
214216
`bigint` for the underlying migrations table (usually `schema_migrations`). By
215-
default, Ecto doesn't cast this to a different type when reading or writing to the database
216-
when running migrations. However, some web frameworks store this column as a string.
217-
For compatibility reasons, you can set this option to `true`, which makes Ecto
218-
perform a `CAST(version AS int)`. This used to be the default behavior up to
219-
Ecto 3.10, so if you are upgrading to 3.11+ and want to keep the old behavior,
220-
set this option to `true`.
217+
default, Ecto doesn't cast this to a different type when reading or writing to
218+
the database when running migrations. However, some web frameworks store this
219+
column as a string. For compatibility reasons, you can set this option to `true`,
220+
which makes Ecto perform a `CAST(version AS int)`. This used to be the default
221+
behavior up to Ecto 3.10, so if you are upgrading to 3.11+ and want to keep the
222+
old behavior, set this option to `true`.
221223
222224
* `:priv` - the priv directory for the repo with the location of important assets,
223225
such as migrations. For a repository named `MyApp.FooRepo`, `:priv` defaults to
@@ -230,9 +232,10 @@ defmodule Ecto.Migration do
230232
231233
### Migrations configuration
232234
233-
These options configure how each migration works. **It is generally discouraged
234-
to change any of those configurations after your database is deployed to production,
235-
as changing these options will retroactively change how all migrations work**.
235+
These options configure the default values used by migrations. **It is generally
236+
discouraged to change any of those configurations after your database is deployed
237+
to production, as changing these options will retroactively change how all
238+
migrations work**.
236239
237240
* `:migration_primary_key` - By default, Ecto uses the `:id` column with type
238241
`:bigserial`, but you can configure it via:

mix.exs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,10 @@ defmodule EctoSQL.MixProject do
188188
Ecto.Adapters.Tds,
189189
Ecto.Adapters.Postgres
190190
],
191+
"TDS Types": [
192+
Tds.Ecto.UUID,
193+
Tds.Ecto.VarChar
194+
],
191195
"Adapter specification": [
192196
Ecto.Adapter.Migration,
193197
Ecto.Adapter.Structure,

0 commit comments

Comments
 (0)