OpenProject is the leading open source project management software.
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.
openproject/db/migrate/20181118193730_create_grid.rb

33 lines
653 B

class CreateGrid < ActiveRecord::Migration[5.1]
def change
create_grids
create_grid_widgets
end
private
def create_grids
create_table :grids do |t|
t.integer :row_count, null: false
t.integer :column_count, null: false
t.string :type
t.references :user
t.timestamps
end
end
def create_grid_widgets
create_table :grid_widgets do |t|
t.integer :start_row, null: false
t.integer :end_row, null: false
t.integer :start_column, null: false
t.integer :end_column, null: false
t.string :identifier
t.text :options
t.references :grid
end
end
end