Skip to content

Commit 765bc9a

Browse files
committed
Change null constraints on requests table
We want `deadline` and `current_content` to have `null: false`, and our `schema.rb` reflects this but our migrations do not - running `rails db:migrate:reset` results in a schema diff with those columns being nullable. This migration fixes that.
1 parent cee7e13 commit 765bc9a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class ChangeNullConstraintsOnRequests < ActiveRecord::Migration[8.1]
2+
def change
3+
change_table :requests do |t|
4+
t.change_null :current_content, false
5+
t.change_null :deadline, false
6+
end
7+
end
8+
end

db/schema.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#
1111
# It's strongly recommended that you check this file into your version control system.
1212

13-
ActiveRecord::Schema[8.1].define(version: 2026_03_10_161215) do
13+
ActiveRecord::Schema[8.1].define(version: 2026_04_15_091958) do
1414
# These are extensions that must be enabled in order to support this database
1515
enable_extension "pg_catalog.plpgsql"
1616
enable_extension "pgcrypto"

0 commit comments

Comments
 (0)