|
1 | 1 | Migration to identity columns on PostgreSQL
|
2 | 2 | ===========================================
|
3 | 3 |
|
4 |
| -As of version 4, the DBAL uses identity columns to implement the `autoincrement` |
5 |
| -behavior on PostgreSQL instead of `SERIAL*` column types. |
| 4 | +As of version 4, the DBAL uses identity columns to implement the ``autoincrement`` |
| 5 | +behavior on PostgreSQL instead of ``SERIAL*`` column types. |
6 | 6 |
|
7 |
| -If you have a database with `autoincrement` columns created using DBAL 3 or earlier, |
| 7 | +If you have a database with ``autoincrement`` columns created using DBAL 3 or earlier, |
8 | 8 | you will need to perform the following schema migration before being able to continue managing
|
9 | 9 | the schema with the DBAL:
|
10 | 10 |
|
11 |
| -1. Identify all `autoincrement` columns and their tables. |
12 |
| -2. Create the `upgrade_serial_to_identity()` function in the database as described in |
| 11 | +1. Identify all ``autoincrement`` columns and their tables. |
| 12 | +2. Create the ``upgrade_serial_to_identity()`` function in the database as described in |
13 | 13 | `PostgreSQL 10 identity columns explained <https://www.2ndquadrant.com/en/blog/postgresql-10-identity-columns/>`_:
|
14 | 14 |
|
15 | 15 | .. code-block:: sql
|
@@ -60,8 +60,8 @@ the schema with the DBAL:
|
60 | 60 | END;
|
61 | 61 | $$;
|
62 | 62 |
|
63 |
| -3. For each column and their table, run `upgrade_serial_to_identity(<table>, <column>)`. |
| 63 | +3. For each column and their table, run ``upgrade_serial_to_identity(<table>, <column>)``. |
64 | 64 |
|
65 | 65 | Without this migration, next time when DBAL 4 is used to manage the schema, it will perform a similar migration
|
66 | 66 | but instead of reusing the existing sequence, it will drop it and create a new one. As a result,
|
67 |
| -all new sequence numbers will be generated from `1`, which is most likely undesired. |
| 67 | +all new sequence numbers will be generated from ``1``, which is most likely undesired. |
0 commit comments