Merge pull request #6048 from tchak/make-export-key-not-null

Migration : ajout d'une contrainte 'NOT NULL' sur la colonne exports#key
This commit is contained in:
Pierre de La Morinerie 2021-04-06 09:59:37 +02:00 committed by GitHub
commit 79d6ac18f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 3 deletions

View file

@ -4,7 +4,7 @@
#
# id :bigint not null, primary key
# format :string not null
# key :text
# key :text not null
# created_at :datetime not null
# updated_at :datetime not null
#

View file

@ -0,0 +1,5 @@
class ExportsKeyNotNull < ActiveRecord::Migration[6.1]
def change
change_column_null :exports, :key, false
end
end

View file

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2021_03_31_123709) do
ActiveRecord::Schema.define(version: 2021_04_02_163003) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -354,7 +354,7 @@ ActiveRecord::Schema.define(version: 2021_03_31_123709) do
t.string "format", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.text "key"
t.text "key", null: false
t.index ["format", "key"], name: "index_exports_on_format_and_key", unique: true
end