README.md in strong_migrations-0.5.0 vs README.md in strong_migrations-0.5.1
- old
+ new
@@ -32,11 +32,11 @@
- [[+]](#adding-a-foreign-key) adding a foreign key
- [[+]](#renaming-or-changing-the-type-of-a-column) changing the type of a column
- [[+]](#renaming-or-changing-the-type-of-a-column) renaming a column
- [[+]](#renaming-a-table) renaming a table
- [[+]](#creating-a-table-with-the-force-option) creating a table with the `force` option
-- [[+]](#using-change_column_null) using `change_column_null`
+- [[+]](#setting-not-null-on-an-existing-column) setting `NOT NULL` on an existing column
- [[+]](#adding-a-json-column) adding a `json` column
Optional checks:
- [[+]](#removing-an-index) removing an index non-concurrently
@@ -359,11 +359,11 @@
end
end
end
```
-### Using change_column_null
+### Setting `NOT NULL` on an existing column
#### Bad
In Postgres, setting `NOT NULL` on an existing column requires an `AccessExclusiveLock`, which is expensive on large tables.
@@ -401,11 +401,11 @@
end
```
Note: This is not 100% the same as `NOT NULL` column constraint. Here’s a [good explanation](https://medium.com/doctolib/adding-a-not-null-constraint-on-pg-faster-with-minimal-locking-38b2c00c4d1c).
-### Using change_column_null with a default value (non-Postgres)
+### Using change_column_null with a default value
#### Bad
This generates a single `UPDATE` statement to set the default value.
@@ -427,10 +427,10 @@
change_column_null :users, :some_column, false
end
end
```
-Note: In Postgres, `change_column_null` is still [not safe](#using-change_column_null) with this method.
+Note: In Postgres, `change_column_null` is still [not safe](#setting-not-null-on-an-existing-column) with this method.
### Adding a json column
#### Bad