chore(schema): change default types_de_champ#mandatory from false to true

This commit is contained in:
Colin Darie 2024-06-25 17:17:21 +02:00
parent c5008e42af
commit 48e5a237e3
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4
3 changed files with 10 additions and 3 deletions

View file

@ -261,7 +261,7 @@ class TypeDeChamp < ApplicationRecord
end
def check_mandatory
if non_fillable?
if non_fillable? || private?
self.mandatory = false
else
true

View file

@ -0,0 +1,7 @@
# frozen_string_literal: true
class ChangeTypesDeChampMandatoryDefault < ActiveRecord::Migration[7.0]
def change
change_column_default :types_de_champ, :mandatory, from: false, to: true
end
end

View file

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.0].define(version: 2024_05_27_090508) do
ActiveRecord::Schema[7.0].define(version: 2024_06_19_205011) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_buffercache"
enable_extension "pg_stat_statements"
@ -1122,7 +1122,7 @@ ActiveRecord::Schema[7.0].define(version: 2024_05_27_090508) do
t.datetime "created_at", precision: nil
t.text "description"
t.string "libelle"
t.boolean "mandatory", default: false
t.boolean "mandatory", default: true
t.jsonb "options"
t.boolean "private", default: false, null: false
t.bigint "stable_id"