diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f9015a29..04be019ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ and releases in Jupiter project adheres to [Semantic Versioning](http://semver.o - Move Logic from SearchController into ItemSearch Concern [#932](https://github.com/ualbertalib/jupiter/issues/932) - Feature Image on Item show page need to be centered align within column [#1405](https://github.com/ualbertalib/jupiter/issues/1405) - Centralize Abstraction for Thumbnail Generation [#1343](https://github.com/ualbertalib/jupiter/issues/1343) +- Beefed up AR migrations by stating that certain attributes cannot be null [PR#1704](https://github.com/ualbertalib/jupiter/pull/1704) ### Fixed - failing tests [#1376](https://github.com/ualbertalib/jupiter/issues/1376) diff --git a/app/models/collection.rb b/app/models/collection.rb index 74daba3ef..53594f309 100644 --- a/app/models/collection.rb +++ b/app/models/collection.rb @@ -7,6 +7,7 @@ class Collection < JupiterCore::Depositable belongs_to :owner, class_name: 'User' belongs_to :community + validates :title, presence: true validates :community_id, presence: true validate :community_validations diff --git a/db/migrate/20190806193807_add_ar_community.rb b/db/migrate/20190806193807_add_ar_community.rb index 51694bdd0..bb80316e9 100644 --- a/db/migrate/20190806193807_add_ar_community.rb +++ b/db/migrate/20190806193807_add_ar_community.rb @@ -8,7 +8,7 @@ def change t.datetime :record_created_at t.string :hydra_noid t.datetime :date_ingested - t.string :title + t.string :title, null: false t.string :fedora3_uuid t.string :depositor t.text :description diff --git a/db/migrate/20190806193857_add_ar_collection.rb b/db/migrate/20190806193857_add_ar_collection.rb index eadd924a9..58e81f29c 100644 --- a/db/migrate/20190806193857_add_ar_collection.rb +++ b/db/migrate/20190806193857_add_ar_collection.rb @@ -6,7 +6,7 @@ def change t.datetime :record_created_at t.string :hydra_noid t.datetime :date_ingested - t.string :title + t.string :title, null: false t.string :fedora3_uuid t.string :depositor t.uuid :community_id diff --git a/db/migrate/20190815215625_create_ar_item.rb b/db/migrate/20190815215625_create_ar_item.rb index 178875cd2..14e81c875 100644 --- a/db/migrate/20190815215625_create_ar_item.rb +++ b/db/migrate/20190815215625_create_ar_item.rb @@ -5,8 +5,8 @@ def change t.references :owner, null: false, index: true, foreign_key: {to_table: :users, column: :id} t.datetime :record_created_at t.string :hydra_noid - t.datetime :date_ingested - t.string :title + t.datetime :date_ingested, null: false + t.string :title, null: false t.string :fedora3_uuid t.string :depositor t.string :alternative_title @@ -21,7 +21,7 @@ def change t.integer :sort_year t.json :embargo_history, array: true t.json :is_version_of, array: true - t.json :member_of_paths, array: true + t.json :member_of_paths, null: false, array: true t.json :subject, array: true t.json :creators, array: true t.json :contributors, array: true diff --git a/db/migrate/20190822183423_create_ar_thesis.rb b/db/migrate/20190822183423_create_ar_thesis.rb index 99701c091..a6f59acfd 100644 --- a/db/migrate/20190822183423_create_ar_thesis.rb +++ b/db/migrate/20190822183423_create_ar_thesis.rb @@ -5,8 +5,8 @@ def change t.references :owner, null: false, index: true, foreign_key: {to_table: :users, column: :id} t.datetime :record_created_at t.string :hydra_noid - t.datetime :date_ingested - t.string :title + t.datetime :date_ingested, null: false + t.string :title, null: false t.string :fedora3_uuid t.string :depositor t.string :alternative_title @@ -22,7 +22,7 @@ def change t.json :embargo_history, array: true t.json :is_version_of, array: true - t.json :member_of_paths, array: true + t.json :member_of_paths, null: false, array: true t.json :subject, array: true t.text :abstract