Project

General

Profile

Test and Development databases are empty

Added by Shane Corbin about 7 years ago

I recently installed redmine on a server in our office. I also installed the knowledge_base plugin but I don't think it installed correctly. After clicking on a project I try to click on the "Activity" tab and get the following message:

ActiveRecord::StatementInvalid (Mysql2::Error: Table 'redmine_production.kb_articles' doesn't exist: SELECT `kb_articles`.* FROM `kb_articles` INNER JOIN `projects` ON `projects`.`id` = `kb_articles`.`project_id` WHERE (updated_at BETWEEN '2017-01-01' AND '2017-01-31') AND (((projects.id = 10 OR (projects.lft > 1 AND projects.rgt < 14))) AND (projects.status = 1 AND projects.id IN (SELECT em.project_id FROM enabled_modules em WHERE em.name='knowledgebase')))):

So after receiving this message I tried to uninstall the knowledge_base plugin using the instructions included with the plugin as follows:

rake redmine:plugins:migrate NAME=redmine_knowledgebase VERSION=0

Among the results I got this:

ActiveRecord::StatementInvalid: Mysql2::Error: Table 'redmine_development.schema_migrations' doesn't exist: SELECT version FROM schema_migrations

Then I attempted to install the plugin again without uninstalling first and among the results I got this:

ActiveRecord::StatementInvalid: Mysql2::Error: Table 'redmine_development.schema_migrations' doesn't exist: SELECT version FROM schema_migrations

So since they both pointed to the redmine_development database I checked the redmine_development database for the existence of said table and I find a completely empty database. The database exists but is 100% empty. My environment is set to production so my question is what does the unused development database have to do with production use of this plugin and also, as it seems to be necessary, how can I go about rebuilding this database. I also noticed there is a test database which is also 100% empty. If this is not possible, how would I go about migrating my production database to a fresh install without migrating the empty databases as well.

I appreciate, and thank you in advance for, any help you may be able to offer.


Replies (3)

RE: Test and Development databases are empty - Added by Shane Corbin about 7 years ago

I understand how to set the environment variable. What I don't understand is why it is looking for a table in the development database when I am running in the production environment, and how I go about rebuilding the development database since it seems necessary regardless of which environment I have set.

    (1-3/3)