diff options
-rw-r--r-- | app/models/domain_allow.rb | 2 | ||||
-rw-r--r-- | app/models/status.rb | 2 | ||||
-rw-r--r-- | db/migrate/20200706171939_add_not_null_to_monsterfork_additions.rb | 11 | ||||
-rw-r--r-- | db/schema.rb | 7 |
4 files changed, 17 insertions, 5 deletions
diff --git a/app/models/domain_allow.rb b/app/models/domain_allow.rb index 8bd647519..70f559f49 100644 --- a/app/models/domain_allow.rb +++ b/app/models/domain_allow.rb @@ -8,7 +8,7 @@ # domain :string default(""), not null # created_at :datetime not null # updated_at :datetime not null -# hidden :boolean default(FALSE) +# hidden :boolean default(FALSE), not null # class DomainAllow < ApplicationRecord diff --git a/app/models/status.rb b/app/models/status.rb index 1a5197e88..731bb6eee 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -25,7 +25,7 @@ # poll_id :bigint(8) # content_type :string # deleted_at :datetime -# edited :integer default(0) +# edited :integer default(0), not null # class Status < ApplicationRecord diff --git a/db/migrate/20200706171939_add_not_null_to_monsterfork_additions.rb b/db/migrate/20200706171939_add_not_null_to_monsterfork_additions.rb new file mode 100644 index 000000000..40b62f93a --- /dev/null +++ b/db/migrate/20200706171939_add_not_null_to_monsterfork_additions.rb @@ -0,0 +1,11 @@ +class AddNotNullToMonsterforkAdditions < ActiveRecord::Migration[5.2] + def change + safety_assured do + Rails.logger.info("Setting NOT NULL on domain_allows.hidden") + change_column_null :domain_allows, :hidden, false + + Rails.logger.info("Setting NOT NULL on statuses.edited") + change_column_null :statuses, :edited, false + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 7b17b2128..eca595c82 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2020_07_02_032702) do +ActiveRecord::Schema.define(version: 2020_07_06_171939) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -339,7 +339,7 @@ ActiveRecord::Schema.define(version: 2020_07_02_032702) do t.string "domain", default: "", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false - t.boolean "hidden", default: false + t.boolean "hidden", default: false, null: false t.index ["domain"], name: "index_domain_allows_on_domain", unique: true end @@ -785,10 +785,11 @@ ActiveRecord::Schema.define(version: 2020_07_02_032702) do t.bigint "poll_id" t.string "content_type" t.datetime "deleted_at" - t.integer "edited", default: 0 + t.integer "edited", default: 0, null: false t.index ["account_id", "id", "visibility", "updated_at"], name: "index_statuses_20190820", order: { id: :desc }, where: "(deleted_at IS NULL)" t.index ["conversation_id"], name: "index_statuses_on_conversation_id", where: "(deleted_at IS NULL)" t.index ["id", "account_id"], name: "index_statuses_local_20190824", order: { id: :desc }, where: "((local OR (uri IS NULL)) AND (deleted_at IS NULL) AND (visibility = 0) AND (reblog_of_id IS NULL) AND ((NOT reply) OR (in_reply_to_account_id = account_id)))" + t.index ["id", "account_id"], name: "index_statuses_on_id_and_account_id" t.index ["id", "account_id"], name: "index_statuses_public_20200119", order: { id: :desc }, where: "((deleted_at IS NULL) AND (visibility = 0) AND (reblog_of_id IS NULL) AND ((NOT reply) OR (in_reply_to_account_id = account_id)))" t.index ["in_reply_to_account_id"], name: "index_statuses_on_in_reply_to_account_id" t.index ["in_reply_to_id"], name: "index_statuses_on_in_reply_to_id" |