Skip to content
Snippets Groups Projects
Commit a17a72d3 authored by Jan Kuchař's avatar Jan Kuchař
Browse files

Update migrate-to-composite-field.md

parent 2800124f
No related branches found
No related tags found
No related merge requests found
Pipeline #30658 canceled
......@@ -2,7 +2,7 @@
Sometimes you start with table containing values, which you then see have dependency on each other. As happened with [Stamp object](https://gitlab.grifart.cz/ivy/server/-/merge_requests/222/diffs#note_69354) (originally named `auditTrail`).
## 1. migrating database
### 1. migrating database
```sql
-- prepare new data type in PostgreSQL
......@@ -27,6 +27,8 @@ ALTER TABLE "clinic"."patient"
DROP COLUMN "createdBy";
```
### 2. Mapper
And add mapping of new field. It is useful to use PostgreSQL tools for composite & array types. This helper class will provide you logic for (de)serializing these composite types into standard SQL query.
```php
......@@ -49,4 +51,4 @@ And add mapping of new field. It is useful to use PostgreSQL tools for composite
);
},
);
```
\ No newline at end of file
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment