@@ -38,7 +38,8 @@ defmodule DatabaseMigration do
38
38
"Reward" => nil ,
39
39
"Claim" => "claims" ,
40
40
"BountyCharge" => "transactions" ,
41
- "BountyTransfer" => "transactions"
41
+ "BountyTransfer" => "transactions" ,
42
+ "GithubInstallation" => "installations"
42
43
}
43
44
44
45
@ schema_mappings % {
@@ -52,10 +53,11 @@ defmodule DatabaseMigration do
52
53
"Reward" => nil ,
53
54
"Claim" => Claim ,
54
55
"BountyCharge" => Transaction ,
55
- "BountyTransfer" => Transaction
56
+ "BountyTransfer" => Transaction ,
57
+ "GithubInstallation" => Installation
56
58
}
57
59
58
- @ backfilled_tables [ "repositories" , "transactions" , "bounties" , "tickets" , "users" ]
60
+ @ backfilled_tables [ "installations" , " repositories", "transactions" , "claims ", "bounties" , "tickets" , "users" ]
59
61
60
62
@ relevant_tables Map . keys ( @ table_mappings )
61
63
@@ -421,6 +423,22 @@ defmodule DatabaseMigration do
421
423
}
422
424
end
423
425
426
+ defp transform ( "GithubInstallation" , row , _db ) do
427
+ % {
428
+ "id" => row [ "id" ] ,
429
+ "provider" => "github" ,
430
+ "provider_id" => row [ "github_id" ] ,
431
+ "provider_meta" => nil ,
432
+ "avatar_url" => nil ,
433
+ "repository_selection" => nil ,
434
+ "owner_id" => nil ,
435
+ "connected_user_id" => nil ,
436
+ "inserted_at" => row [ "created_at" ] ,
437
+ "updated_at" => row [ "updated_at" ] ,
438
+ "provider_user_id" => nil
439
+ }
440
+ end
441
+
424
442
defp transform ( _ , _row , _db ) , do: nil
425
443
426
444
def process_dump ( input_file , output_file ) do
0 commit comments