Skip to content

Commit 57d3579

Browse files
gabo-cspalkan
authored andcommitted
Add missing documentation for logidze_data table
1 parent 057ff39 commit 57d3579

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,15 @@ bundle exec rails generate logidze:model Post --after-trigger
207207
### Storing history data in a separate table
208208

209209
By default, Logidze stores history data in the `log_data` column in the origin record table, which might lead to table bloat.
210-
If it concerns you, you may configure Logidze to store history data in a separate table by providing `--detached` option to the migration:
210+
If it concerns you, you may configure Logidze to store history data in a separate table instead.
211211

212+
1. First, generate the shared `logidze_data` table (only once per project):
213+
214+
```sh
215+
bundle exec rails generate logidze:migration:logs
216+
```
217+
218+
2. Then, create your model migration with the --detached option:
212219
```sh
213220
bundle exec rails generate logidze:model Post --detached
214221
```

0 commit comments

Comments
 (0)