Skip to content

Commit ed1f362

Browse files
committed
more fixes
1 parent d1680a3 commit ed1f362

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

scripts/database_migration.exs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -334,14 +334,16 @@ defmodule DatabaseMigration do
334334
raise "Owner not found: #{inspect(row)}"
335335
end
336336

337-
%{
338-
"id" => row["id"],
339-
"org_id" => owner["id"],
340-
"role" => row["role"],
341-
"user_id" => row["user_id"],
342-
"inserted_at" => row["created_at"],
343-
"updated_at" => row["updated_at"]
344-
}
337+
if owner["id"] != row["user_id"] do
338+
%{
339+
"id" => row["id"],
340+
"org_id" => owner["id"],
341+
"role" => row["role"],
342+
"user_id" => row["user_id"],
343+
"inserted_at" => row["created_at"],
344+
"updated_at" => row["updated_at"]
345+
}
346+
end
345347
end
346348

347349
defp transform({"Bounty", Bounty}, row, db) do
@@ -1263,8 +1265,8 @@ defmodule DatabaseMigration do
12631265
end
12641266

12651267
def run! do
1266-
input_file = ".local/prod_db.sql"
1267-
output_file = ".local/prod_db_new.sql"
1268+
input_file = ".local/db/v1-data-2025-02-10.sql"
1269+
output_file = ".local/db/v2-data-2025-02-10.sql"
12681270

12691271
if File.exists?(input_file) or File.exists?(output_file) do
12701272
IO.puts("\nStarting migration...")

0 commit comments

Comments
 (0)