Relation "scheduler_stats" does not exist

Hey, I recently migrated a pre docker install to the official and blessed dockerball. It works fine, except these errors in the error log web ui:

Job exception: PG::UndefinedTable: ERROR:  relation "scheduler_stats" does not exist
LINE 1: INSERT INTO "scheduler_stats" ("name", "hostname", "pid", "s...
                    ^
: INSERT INTO "scheduler_stats" ("name", "hostname", "pid", "started_at", "live_slots_start") VALUES ('Jobs::ProcessBadgeBacklog', 'Ubuntu-1604-xenial-64-minimal-app
', 105, '2016-08-06 19:03:17.982147', 761057) RETURNING "id"
Job exception: PG::UndefinedTable: ERROR:  relation "application_requests" does not exist
LINE 1: SELECT "application_requests"."id" FROM "application_request...
                                                ^
: SELECT "application_requests"."id" FROM "application_requests" WHERE "application_requests"."date" = '2016-08-06' AND "application_requests"."req_type" = 0

How can I fix this? thanks!

Have you tried entering the container and then running the migrations?

cd /var/discourse
./launcher enter app
rake db:migrate

Yeah, don’t know if it has fixed the problem:

# rake db:migrate

== Seed from /var/www/discourse/db/fixtures/001_categories.rb

== Seed from /var/www/discourse/db/fixtures/002_groups.rb

== Seed from /var/www/discourse/db/fixtures/003_post_action_types.rb
 - PostActionType {:id=>1, :name_key=>"bookmark", :is_flag=>false, :position=>1}
 - PostActionType {:id=>2, :name_key=>"like", :is_flag=>false, :icon=>"heart", :position=>2}
 - PostActionType {:id=>3, :name_key=>"off_topic", :is_flag=>true, :position=>3}
 - PostActionType {:id=>4, :name_key=>"inappropriate", :is_flag=>true, :position=>4}
 - PostActionType {:id=>5, :name_key=>"vote", :is_flag=>false, :position=>5}
 - PostActionType {:id=>8, :name_key=>"spam", :is_flag=>true, :position=>6}
 - PostActionType {:id=>6, :name_key=>"notify_user", :is_flag=>true, :position=>7}
 - PostActionType {:id=>7, :name_key=>"notify_moderators", :is_flag=>true, :position=>8}

== Seed from /var/www/discourse/db/fixtures/004_screened_ip_addresses.rb
 - ScreenedIpAddress {:id=>1, :ip_address=>"10.0.0.0/8", :action_type=>2}
 - ScreenedIpAddress {:id=>2, :ip_address=>"192.168.0.0/16", :action_type=>2}
 - ScreenedIpAddress {:id=>3, :ip_address=>"127.0.0.0/8", :action_type=>2}
 - ScreenedIpAddress {:id=>4, :ip_address=>"172.16.0.0/12", :action_type=>2}
 - ScreenedIpAddress {:id=>5, :ip_address=>"fc00::/7", :action_type=>2}

== Seed from /var/www/discourse/db/fixtures/005_badge_types.rb
 - BadgeType {:id=>1, :name=>"Gold"}
 - BadgeType {:id=>2, :name=>"Silver"}
 - BadgeType {:id=>3, :name=>"Bronze"}

== Seed from /var/www/discourse/db/fixtures/006_badges.rb
 - BadgeGrouping {:id=>1, :name=>"Getting Started", :default_position=>10}
 - BadgeGrouping {:id=>2, :name=>"Community", :default_position=>11}
 - BadgeGrouping {:id=>3, :name=>"Posting", :default_position=>12}
 - BadgeGrouping {:id=>4, :name=>"Trust Level", :default_position=>13}
 - BadgeGrouping {:id=>5, :name=>"Other", :default_position=>14}
 - Badge {:id=>1, :default_name=>"Basic User", :badge_type_id=>3, :query=>"\n  SELECT u.id user_id, current_timestamp granted_at FROM users u\n  WHERE trust_level >= 1 AND (\n    :backfill OR u.id IN (:user_ids)\n  )\n", :default_badge_grouping_id=>4, :trigger=>4, :default_allow_title=>false, :default_icon=>"fa-user", :system=>true}
 - Badge {:id=>2, :default_name=>"Member", :badge_type_id=>3, :query=>"\n  SELECT u.id user_id, current_timestamp granted_at FROM users u\n  WHERE trust_level >= 2 AND (\n    :backfill OR u.id IN (:user_ids)\n  )\n", :default_badge_grouping_id=>4, :trigger=>4, :default_allow_title=>false, :default_icon=>"fa-user", :system=>true}
 - Badge {:id=>3, :default_name=>"Regular", :badge_type_id=>2, :query=>"\n  SELECT u.id user_id, current_timestamp granted_at FROM users u\n  WHERE trust_level >= 3 AND (\n    :backfill OR u.id IN (:user_ids)\n  )\n", :default_badge_grouping_id=>4, :trigger=>4, :default_allow_title=>true, :default_icon=>"fa-user", :system=>true}
 - Badge {:id=>4, :default_name=>"Leader", :badge_type_id=>1, :query=>"\n  SELECT u.id user_id, current_timestamp granted_at FROM users u\n  WHERE trust_level >= 4 AND (\n    :backfill OR u.id IN (:user_ids)\n  )\n", :default_badge_grouping_id=>4, :trigger=>4, :default_allow_title=>true, :default_icon=>"fa-user", :system=>true}
 - Badge {:id=>17, :default_name=>"Reader", :badge_type_id=>3, :multiple_grant=>false, :target_posts=>false, :show_posts=>false, :query=>"  SELECT id user_id, current_timestamp granted_at\n  FROM users\n  WHERE id IN\n  (\n    SELECT pt.user_id\n    FROM post_timings pt\n    JOIN badge_posts b ON b.post_number = pt.post_number AND\n                          b.topic_id = pt.topic_id\n    JOIN topics t ON t.id = pt.topic_id\n    LEFT JOIN user_badges ub ON ub.badge_id = 17 AND ub.user_id = pt.user_id\n    WHERE ub.id IS NULL AND t.posts_count > 100\n    GROUP BY pt.user_id, pt.topic_id, t.posts_count\n    HAVING count(*) >= t.posts_count\n  )\n", :default_badge_grouping_id=>1, :auto_revoke=>false, :system=>true}
 - Badge {:id=>16, :default_name=>"Read Guidelines", :badge_type_id=>3, :multiple_grant=>false, :target_posts=>false, :show_posts=>false, :query=>"  SELECT user_id, read_faq granted_at\n  FROM user_stats\n  WHERE read_faq IS NOT NULL AND (user_id IN (:user_ids) OR :backfill)\n", :default_badge_grouping_id=>1, :trigger=>8, :system=>true}
 - Badge {:id=>14, :default_name=>"First Link", :badge_type_id=>3, :multiple_grant=>false, :target_posts=>true, :show_posts=>true, :query=>"  SELECT l.user_id, l.post_id, l.created_at granted_at\n  FROM\n  (\n    SELECT MIN(l1.id) id\n    FROM topic_links l1\n    JOIN badge_posts p1 ON p1.id = l1.post_id\n    JOIN badge_posts p2 ON p2.id = l1.link_post_id\n    WHERE NOT reflection AND p1.topic_id <> p2.topic_id AND not quote AND\n      (:backfill OR ( p1.id in (:post_ids) ))\n    GROUP BY l1.user_id\n  ) ids\n  JOIN topic_links l ON l.id = ids.id\n", :default_badge_grouping_id=>1, :trigger=>2, :system=>true}
 - Badge {:id=>15, :default_name=>"First Quote", :badge_type_id=>3, :multiple_grant=>false, :target_posts=>true, :show_posts=>true, :query=>"  SELECT ids.user_id, q.post_id, q.created_at granted_at\n  FROM\n  (\n    SELECT p1.user_id, MIN(q1.id) id\n    FROM quoted_posts q1\n    JOIN badge_posts p1 ON p1.id = q1.post_id\n    JOIN badge_posts p2 ON p2.id = q1.quoted_post_id\n    WHERE (:backfill OR ( p1.id IN (:post_ids) ))\n    GROUP BY p1.user_id\n  ) ids\n  JOIN quoted_posts q ON q.id = ids.id\n", :default_badge_grouping_id=>1, :trigger=>2, :system=>true}
 - Badge {:id=>11, :default_name=>"First Like", :badge_type_id=>3, :multiple_grant=>false, :target_posts=>true, :show_posts=>true, :query=>"  SELECT pa1.user_id, pa1.created_at granted_at, pa1.post_id\n  FROM (\n    SELECT pa.user_id, min(pa.id) id\n    FROM post_actions pa\n    JOIN badge_posts p on p.id = pa.post_id\n    WHERE post_action_type_id = 2 AND\n      (:backfill OR pa.post_id IN (:post_ids) )\n    GROUP BY pa.user_id\n  ) x\n  JOIN post_actions pa1 on pa1.id = x.id\n", :default_badge_grouping_id=>1, :trigger=>1, :system=>true}
 - Badge {:id=>13, :default_name=>"First Flag", :badge_type_id=>3, :multiple_grant=>false, :target_posts=>true, :show_posts=>false, :query=>"  SELECT pa1.user_id, pa1.created_at granted_at, pa1.post_id\n  FROM (\n    SELECT pa.user_id, min(pa.id) id\n    FROM post_actions pa\n    JOIN badge_posts p on p.id = pa.post_id\n    WHERE post_action_type_id IN (3,4,7,8) AND\n      (:backfill OR pa.post_id IN (:post_ids) )\n    GROUP BY pa.user_id\n  ) x\n  JOIN post_actions pa1 on pa1.id = x.id\n", :badge_grouping_id=>1, :default_badge_grouping_id=>1, :trigger=>1, :auto_revoke=>false, :system=>true}
 - Badge {:id=>25, :default_name=>"Promoter", :default_icon=>"fa-user-plus", :badge_type_id=>3, :multiple_grant=>false, :target_posts=>false, :show_posts=>false, :query=>"\n  SELECT u.id user_id, current_timestamp granted_at\n  FROM users u\n  WHERE u.id IN (\n    SELECT invited_by_id\n    FROM invites i\n    JOIN users u2 ON u2.id = i.user_id\n    WHERE i.deleted_at IS NULL AND u2.active AND u2.trust_level >= 0 AND not u2.blocked\n    GROUP BY invited_by_id\n    HAVING COUNT(*) >= 1\n  ) AND u.active AND NOT u.blocked AND u.id > 0 AND\n    (:backfill OR u.id IN (:user_ids) )\n", :default_badge_grouping_id=>2, :trigger=>0, :auto_revoke=>true, :system=>true}
 - Badge {:id=>26, :default_name=>"Campaigner", :default_icon=>"fa-user-plus", :badge_type_id=>2, :multiple_grant=>false, :target_posts=>false, :show_posts=>false, :query=>"\n  SELECT u.id user_id, current_timestamp granted_at\n  FROM users u\n  WHERE u.id IN (\n    SELECT invited_by_id\n    FROM invites i\n    JOIN users u2 ON u2.id = i.user_id\n    WHERE i.deleted_at IS NULL AND u2.active AND u2.trust_level >= 1 AND not u2.blocked\n    GROUP BY invited_by_id\n    HAVING COUNT(*) >= 3\n  ) AND u.active AND NOT u.blocked AND u.id > 0 AND\n    (:backfill OR u.id IN (:user_ids) )\n", :default_badge_grouping_id=>2, :trigger=>0, :auto_revoke=>true, :system=>true}
 - Badge {:id=>27, :default_name=>"Champion", :default_icon=>"fa-user-plus", :badge_type_id=>1, :multiple_grant=>false, :target_posts=>false, :show_posts=>false, :query=>"\n  SELECT u.id user_id, current_timestamp granted_at\n  FROM users u\n  WHERE u.id IN (\n    SELECT invited_by_id\n    FROM invites i\n    JOIN users u2 ON u2.id = i.user_id\n    WHERE i.deleted_at IS NULL AND u2.active AND u2.trust_level >= 2 AND not u2.blocked\n    GROUP BY invited_by_id\n    HAVING COUNT(*) >= 5\n  ) AND u.active AND NOT u.blocked AND u.id > 0 AND\n    (:backfill OR u.id IN (:user_ids) )\n", :default_badge_grouping_id=>2, :trigger=>0, :auto_revoke=>true, :system=>true}
 - Badge {:id=>12, :default_name=>"First Share", :badge_type_id=>3, :multiple_grant=>false, :target_posts=>true, :show_posts=>true, :query=>"  SELECT views.user_id, i2.post_id, i2.created_at granted_at\n  FROM\n  (\n    SELECT i.user_id, MIN(i.id) i_id\n    FROM incoming_links i\n    JOIN badge_posts p on p.id = i.post_id\n    WHERE i.user_id IS NOT NULL\n    GROUP BY i.user_id\n  ) as views\n  JOIN incoming_links i2 ON i2.id = views.i_id\n", :default_badge_grouping_id=>1, :trigger=>0, :system=>true}
 - Badge {:id=>21, :default_name=>"Nice Share", :badge_type_id=>3, :multiple_grant=>true, :target_posts=>true, :show_posts=>true, :query=>"  SELECT views.user_id, i2.post_id, current_timestamp granted_at\n  FROM\n  (\n    SELECT i.user_id, MIN(i.id) i_id\n    FROM incoming_links i\n    JOIN badge_posts p on p.id = i.post_id\n    WHERE i.user_id IS NOT NULL\n    GROUP BY i.user_id,i.post_id\n    HAVING COUNT(*) > 25\n  ) as views\n  JOIN incoming_links i2 ON i2.id = views.i_id\n", :default_badge_grouping_id=>2, :trigger=>0, :system=>true}
 - Badge {:id=>22, :default_name=>"Good Share", :badge_type_id=>2, :multiple_grant=>true, :target_posts=>true, :show_posts=>true, :query=>"  SELECT views.user_id, i2.post_id, current_timestamp granted_at\n  FROM\n  (\n    SELECT i.user_id, MIN(i.id) i_id\n    FROM incoming_links i\n    JOIN badge_posts p on p.id = i.post_id\n    WHERE i.user_id IS NOT NULL\n    GROUP BY i.user_id,i.post_id\n    HAVING COUNT(*) > 300\n  ) as views\n  JOIN incoming_links i2 ON i2.id = views.i_id\n", :default_badge_grouping_id=>2, :trigger=>0, :system=>true}
 - Badge {:id=>23, :default_name=>"Great Share", :badge_type_id=>1, :multiple_grant=>true, :target_posts=>true, :show_posts=>true, :query=>"  SELECT views.user_id, i2.post_id, current_timestamp granted_at\n  FROM\n  (\n    SELECT i.user_id, MIN(i.id) i_id\n    FROM incoming_links i\n    JOIN badge_posts p on p.id = i.post_id\n    WHERE i.user_id IS NOT NULL\n    GROUP BY i.user_id,i.post_id\n    HAVING COUNT(*) > 1000\n  ) as views\n  JOIN incoming_links i2 ON i2.id = views.i_id\n", :default_badge_grouping_id=>2, :trigger=>0, :system=>true}
 - Badge {:id=>5, :default_name=>"Welcome", :badge_type_id=>3, :multiple_grant=>false, :target_posts=>true, :show_posts=>true, :query=>"  SELECT p.user_id, min(post_id) post_id, min(pa.created_at) granted_at\n  FROM post_actions pa\n  JOIN badge_posts p on p.id = pa.post_id\n  WHERE post_action_type_id = 2 AND\n      (:backfill OR pa.post_id IN (:post_ids) )\n  GROUP BY p.user_id\n", :default_badge_grouping_id=>2, :trigger=>1, :system=>true}
 - Badge {:id=>9, :default_name=>"Autobiographer", :badge_type_id=>3, :multiple_grant=>false, :query=>"  SELECT u.id user_id, current_timestamp granted_at\n  FROM users u\n  JOIN user_profiles up on u.id = up.user_id\n  WHERE bio_raw IS NOT NULL AND LENGTH(TRIM(bio_raw)) > 10 AND\n        uploaded_avatar_id IS NOT NULL AND\n        (:backfill OR u.id IN (:user_ids) )\n", :default_badge_grouping_id=>1, :trigger=>8, :system=>true}
 - Badge {:id=>10, :default_name=>"Editor", :badge_type_id=>3, :multiple_grant=>false, :query=>"  SELECT p.user_id, min(p.id) post_id, min(p.created_at) granted_at\n  FROM badge_posts p\n  WHERE p.self_edits > 0 AND\n      (:backfill OR p.id IN (:post_ids) )\n  GROUP BY p.user_id\n", :badge_grouping_id=>1, :default_badge_grouping_id=>1, :trigger=>2, :system=>true}
 - Badge {:id=>6, :default_name=>"Nice Post", :badge_type_id=>3, :multiple_grant=>true, :target_posts=>true, :show_posts=>true, :query=>"\n  SELECT p.user_id, p.id post_id, p.updated_at granted_at\n  FROM badge_posts p\n  WHERE p.post_number > 1 AND p.like_count >= 10 AND\n    (:backfill OR p.id IN (:post_ids) )\n", :default_badge_grouping_id=>3, :trigger=>1, :system=>true}
 - Badge {:id=>7, :default_name=>"Good Post", :badge_type_id=>2, :multiple_grant=>true, :target_posts=>true, :show_posts=>true, :query=>"\n  SELECT p.user_id, p.id post_id, p.updated_at granted_at\n  FROM badge_posts p\n  WHERE p.post_number > 1 AND p.like_count >= 25 AND\n    (:backfill OR p.id IN (:post_ids) )\n", :default_badge_grouping_id=>3, :trigger=>1, :system=>true}
 - Badge {:id=>8, :default_name=>"Great Post", :badge_type_id=>1, :multiple_grant=>true, :target_posts=>true, :show_posts=>true, :query=>"\n  SELECT p.user_id, p.id post_id, p.updated_at granted_at\n  FROM badge_posts p\n  WHERE p.post_number > 1 AND p.like_count >= 50 AND\n    (:backfill OR p.id IN (:post_ids) )\n", :default_badge_grouping_id=>3, :trigger=>1, :system=>true}
 - Badge {:id=>18, :default_name=>"Nice Topic", :badge_type_id=>3, :multiple_grant=>true, :target_posts=>true, :show_posts=>true, :query=>"\n  SELECT p.user_id, p.id post_id, p.updated_at granted_at\n  FROM badge_posts p\n  WHERE p.post_number = 1 AND p.like_count >= 10 AND\n    (:backfill OR p.id IN (:post_ids) )\n", :default_badge_grouping_id=>3, :trigger=>1, :system=>true}
 - Badge {:id=>19, :default_name=>"Good Topic", :badge_type_id=>2, :multiple_grant=>true, :target_posts=>true, :show_posts=>true, :query=>"\n  SELECT p.user_id, p.id post_id, p.updated_at granted_at\n  FROM badge_posts p\n  WHERE p.post_number = 1 AND p.like_count >= 25 AND\n    (:backfill OR p.id IN (:post_ids) )\n", :default_badge_grouping_id=>3, :trigger=>1, :system=>true}
 - Badge {:id=>20, :default_name=>"Great Topic", :badge_type_id=>1, :multiple_grant=>true, :target_posts=>true, :show_posts=>true, :query=>"\n  SELECT p.user_id, p.id post_id, p.updated_at granted_at\n  FROM badge_posts p\n  WHERE p.post_number = 1 AND p.like_count >= 50 AND\n    (:backfill OR p.id IN (:post_ids) )\n", :default_badge_grouping_id=>3, :trigger=>1, :system=>true}
 - Badge {:id=>24, :default_name=>"Anniversary", :default_icon=>"fa-clock-o", :badge_type_id=>2, :query=>"  SELECT u.id AS user_id, MIN(u.created_at + interval '1 year') AS granted_at\n    FROM users u\n    JOIN posts p ON p.user_id = u.id\n   WHERE u.id > 0\n     AND u.active\n     AND NOT u.blocked\n     AND u.created_at + interval '1 year' < now()\n     AND p.deleted_at IS NULL\n     AND NOT p.hidden\n     AND p.created_at + interval '1 year' > now()\n     AND (:backfill OR u.id IN (:user_ids))\n   GROUP BY u.id\n   HAVING COUNT(p.id) > 0\n", :default_badge_grouping_id=>2, :trigger=>0, :auto_revoke=>false, :system=>true}
 - Badge {:id=>28, :default_name=>"Popular Link", :badge_type_id=>3, :multiple_grant=>true, :target_posts=>true, :show_posts=>true, :query=>"        SELECT tl.user_id, post_id, current_timestamp granted_at\n          FROM topic_links tl\n          JOIN posts p  ON p.id = post_id    AND p.deleted_at IS NULL\n          JOIN topics t ON t.id = p.topic_id AND t.deleted_at IS NULL AND t.archetype <> 'private_message'\n         WHERE NOT tl.internal\n           AND tl.clicks >= 50\n      GROUP BY tl.user_id, tl.post_id\n", :badge_grouping_id=>3, :default_badge_grouping_id=>3, :trigger=>0, :system=>true}
 - Badge {:id=>29, :default_name=>"Hot Link", :badge_type_id=>2, :multiple_grant=>true, :target_posts=>true, :show_posts=>true, :query=>"        SELECT tl.user_id, post_id, current_timestamp granted_at\n          FROM topic_links tl\n          JOIN posts p  ON p.id = post_id    AND p.deleted_at IS NULL\n          JOIN topics t ON t.id = p.topic_id AND t.deleted_at IS NULL AND t.archetype <> 'private_message'\n         WHERE NOT tl.internal\n           AND tl.clicks >= 300\n      GROUP BY tl.user_id, tl.post_id\n", :badge_grouping_id=>3, :default_badge_grouping_id=>3, :trigger=>0, :system=>true}
 - Badge {:id=>30, :default_name=>"Famous Link", :badge_type_id=>1, :multiple_grant=>true, :target_posts=>true, :show_posts=>true, :query=>"        SELECT tl.user_id, post_id, current_timestamp granted_at\n          FROM topic_links tl\n          JOIN posts p  ON p.id = post_id    AND p.deleted_at IS NULL\n          JOIN topics t ON t.id = p.topic_id AND t.deleted_at IS NULL AND t.archetype <> 'private_message'\n         WHERE NOT tl.internal\n           AND tl.clicks >= 1000\n      GROUP BY tl.user_id, tl.post_id\n", :badge_grouping_id=>3, :default_badge_grouping_id=>3, :trigger=>0, :system=>true}
 - Badge {:id=>36, :name=>"Appreciated", :default_name=>"Appreciated", :default_icon=>"fa-heart", :badge_type_id=>3, :query=>"      SELECT p.user_id, current_timestamp AS granted_at\n      FROM posts AS p\n      WHERE p.like_count >= 1\n        AND (:backfill OR p.user_id IN (:user_ids))\n      GROUP BY p.user_id\n      HAVING count(*) > 20\n", :default_badge_grouping_id=>2, :trigger=>0, :auto_revoke=>false, :system=>true}
 - Badge {:id=>37, :name=>"Respected", :default_name=>"Respected", :default_icon=>"fa-heart", :badge_type_id=>2, :query=>"      SELECT p.user_id, current_timestamp AS granted_at\n      FROM posts AS p\n      WHERE p.like_count >= 2\n        AND (:backfill OR p.user_id IN (:user_ids))\n      GROUP BY p.user_id\n      HAVING count(*) > 100\n", :default_badge_grouping_id=>2, :trigger=>0, :auto_revoke=>false, :system=>true}
 - Badge {:id=>31, :name=>"Admired", :default_name=>"Admired", :default_icon=>"fa-heart", :badge_type_id=>1, :query=>"      SELECT p.user_id, current_timestamp AS granted_at\n      FROM posts AS p\n      WHERE p.like_count >= 5\n        AND (:backfill OR p.user_id IN (:user_ids))\n      GROUP BY p.user_id\n      HAVING count(*) > 300\n", :default_badge_grouping_id=>2, :trigger=>0, :auto_revoke=>false, :system=>true}
 - Badge {:id=>38, :default_name=>"Thank You", :default_icon=>"fa-heart", :badge_type_id=>3, :query=>"      SELECT us.user_id, current_timestamp AS granted_at\n      FROM user_stats AS us\n      INNER JOIN posts AS p ON p.user_id = us.user_id\n      WHERE p.like_count > 0\n        AND us.likes_given >= 10\n        AND (:backfill OR us.user_id IN (:user_ids))\n      GROUP BY us.user_id, us.likes_given\n      HAVING COUNT(*) > 20\n", :badge_grouping_id=>2, :default_badge_grouping_id=>2, :trigger=>0, :auto_revoke=>false, :system=>true}
 - Badge {:id=>32, :default_name=>"Gives Back", :default_icon=>"fa-heart", :badge_type_id=>2, :query=>"      SELECT us.user_id, current_timestamp AS granted_at\n      FROM user_stats AS us\n      INNER JOIN posts AS p ON p.user_id = us.user_id\n      WHERE p.like_count > 0\n        AND us.likes_given >= 100\n        AND (:backfill OR us.user_id IN (:user_ids))\n      GROUP BY us.user_id, us.likes_given\n      HAVING COUNT(*) > 100\n", :badge_grouping_id=>2, :default_badge_grouping_id=>2, :trigger=>0, :auto_revoke=>false, :system=>true}
 - Badge {:id=>39, :default_name=>"Empathetic", :default_icon=>"fa-heart", :badge_type_id=>1, :query=>"      SELECT us.user_id, current_timestamp AS granted_at\n      FROM user_stats AS us\n      INNER JOIN posts AS p ON p.user_id = us.user_id\n      WHERE p.like_count > 0\n        AND us.likes_given >= 1000\n        AND (:backfill OR us.user_id IN (:user_ids))\n      GROUP BY us.user_id, us.likes_given\n      HAVING COUNT(*) > 500\n", :badge_grouping_id=>2, :default_badge_grouping_id=>2, :trigger=>0, :auto_revoke=>false, :system=>true}
 - Badge {:id=>33, :name=>"Out of Love", :default_name=>"Out of Love", :default_icon=>"fa-heart", :badge_type_id=>3, :query=>"      SELECT gdl.user_id, current_timestamp AS granted_at\n      FROM given_daily_likes AS gdl\n      WHERE gdl.limit_reached\n        AND (:backfill OR gdl.user_id IN (:user_ids))\n      GROUP BY gdl.user_id\n      HAVING COUNT(*) >= 1\n", :badge_grouping_id=>2, :default_badge_grouping_id=>2, :trigger=>0, :auto_revoke=>false, :system=>true}
 - Badge {:id=>34, :name=>"Higher Love", :default_name=>"Higher Love", :default_icon=>"fa-heart", :badge_type_id=>2, :query=>"      SELECT gdl.user_id, current_timestamp AS granted_at\n      FROM given_daily_likes AS gdl\n      WHERE gdl.limit_reached\n        AND (:backfill OR gdl.user_id IN (:user_ids))\n      GROUP BY gdl.user_id\n      HAVING COUNT(*) >= 5\n", :badge_grouping_id=>2, :default_badge_grouping_id=>2, :trigger=>0, :auto_revoke=>false, :system=>true}
 - Badge {:id=>35, :name=>"Crazy in Love", :default_name=>"Crazy in Love", :default_icon=>"fa-heart", :badge_type_id=>1, :query=>"      SELECT gdl.user_id, current_timestamp AS granted_at\n      FROM given_daily_likes AS gdl\n      WHERE gdl.limit_reached\n        AND (:backfill OR gdl.user_id IN (:user_ids))\n      GROUP BY gdl.user_id\n      HAVING COUNT(*) >= 20\n", :badge_grouping_id=>2, :default_badge_grouping_id=>2, :trigger=>0, :auto_revoke=>false, :system=>true}
 - Badge {:id=>40, :default_name=>"First Mention", :badge_type_id=>3, :multiple_grant=>false, :target_posts=>true, :show_posts=>true, :query=>"  SELECT acting_user_id AS user_id, min(target_post_id) AS post_id, min(p.created_at) AS granted_at\n  FROM user_actions\n  JOIN posts p ON p.id = target_post_id\n  JOIN topics t ON t.id = topic_id\n  JOIN categories c on c.id = category_id\n  WHERE action_type = 7\n    AND NOT read_restricted\n    AND p.deleted_at IS  NULL\n    AND t.deleted_at IS  NULL\n    AND t.visible\n    AND t.archetype <> 'private_message'\n    AND (:backfill OR p.id IN (:post_ids))\n  GROUP BY acting_user_id\n", :badge_grouping_id=>1, :default_badge_grouping_id=>1, :trigger=>2, :system=>true}
 - Badge {:id=>41, :default_name=>"First Emoji", :badge_type_id=>3, :multiple_grant=>false, :target_posts=>true, :show_posts=>true, :query=>nil, :badge_grouping_id=>1, :default_badge_grouping_id=>1, :trigger=>16, :system=>true}
 - Badge {:id=>42, :default_name=>"First Onebox", :badge_type_id=>3, :multiple_grant=>false, :target_posts=>true, :show_posts=>true, :query=>nil, :badge_grouping_id=>1, :default_badge_grouping_id=>1, :trigger=>16, :system=>true}
 - Badge {:id=>43, :default_name=>"First Reply By Email", :badge_type_id=>3, :multiple_grant=>false, :target_posts=>true, :show_posts=>true, :query=>nil, :badge_grouping_id=>1, :default_badge_grouping_id=>1, :trigger=>16, :system=>true}

== Seed from /var/www/discourse/db/fixtures/009_users.rb
 - User {:id=>-1, :name=>"system", :username=>"system", :username_lower=>"system", :email=>"no_email", :password=>"08bcc8171320ed7f011b9384463dd6e0", :active=>true, :admin=>true, :moderator=>true, :approved=>true, :trust_level=>4}

== Seed from /var/www/discourse/db/fixtures/500_lounge_category.rb

== Seed from /var/www/discourse/db/fixtures/501_meta_category.rb

== Seed from /var/www/discourse/db/fixtures/502_staff_category.rb

== Seed from /var/www/discourse/db/fixtures/999_settings.rb

== Seed from /var/www/discourse/db/fixtures/999_topics.rb

Just seem to be seeds.

edit: It seems to work now, so I have marked the thread as solved. Thanks!

1 Like