All posts changed to post_type=3 while migration


as described here Upgrade fails while migrating we’re currently upgrading from a very old installation of discourse to the current v2.3.2. We’ve recognized that all posts have been changed to post_type=3 while the migration-process.

We’ve seen that an old but updated migration-script causes this “destruction”.

It seems that it has to be this way to make the string-append work:

sql = "UPDATE posts SET action_code = 'autoclosed.enabled', post_type = 3 "
sql += "WHERE post_type = 2 AND ("
sql += { |s| "raw ~* #{ActiveRecord::Base.connection.quote(s)}" }.join(' OR ')
sql += ")"

The current migration-step produces this query/output:

== 20150729150523 MigrateAutoClosePosts: migrating ============================
-- execute("UPDATE posts SET action_code = 'autoclosed.enabled', post_type = 3 ")

Kind Regards


@gerhard can you fix that migration and validate that our migrations are “frozen-strings”-compatible?

1 Like

Thanks for reporting that issue. Fixed in