add columns_ids to procedure_presentations table

This commit is contained in:
simon lehericey 2024-09-20 11:12:52 +02:00
parent e3697bd976
commit 3d79c6176e
No known key found for this signature in database
GPG key ID: CDE670D827C7B3C5
3 changed files with 37 additions and 0 deletions

View file

@ -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'),

View file

@ -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

View file

@ -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