You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

045_create_boards.rb 612B

123456789101112131415161718
  1. class CreateBoards < ActiveRecord::Migration[4.2]
  2. def self.up
  3. create_table :boards do |t|
  4. t.column :project_id, :integer, :null => false
  5. t.column :name, :string, :default => "", :null => false
  6. t.column :description, :string
  7. t.column :position, :integer, :default => 1
  8. t.column :topics_count, :integer, :default => 0, :null => false
  9. t.column :messages_count, :integer, :default => 0, :null => false
  10. t.column :last_message_id, :integer
  11. end
  12. add_index :boards, [:project_id], :name => :boards_project_id
  13. end
  14. def self.down
  15. drop_table :boards
  16. end
  17. end