Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use one model and table for reference and version relations. #296
- Loading branch information
Martin Fenner
committed
Apr 25, 2015
1 parent
2554867
commit d62ea67
Showing
26 changed files
with
120 additions
and
211 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 was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
app/decorators/version_relation_decorator.rb → app/decorators/relation_decorator.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
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 was deleted.
Oops, something went wrong.
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
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,13 @@ | ||
class AddVersionsTable < ActiveRecord::Migration | ||
def up | ||
rename_table :relationships, :reference_relations | ||
add_column :relation_types, :describes_reference, :boolean, default: true | ||
|
||
create_table "version_relations", force: :cascade do |t| | ||
t.integer "work_id", limit: 4, null: false | ||
t.integer "related_work_id", limit: 4, null: false | ||
t.integer "source_id", limit: 4 | ||
t.integer "relation_type_id", limit: 4, null: false | ||
t.datetime "created_at", null: false | ||
t.datetime "updated_at", null: false | ||
t.integer "level", limit: 4, default: 1 | ||
end | ||
rename_table :relationships, :relations | ||
add_column :relation_types, :level, :integer, default: 1 | ||
remove_column :relation_types, :inverse | ||
end | ||
|
||
def down | ||
rename_table :reference_relations, :relationships | ||
remove_column :relation_types, :describes_reference | ||
drop_table :version_relations | ||
rename_table :relations, :relationships | ||
remove_column :relation_types, :level | ||
add_column :relation_types, :inverse, :boolean, default: false | ||
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
Oops, something went wrong.