Class: AddColorToProjects

Inherits:
Object
  • Object
show all
Defined in:
lib/twenty-backend/migration/3_add_color_to_projects.rb

Instance Method Summary collapse

Instance Method Details

#downObject



7
8
9
# File 'lib/twenty-backend/migration/3_add_color_to_projects.rb', line 7

def down
  drop_column :projects, :color
end

#upObject



2
3
4
5
# File 'lib/twenty-backend/migration/3_add_color_to_projects.rb', line 2

def up
  default = Twenty::ColorableMixin.random_color
  add_column :projects, :color, :string, null: false, default:
end