Add mandatory 'stored' option to generated column example

The current implementation (#41856) required `stored: true` to be passed when using `t.virtual()`
https://github.com/rails/rails/pull/41856/files#diff-5b1b920fc3bebbb1d4c144b302603e5003a1d9e5a493e3234bf764b9e26fbe30R68-R75
This commit is contained in:
Lawrence Chou 2021-09-16 23:22:26 +08:00 committed by GitHub
parent e1a09e6e80
commit 447f55cc83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -562,7 +562,7 @@ create_table :documents do |t|
t.string :body
t.virtual :textsearchable_index_col,
type: :tsvector, as: "to_tsvector('english', title || ' ' || body)"
type: :tsvector, as: "to_tsvector('english', title || ' ' || body)", stored: true
end
add_index :documents, :textsearchable_index_col, using: :gin, name: 'documents_idx'