Commit 2a1f253e authored by Rafael Jung's avatar Rafael Jung
Browse files

Creation of the Molecule model

parent 8cd31405
class Molecule < ActiveRecord::Base
belongs_to :sample
validates_uniqueness_of :inchikey
end
class CreateMolecules < ActiveRecord::Migration
def change
create_table :molecules do |t|
t.integer :sample_id
t.string :inchikey
t.string :inchistring
t.float :density
t.float :molecular_weight
t.binary :molfile
t.float :melting_point
t.float :boiling_point
t.string :sum_formular
t.string :names, array: true, default: []
t.string :iupac_name
t.string :molecule_svg_file
t.timestamps null: false
end
add_index :molecules, :inchikey, unique: true
end
end
......@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20150817085601) do
ActiveRecord::Schema.define(version: 20150817200859) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
......@@ -49,6 +49,25 @@ ActiveRecord::Schema.define(version: 20150817085601) do
add_index "collections_samples", ["collection_id"], name: "index_collections_samples_on_collection_id", using: :btree
add_index "collections_samples", ["sample_id"], name: "index_collections_samples_on_sample_id", using: :btree
create_table "molecules", force: :cascade do |t|
t.integer "sample_id"
t.string "inchikey"
t.string "inchistring"
t.float "density"
t.float "molecular_weight"
t.binary "molfile"
t.float "melting_point"
t.float "boiling_point"
t.string "sum_formular"
t.string "names", default: [], array: true
t.string "iupac_name"
t.string "molecule_svg_file"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
add_index "molecules", ["inchikey"], name: "index_molecules_on_inchikey", unique: true, using: :btree
create_table "reactions", force: :cascade do |t|
t.string "name"
t.datetime "created_at", null: false
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment