fraoustin/redmine_indicator

Typo preventing plugin migration

Closed this issue · 4 comments

Hey,

First of all great work!

While testing it with Redmine 4.1.1 I spotted two typos which prevented the command :
"rake redmine:plugins NAME=redmine_indicator VERSION=0 RAILS_env=production"
to run successfully and cleanup the DB.

File : db/migrate/20191221_indicator_custom_fields.rb

Line 31 : "ProjectCustomField.find_by_name('indicator_left_right').delete unless ProjectCustomField.find_by_name('indicator_right').nil?" -> "ProjectCustomField.find_by_name('indicator_left_right').delete unless ProjectCustomField.find_by_name('indicator_left_right').nil?"

File : db/migrate/20200519_indicator_project_sttings_add.rb

Line 16 : "remov_column :projects, :indicator_right, :text" -> "remove_column :projects, :indicator_right, :text"

Cheers,
Jérémie Melly

Hi Jeremy
What is our environment ? Version of ror ? Do you use postgresql or mysql or sqlite ?
I try to create a new environment for Check thé plugin with redmine 4.1.1

I check the last version with docker

My Dockerfile is

FROM redmine
WORKDIR /usr/src/redmine/plugins
RUN git clone https://github.com/fraoustin/redmine_indicator.git
WORKDIR /usr/src/redmine/

and load with

docker build -t myredmine .
docker run -d -p 3000:3000 -e REDMINE_PLUGINS_MIGRATE=1 --name myredmine myredmine

And all it's ok ...

I tested with running manually install of plugin

docker run -d -p 3000:3000 --name myredmine myredmine
docker exec -it myredmine bash
> rake redmine:plugins NAME=redmine_indicator VERSION=0 RAILS_env=production

And all it's ok ...

I think that the problem is the version of ROR. What is your version?

Thank you for your help @fraoustin

I'm talking about this typo in the master branch :

File : db/migrate/20200519_indicator_project_sttings_add.rb line 16

# method called when installing the plugin
  def self.down
    remove_column :projects, :indicator_left_top, :text
    remove_column :projects, :indicator_left_bottom, :text
    remov_column :projects, :indicator_right, :text

It seems like the last line misses a "e" at remov_column.

And this typo :

File : db/migrate/20191221_indicator_custom_fields.rb Line 31

# method called when installing the plugin
    def self.down
      ProjectCustomField.find_by_name('indicator_left_top').delete unless ProjectCustomField.find_by_name('indicator_left_top').nil?
      ProjectCustomField.find_by_name('indicator_left_bottom').delete unless ProjectCustomField.find_by_name('indicator_left_bottom').nil?
      ProjectCustomField.find_by_name('indicator_left_right').delete unless ProjectCustomField.find_by_name('indicator_right').nil?
    end

It seems like there is no ProjectCustomField named "indicator_right" but "indicator_left_right" this is probably what you meant.

As soon as I applied those changes everything started to work just fine :)

Thanks again for your work!

Cheers,
Jérémie Melly

Ok thank you very much
I modified the code with tag 0.2.16