Skip to content

Commit

Permalink
Add non-null constraint for category
Browse files Browse the repository at this point in the history
  • Loading branch information
Frodo161 committed Oct 28, 2023
1 parent 0f6e562 commit e39fcb5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddCategoryNotNullContraintToAnnotation < ActiveRecord::Migration[7.0]
def change
change_column_null :annotations, :category, false
end
end
4 changes: 2 additions & 2 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.0].define(version: 2023_10_21_100348) do
ActiveRecord::Schema[7.0].define(version: 2023_10_28_113531) do
# These are extensions that must be enabled in order to support this database
enable_extension "pgcrypto"
enable_extension "plpgsql"
Expand All @@ -20,7 +20,7 @@
t.bigint "user_id", null: false
t.text "timestamp", null: false
t.text "comment"
t.integer "category"
t.integer "category", null: false
t.boolean "visible_for_teacher"
t.string "color"
t.datetime "created_at", null: false
Expand Down

0 comments on commit e39fcb5

Please sign in to comment.