-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
π Fix importers sorting for last run and next run (#977)
* π Fix importers sorting for last run and next run This commit will fix the sorting error that happens when the user is on the importers index and attempts to sort by the last run or next run. We add some migrations to add fields that the datatables can use so it can sort properly. Previously, this was not working because the last_imported_at and next_import_at fields were actually methods on the importer_run object and not the importer object. We are adding a few callbacks to the importer and importer_run models to ensure that the fields are properly set when they are called from either the web or the worker. Ref: - #956 * π€ Update upload-artifact and download-artifact CI was getting errors because the versions we were previously using were deprecated. This commit updates the actions to the latest versions. * π Remove Downloadable Files sorting The downloadable files sorting was broken plus, it's not clear now a downloadable file should be sorted. * βοΈ Add guard for new migrations This commit will add a guard to the new migrations to ensure that they do not run if the columns already exist in the database. * π€ Add rake task to re save importers This rake task will allow users to re save all their importers. It accounts for tenants if it is a Hyku application. ```sh bundle exec rake bulkrax:resave_importers ```
- Loading branch information
Showing
7 changed files
with
72 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
db/migrate/20240916182737_add_last_imported_at_to_bulkrax_importers.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class AddLastImportedAtToBulkraxImporters < ActiveRecord::Migration[5.1] | ||
def change | ||
add_column :bulkrax_importers, :last_imported_at, :datetime unless column_exists?(:bulkrax_importers, :last_imported_at) | ||
end | ||
end |
5 changes: 5 additions & 0 deletions
5
db/migrate/20240916182823_add_next_import_at_to_bulkrax_importers.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class AddNextImportAtToBulkraxImporters < ActiveRecord::Migration[5.1] | ||
def change | ||
add_column :bulkrax_importers, :next_import_at, :datetime unless column_exists?(:bulkrax_importers, :next_import_at) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters