add columns_ids to procedure_presentations table
This commit is contained in:
parent
e3697bd976
commit
3d79c6176e
3 changed files with 37 additions and 0 deletions
|
@ -29,6 +29,17 @@ class ProcedurePresentation < ApplicationRecord
|
|||
validate :check_filters_max_length
|
||||
validate :check_filters_max_integer
|
||||
|
||||
attribute :sorted_column, :jsonb
|
||||
|
||||
attribute :a_suivre_filters, :jsonb, array: true
|
||||
attribute :suivis_filters, :jsonb, array: true
|
||||
attribute :traites_filters, :jsonb, array: true
|
||||
attribute :tous_filters, :jsonb, array: true
|
||||
attribute :supprimes_filters, :jsonb, array: true
|
||||
attribute :supprimes_recemment_filters, :jsonb, array: true
|
||||
attribute :expirant_filters, :jsonb, array: true
|
||||
attribute :archives_filters, :jsonb, array: true
|
||||
|
||||
def displayed_fields_for_headers
|
||||
[
|
||||
Column.new(procedure_id: procedure.id, table: 'self', column: 'id', classname: 'number-col'),
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddColumnIdsToProcedurePresentations < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
add_column :procedure_presentations, :displayed_columns, :jsonb, array: true, default: [], null: false
|
||||
add_column :procedure_presentations, :tous_filters, :jsonb, array: true, default: [], null: false
|
||||
add_column :procedure_presentations, :suivis_filters, :jsonb, array: true, default: [], null: false
|
||||
add_column :procedure_presentations, :traites_filters, :jsonb, array: true, default: [], null: false
|
||||
add_column :procedure_presentations, :a_suivre_filters, :jsonb, array: true, default: [], null: false
|
||||
add_column :procedure_presentations, :archives_filters, :jsonb, array: true, default: [], null: false
|
||||
add_column :procedure_presentations, :expirant_filters, :jsonb, array: true, default: [], null: false
|
||||
add_column :procedure_presentations, :supprimes_filters, :jsonb, array: true, default: [], null: false
|
||||
add_column :procedure_presentations, :supprimes_recemment_filters, :jsonb, array: true, default: [], null: false
|
||||
add_column :procedure_presentations, :sorted_column, :jsonb
|
||||
end
|
||||
end
|
10
db/schema.rb
10
db/schema.rb
|
@ -866,11 +866,21 @@ ActiveRecord::Schema[7.0].define(version: 2024_09_23_125619) do
|
|||
end
|
||||
|
||||
create_table "procedure_presentations", id: :serial, force: :cascade do |t|
|
||||
t.jsonb "a_suivre_filters", default: [], null: false, array: true
|
||||
t.jsonb "archives_filters", default: [], null: false, array: true
|
||||
t.integer "assign_to_id"
|
||||
t.datetime "created_at", precision: nil
|
||||
t.jsonb "displayed_columns", default: [], null: false, array: true
|
||||
t.jsonb "displayed_fields", default: [{"label"=>"Demandeur", "table"=>"user", "column"=>"email"}], null: false
|
||||
t.jsonb "expirant_filters", default: [], null: false, array: true
|
||||
t.jsonb "filters", default: {"tous"=>[], "suivis"=>[], "traites"=>[], "a-suivre"=>[], "archives"=>[], "expirant"=>[], "supprimes"=>[]}, null: false
|
||||
t.jsonb "sort", default: {"order"=>"desc", "table"=>"notifications", "column"=>"notifications"}, null: false
|
||||
t.jsonb "sorted_column"
|
||||
t.jsonb "suivis_filters", default: [], null: false, array: true
|
||||
t.jsonb "supprimes_filters", default: [], null: false, array: true
|
||||
t.jsonb "supprimes_recemment_filters", default: [], null: false, array: true
|
||||
t.jsonb "tous_filters", default: [], null: false, array: true
|
||||
t.jsonb "traites_filters", default: [], null: false, array: true
|
||||
t.datetime "updated_at", precision: nil
|
||||
t.index ["assign_to_id"], name: "index_procedure_presentations_on_assign_to_id", unique: true
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue