Dev migration error: Discourse AI

PG::UndefinedTable: ERROR:  relation "ai_topic_embeddings_1_1" does not exist
LINE 3:       FROM ai_topic_embeddings_1_1;
                   ^
/home/robert/discourse/plugins/discourse-ai/db/migrate/20240611170905_move_embeddings_to_single_table_per_type.rb:51:in `up'
/home/robert/discourse/lib/freedom_patches/schema_migration_details.rb:8:in `block in exec_migration'
/home/robert/discourse/lib/freedom_patches/schema_migration_details.rb:8:in `exec_migration'
/home/robert/discourse/lib/migration/safe_migrate.rb:28:in `migrate'
/home/robert/discourse/lib/migration/safe_migrate.rb:53:in `migrate'
/home/robert/discourse/lib/tasks/db.rake:267:in `block (2 levels) in <main>'
/home/robert/discourse/lib/distributed_mutex.rb:53:in `block in synchronize'
/home/robert/discourse/lib/distributed_mutex.rb:49:in `synchronize'
/home/robert/discourse/lib/distributed_mutex.rb:49:in `synchronize'
/home/robert/discourse/lib/distributed_mutex.rb:34:in `synchronize'
/home/robert/discourse/lib/tasks/db.rake:242:in `block in <main>'
/home/robert/.rbenv/versions/3.3.2/bin/bundle:25:in `load'
/home/robert/.rbenv/versions/3.3.2/bin/bundle:25:in `<main>'

Caused by:
ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR:  relation "ai_topic_embeddings_1_1" does not exist (ActiveRecord::StatementInvalid)
LINE 3:       FROM ai_topic_embeddings_1_1;
                   ^
/home/robert/discourse/plugins/discourse-ai/db/migrate/20240611170905_move_embeddings_to_single_table_per_type.rb:51:in `up'
/home/robert/discourse/lib/freedom_patches/schema_migration_details.rb:8:in `block in exec_migration'
/home/robert/discourse/lib/freedom_patches/schema_migration_details.rb:8:in `exec_migration'
/home/robert/discourse/lib/migration/safe_migrate.rb:28:in `migrate'
/home/robert/discourse/lib/migration/safe_migrate.rb:53:in `migrate'
/home/robert/discourse/lib/tasks/db.rake:267:in `block (2 levels) in <main>'
/home/robert/discourse/lib/distributed_mutex.rb:53:in `block in synchronize'
/home/robert/discourse/lib/distributed_mutex.rb:49:in `synchronize'
/home/robert/discourse/lib/distributed_mutex.rb:49:in `synchronize'
/home/robert/discourse/lib/distributed_mutex.rb:34:in `synchronize'
/home/robert/discourse/lib/tasks/db.rake:242:in `block in <main>'
/home/robert/.rbenv/versions/3.3.2/bin/bundle:25:in `load'
/home/robert/.rbenv/versions/3.3.2/bin/bundle:25:in `<main>'

Caused by:
PG::UndefinedTable: ERROR:  relation "ai_topic_embeddings_1_1" does not exist (PG::UndefinedTable)
LINE 3:       FROM ai_topic_embeddings_1_1;

Anyone resolved this?

(Running PG 16.3)

For now I’ve deleted the plugin, and the rest of the migration go through.

1 Like

Checkout this

that’s exactly what @Crypto_and_Co just posted, no idea why it was flagged??

(oh they are now a deleted user, very strange, it was a helpful post!)

very messy but yeah, may require a manual effort …

Does this commit address the issue @merefield?

2 Likes

ooh thanks, I’ll check and revert.

appreciate you looking at this!

2 Likes

that worked just great, thanks a bunch @pmusaraj @Falco

2 Likes

Awesome, all props should go to Falco.

1 Like