Cross Reference:
xref
: /
ontohub
/
db
/
migrate
/
20120307152935_create_sentences.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
20120307152935_create_sentences.rb revision 22e260fcd85642794d99c2ffaa333f2ef6ed7828
class
CreateSentences
<
ActiveRecord
::
Migration
def
change
create_table
:
sentences
do
|t|
t.references
:
ontology
, :
null
=>
false
t.string
:
name
, :
null
=>
false
t.text
:
text
, :
null
=>
false
t.string
:
range
t.boolean
:
is_definition
, :
null
=>
false
, :
default
=>
false
t.boolean
:
is_axiom
, :
null
=>
false
, :
default
=>
false
t.integer
:
comments_count
, :
null
=>
false
, :
default
=>
0
t.timestamps
:
null
=>
false
end
change_table
:
sentences
do
|t|
t.index
[:
ontology_id
, :
id
], :
unique
=>
true
t.index
[:
ontology_id
, :
name
], :
unique
=>
true
t.foreign
_key
:
ontologies
, :
dependent
=> :
delete
end
end
end