Skip to content

Commit

Permalink
WIP: remove unused depositor and collections models
Browse files Browse the repository at this point in the history
  • Loading branch information
fcd1 committed Jan 22, 2025
1 parent c12e05e commit 2fa9da3
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 78 deletions.
21 changes: 0 additions & 21 deletions app/models/collection.rb

This file was deleted.

12 changes: 0 additions & 12 deletions app/models/depositor.rb

This file was deleted.

4 changes: 0 additions & 4 deletions app/models/depositor_collection_pairing.rb

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class RemoveForeignKeysDepositorCollectionPairings < ActiveRecord::Migration[7.2]
def change
remove_foreign_key "depositor_collection_pairings", "collections"
remove_foreign_key "depositor_collection_pairings", "depositors"
end
end
10 changes: 10 additions & 0 deletions db/migrate/20250115163254_drop_depositor_collection_pairings.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class DropDepositorCollectionPairings < ActiveRecord::Migration[7.2]
def change
drop_table :depositor_collection_pairings do |t|
t.belongs_to :depositor, index: true, foreign_key: true
t.belongs_to :collection, index: true, foreign_key: true

t.timestamps null: false
end
end
end
6 changes: 6 additions & 0 deletions db/migrate/20250115165848_remove_foreign_keys_deposits.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class RemoveForeignKeysDeposits < ActiveRecord::Migration[7.2]
def change
remove_foreign_key "deposits", "collections"
remove_foreign_key "deposits", "depositors"
end
end
13 changes: 13 additions & 0 deletions db/migrate/20250115170159_drop_depositors.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class DropDepositors < ActiveRecord::Migration[7.2]
def change
remove_index :depositors, :name, unique: true
remove_index :depositors, :basic_authentication_user_id, unique: true
drop_table :depositors do |t|
t.string :name, null: false
t.string :basic_authentication_user_id, null: false
t.string :password_digest, null: false

t.timestamps null: false
end
end
end
19 changes: 19 additions & 0 deletions db/migrate/20250115171018_drop_collections.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
class DropCollections < ActiveRecord::Migration[7.2]
def change
remove_index :collections, :name, unique: true
remove_index :collections, :slug, unique: true
drop_table :collections do |t|
t.string :name, null: false
t.string :atom_title, null: false
t.string :slug, null: false
t.string :hyacinth_project_string_key
t.string :parser
t.text :abstract
t.text :mime_types
t.text :sword_package_types
t.boolean :mediation_enabled, default: false

t.timestamps null: false
end
end
end
42 changes: 1 addition & 41 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,42 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.2].define(version: 2024_11_22_185253) do
create_table "collections", force: :cascade do |t|
t.string "name", null: false
t.string "atom_title", null: false
t.string "slug", null: false
t.string "hyacinth_project_string_key"
t.string "parser"
t.text "abstract"
t.text "mime_types"
t.text "sword_package_types"
t.boolean "mediation_enabled", default: false
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
t.index ["name"], name: "index_collections_on_name", unique: true
t.index ["slug"], name: "index_collections_on_slug", unique: true
end

create_table "depositor_collection_pairings", force: :cascade do |t|
t.integer "depositor_id"
t.integer "collection_id"
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
t.index ["collection_id"], name: "index_depositor_collection_pairings_on_collection_id"
t.index ["depositor_id"], name: "index_depositor_collection_pairings_on_depositor_id"
end

create_table "depositors", force: :cascade do |t|
t.string "name", null: false
t.string "basic_authentication_user_id", null: false
t.string "password_digest", null: false
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
t.index ["basic_authentication_user_id"], name: "index_depositors_on_basic_authentication_user_id", unique: true
t.index ["name"], name: "index_depositors_on_name", unique: true
end

ActiveRecord::Schema[7.2].define(version: 2025_01_15_171018) do
create_table "deposits", force: :cascade do |t|
t.integer "depositor_id"
t.integer "collection_id"
Expand Down Expand Up @@ -88,9 +53,4 @@
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
t.index ["uid"], name: "index_users_on_uid", unique: true
end

add_foreign_key "depositor_collection_pairings", "collections"
add_foreign_key "depositor_collection_pairings", "depositors"
add_foreign_key "deposits", "collections"
add_foreign_key "deposits", "depositors"
end

0 comments on commit 2fa9da3

Please sign in to comment.