Skip to content
Snippets Groups Projects
Commit 3a04f4e9 authored by Charlotte Hausman's avatar Charlotte Hausman
Browse files

remove duplicate staff entries from qa_staff

parent b81ce761
No related branches found
Tags end-of-sprint-46
3 merge requests!1390Catch up with Main,!1308Catchup with main 2.8.1,!1301remove duplicate staff entries from qa_staff
Pipeline #9388 passed
Pipeline: workspaces

#9399

    Pipeline: workspaces

    #9398

      ......@@ -41,6 +41,33 @@ def upgrade():
      WHERE "group" = 'DA';
      """
      )
      # Remove duplicate entries
      op.execute(
      """
      CREATE TABLE qa_staff_tmp (LIKE qa_staff);
      """
      )
      op.execute(
      """
      INSERT INTO qa_staff_tmp(user_name, "group", available, email)
      SELECT
      DISTINCT ON (user_name, "group") user_name, "group", available, email
      FROM qa_staff;
      """
      )
      op.execute(
      """
      DROP TABLE qa_staff;
      """
      )
      op.execute(
      """
      ALTER TABLE qa_staff_tmp
      RENAME TO qa_staff;
      """
      )
      # Put back unique constraint
      op.execute(
      """
      ALTER TABLE qa_staff
      ......
      0% Loading or .
      You are about to add 0 people to the discussion. Proceed with caution.
      Finish editing this message first!
      Please register or to comment