Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
gy4443
chemotion_eln_server
Commits
2a1f253e
Commit
2a1f253e
authored
Aug 17, 2015
by
Rafael Jung
Browse files
Creation of the Molecule model
parent
8cd31405
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/models/molecule.rb
0 → 100644
View file @
2a1f253e
class
Molecule
<
ActiveRecord
::
Base
belongs_to
:sample
validates_uniqueness_of
:inchikey
end
db/migrate/20150817200859_create_molecules.rb
0 → 100644
View file @
2a1f253e
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
db/schema.rb
View file @
2a1f253e
...
...
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
20150817085
601
)
do
ActiveRecord
::
Schema
.
define
(
version:
20150817
20
085
9
)
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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment