mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-14 21:24:54 +08:00
23 lines
571 B
Ruby
23 lines
571 B
Ruby
|
class CreateMyModules < ActiveRecord::Migration
|
||
|
def change
|
||
|
create_table :my_modules do |t|
|
||
|
t.string :name, null: false
|
||
|
t.datetime :due_date
|
||
|
t.string :description
|
||
|
|
||
|
# Positions
|
||
|
t.integer :x, null: false, default: 0
|
||
|
t.integer :y, null: false, default: 0
|
||
|
|
||
|
# Foreign keys
|
||
|
t.integer :project_id, null: false
|
||
|
t.integer :my_module_group_id
|
||
|
|
||
|
t.timestamps null: false
|
||
|
end
|
||
|
add_foreign_key :my_modules, :projects
|
||
|
add_index :my_modules, :project_id
|
||
|
add_index :my_modules, :my_module_group_id
|
||
|
end
|
||
|
end
|