-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🧹Database migration & schema update (#2063)
For table hyrax_counter_metrics
- Loading branch information
Showing
5 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
db/migrate/20231215215705_create_hyrax_counter_metrics.hyrax.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,14 @@ | ||
class CreateHyraxCounterMetrics < ActiveRecord::Migration[6.1] | ||
def change | ||
create_table :hyrax_counter_metrics do |t| | ||
t.string :worktype | ||
t.string :resource_type | ||
t.integer :work_id | ||
t.date :date | ||
t.integer :total_item_investigations | ||
t.integer :total_item_requests | ||
|
||
t.timestamps | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class ChangeWorkIdToString < ActiveRecord::Migration[6.1] | ||
def change | ||
change_column :hyrax_counter_metrics, :work_id, :string | ||
end | ||
end |
8 changes: 8 additions & 0 deletions
8
db/migrate/20231215215707_add_indices_to_hyrax_counter_metrics.hyrax.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,8 @@ | ||
class AddIndicesToHyraxCounterMetrics < ActiveRecord::Migration[6.1] | ||
def change | ||
add_index :hyrax_counter_metrics, :worktype | ||
add_index :hyrax_counter_metrics, :resource_type | ||
add_index :hyrax_counter_metrics, :work_id | ||
add_index :hyrax_counter_metrics, :date | ||
end | ||
end |
8 changes: 8 additions & 0 deletions
8
db/migrate/20231215215708_add_fields_to_counter_metric.hyrax.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,8 @@ | ||
class AddFieldsToCounterMetric < ActiveRecord::Migration[6.1] | ||
def change | ||
add_column :hyrax_counter_metrics, :title, :string | ||
add_column :hyrax_counter_metrics, :year_of_publication, :integer, index: true | ||
add_column :hyrax_counter_metrics, :publisher, :string, index: true | ||
add_column :hyrax_counter_metrics, :author, :string, index: true | ||
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