Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local installation fails on migration #243

Closed
aerugo opened this issue Jul 7, 2020 · 3 comments
Closed

Local installation fails on migration #243

aerugo opened this issue Jul 7, 2020 · 3 comments
Assignees

Comments

@aerugo
Copy link

aerugo commented Jul 7, 2020

I'm following this guide to install Discourse locally for testing and development.

When running the migrations according to the instructions (RAILS_ENV=test bundle exec rake db:create db:migrate), it breaks:

== 20190429180007 AddAnnotatorStoreTagNames: migrating ========================
-- create_table(:annotator_store_tag_names, {})
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

PG::DuplicateTable: ERROR:  relation "annotator_store_tag_names" already exists

@aerugo
Copy link
Author

aerugo commented Jul 7, 2020

@gdpelican, did you manage to set it up locally?

@gdpelican
Copy link

I did yes, although I do remember there being some fiddling with the annotator-store gem (although I believe it was a different issue than the one you've posted)

That's a real weird error because the table name referenced only appears once in the migrations, so not sure why it would exist already; you might try a rake db:drop db:create to see if running the migrations from scratch helps.

Failing that, putting a check in the migration like

create_table : annotator_store_tag_names  do |t|
  ...
end unless ActiveRecord::Base.connection.table_exists?('annotator_store_tag_names')

Will hackily get around the problem.

@damingo
Copy link
Member

damingo commented Jan 6, 2022

This is now resolved. Renaming the "annotator_store-gem" to "discourse-annotator" required namespace changes (that were used in migrations) as well as renaming all tables. So it made sense to replace all previous migrations with just one.

@damingo damingo closed this as completed Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants