Bruce,
For someone who is just installed Rails, could give a brief description
of
how or where we plug in this schema to try it out in Rails ?
David
On Wednesday 19 April 2006 11:03 pm, Bruce D'Arcus wrote:
> Apropropos in part of today's DOI post, I've been slowly working a bit
> more on a possible data model through a Rails app. Below is the schema
> definition in Ruby, with comments. I still need to figure out what to
> do about titles/alternate titles, and dates. Let me know what you
> think.
>
> The core class is a ReferenceItem, which can:
>
> belong to a container, or a collection
> be linked to an original version or an event
> have many
> identifiers
> locators
> contributors*
> notes
> tags
>
> The Contributor class, in turn, has a primary name, and may also have
> either a name in another script, and/or a previous name (I thought
> about allowing many names, but I think that's unnecessarily
> complicated).
>
> BTW, for user authentication and identification, I think I'm going to
> use OpenID. Could be kind of interesting to see this picked up by bib
> apps.
>
> http://openid.net/
>
> Bruce
>
> * Right now these means multiple publishers too, but that's mostly
> because I can't figure out how to only have one!
>
> class InitialSchema < ActiveRecord::Migration
> def self.up
>
> create_table "reference_items" do |t|
> # any citable item
> t.column "title", :string
> t.column "year", :integer, :limit => 4
> t.column "type", :string, :limit => 15
> t.column "container_id", :integer
> t.column "collection_id", :integer
> t.column "original_id", :integer
> t.column "event_id", :integer
> end
>
> create_table "collections" do |t|
> # any non-citable collection (subclasses of Periodical, etc.)
> t.column "title", :string
> t.column "short_title", :string
> t.column "description", :text
> end
>
> create_table "contributions" do |t|
> # includes roles of Author, Editor, Publisher, Translator
> t.column "reference_item_id", :integer
> t.column "contributor_id", :integer
> t.column "position", :integer
> t.column "role", :string, :limit => 15
> end
>
> create_table "contributors" do |t|
> # names are really difficult if you want to be international;
> # for now I've only a maximum of three specific names, stored
> # in a separate table
> t.column "name_id", :integer
> t.column "previous_name_id", :integer
> t.column "original_script_name_id", :integer
> t.column "type", :string, :limit => 15, :default => "Person"
> end
>
> create_table "names" do |t|
> t.column "full", :string
> t.column "given", :string
> t.column "family", :string
> t.column "prefix", :string, :limit => 10
> t.column "suffix", :string, :limit => 10
> t.column "articular", :string, :limit => 5
> # a switch to correctly handle sorting for non-Western names
> t.column "given_first", :boolean, :default => true
> t.column "changed_on", :integer
> end
>
> create_table "identifiers" do |t|
> # includes DOIs of course
> t.column "reference_item_id", :integer
> t.column "value", :string
> t.column "type", :string, :limit => 15
> end
>
> create_table "locators" do |t|
> # includes volume, issue, pages, and maybe also box, folder, etc.
> # for archival documents (Matt?)
> t.column "reference_item_id", :integer
> t.column "value", :string
> t.column "type", :string, :limit => 15
> end
>
> create_table "notes" do |t|
> t.column "reference_item_id", :integer
> t.column "content", :string
> t.column "type", :string, :limit => 15
> end
>
> create_table :tags do |t|
> t.column "reference_item_id", :integer
> t.column "name", :string
> end
>
> end
>
> def self.down
> drop_table :contributors
> drop_table :contributions
> drop_table :names
> drop_table :tags
> drop_table :reference_items
> drop_table :collections
> drop_table :notes
> drop_table :identifiers
> drop_table :locators
> end
>
> end
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]