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:
commit
79d6ac18f0
3 changed files with 8 additions and 3 deletions
|
@ -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
|
||||
#
|
||||
|
|
5
db/migrate/20210402163003_exports_key_not_null.rb
Normal file
5
db/migrate/20210402163003_exports_key_not_null.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
class ExportsKeyNotNull < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
change_column_null :exports, :key, false
|
||||
end
|
||||
end
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue