Updated

db/migrate / 20160210174624_create_locations.rb

A
15 lines of codes
1 methods
10.8 complexity/method
1 churn
10.75 complexity
0 duplications
class CreateLocations < ActiveRecord::Migration
  1. CreateLocations has no descriptive comment
def change
  1. CreateLocations#change has approx 9 statements
create_table :locations do |t|
  1. CreateLocations#change has the variable name 't'
t.string :code, limit: 30, null: false
  1. CreateLocations#change refers to 't' more than self (maybe move it to another class?) Locations: 0 1 2 3 4
t.string :name, limit: 100, null: false
  1. CreateLocations#change refers to 't' more than self (maybe move it to another class?) Locations: 0 1 2 3 4
t.date :start_date
  1. CreateLocations#change refers to 't' more than self (maybe move it to another class?) Locations: 0 1 2 3 4
t.date :end_date
  1. CreateLocations#change refers to 't' more than self (maybe move it to another class?) Locations: 0 1 2 3 4
t.timestamps
  1. CreateLocations#change refers to 't' more than self (maybe move it to another class?) Locations: 0 1 2 3 4
end add_index :locations, :code, unique: true add_index :locations, :name, unique: true add_index :locations, [:start_date, :end_date] end end