class Collection < ActiveRecord::Base
+ include AssignUuid
+ include KindAndEtag
+ include CommonApiTemplate
+
+ api_accessible :superuser, :extend => :common do |t|
+ t.add :locator
+ t.add :portable_data_hash
+ t.add :name
+ t.add :redundancy
+ t.add :redundancy_confirmed_by_client
+ t.add :redundancy_confirmed_at
+ t.add :redundancy_confirmed_as
+ end
end
class Metadatum < ActiveRecord::Base
+ include AssignUuid
+ include KindAndEtag
+ include CommonApiTemplate
serialize :info, Hash
-
before_validation :populate_native_target
- include AssignUuid
+
+ api_accessible :superuser, :extend => :common do |t|
+ t.add :target_kind
+ t.add :target_uuid
+ t.add :metadata_class
+ t.add :key
+ t.add :value
+ t.add :info
+ end
def info
@info ||= Hash.new
class Pipeline < ActiveRecord::Base
include AssignUuid
+ include KindAndEtag
+ include CommonApiTemplate
serialize :components, Hash
+
+ api_accessible :superuser, :extend => :common do |t|
+ t.add :name
+ t.add :components
+ end
end
--- /dev/null
+class AddIndexToCollectionsAndMetadata < ActiveRecord::Migration
+ def up
+ add_index :collections, :uuid, :unique => true
+ add_index :metadata, :uuid, :unique => true
+ end
+ def down
+ remove_index :metadata, :uuid
+ remove_index :collections, :uuid
+ end
+end
+# encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20130109220548) do
+ActiveRecord::Schema.define(:version => 20130113214204) do
create_table "collections", :force => true do |t|
t.string "locator"
t.string "uuid"
end
+ add_index "collections", ["uuid"], :name => "index_collections_on_uuid", :unique => true
+
create_table "metadata", :force => true do |t|
t.string "uuid"
t.string "created_by_client"
t.datetime "updated_at"
end
+ add_index "metadata", ["uuid"], :name => "index_metadata_on_uuid", :unique => true
+
create_table "nodes", :force => true do |t|
t.string "uuid"
t.string "created_by_client"