Skip to content

Commit

Permalink
set kind column default value and non-null
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsbailey committed May 6, 2020
1 parent bd0c4d7 commit eebf8e5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dashboard/app/models/parent_levels_child_level.rb
Expand Up @@ -6,7 +6,7 @@
# parent_level_id :integer not null
# child_level_id :integer not null
# position :integer
# kind :string(255)
# kind :string(255) default("sublevel"), not null
#
# Indexes
#
Expand Down
@@ -1,5 +1,5 @@
class AddKindToParentLevelsChildLevels < ActiveRecord::Migration[5.0]
def change
add_column :parent_levels_child_levels, :kind, :string
add_column :parent_levels_child_levels, :kind, :string, null: false, default: 'sublevel'
end
end
6 changes: 3 additions & 3 deletions dashboard/db/schema.rb
Expand Up @@ -622,10 +622,10 @@
end

create_table "parent_levels_child_levels", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci" do |t|
t.integer "parent_level_id", null: false
t.integer "child_level_id", null: false
t.integer "parent_level_id", null: false
t.integer "child_level_id", null: false
t.integer "position"
t.string "kind"
t.string "kind", default: "sublevel", null: false
t.index ["child_level_id"], name: "index_parent_levels_child_levels_on_child_level_id", using: :btree
t.index ["parent_level_id"], name: "index_parent_levels_child_levels_on_parent_level_id", using: :btree
end
Expand Down

0 comments on commit eebf8e5

Please sign in to comment.