File tree 2 files changed +52
-0
lines changed
2 files changed +52
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ mod m0000060_perf_adv_vuln3;
13
13
mod m0000070_perf_adv_vuln4;
14
14
mod m0000080_get_purl_refactor;
15
15
mod m0000090_release_perf;
16
+ mod m0000100_perf_adv_vuln5;
16
17
mod m0000970_alter_importer_add_heartbeat;
17
18
18
19
pub struct Migrator ;
@@ -31,6 +32,7 @@ impl MigratorTrait for Migrator {
31
32
Box :: new( m0000070_perf_adv_vuln4:: Migration ) ,
32
33
Box :: new( m0000080_get_purl_refactor:: Migration ) ,
33
34
Box :: new( m0000090_release_perf:: Migration ) ,
35
+ Box :: new( m0000100_perf_adv_vuln5:: Migration ) ,
34
36
]
35
37
}
36
38
}
Original file line number Diff line number Diff line change
1
+ use sea_orm_migration:: prelude:: * ;
2
+
3
+ #[ derive( DeriveMigrationName ) ]
4
+ pub struct Migration ;
5
+
6
+ #[ async_trait:: async_trait]
7
+ #[ allow( deprecated) ]
8
+ impl MigrationTrait for Migration {
9
+ async fn up ( & self , manager : & SchemaManager ) -> Result < ( ) , DbErr > {
10
+ manager
11
+ . get_connection ( )
12
+ . execute_unprepared (
13
+ "
14
+ DROP INDEX IF EXISTS advisory_vulnerability_vulnerability_id_gist;
15
+ CREATE INDEX advisory_vulnerability_vulnerability_id_gist ON advisory_vulnerability USING GIST (vulnerability_id gist_trgm_ops);
16
+ " )
17
+ . await
18
+ . map ( |_| ( ) ) ?;
19
+
20
+ Ok ( ( ) )
21
+ }
22
+
23
+ async fn down ( & self , manager : & SchemaManager ) -> Result < ( ) , DbErr > {
24
+ manager
25
+ . get_connection ( )
26
+ . execute_unprepared (
27
+ "
28
+ DROP INDEX IF EXISTS advisory_vulnerability_vulnerability_id_gist;
29
+ " ,
30
+ )
31
+ . await
32
+ . map ( |_| ( ) ) ?;
33
+
34
+ Ok ( ( ) )
35
+ }
36
+ }
37
+
38
+ #[ allow( clippy:: enum_variant_names) ]
39
+ #[ derive( DeriveIden ) ]
40
+ #[ allow( dead_code) ]
41
+ pub enum Indexes {
42
+ AdvisoryVulnerabilityVulnerabilityIdGistIdx ,
43
+ }
44
+
45
+ #[ derive( DeriveIden ) ]
46
+ #[ allow( dead_code) ]
47
+ pub enum AdvisoryVulnerability {
48
+ Table ,
49
+ VulnerabilityId ,
50
+ }
You can’t perform that action at this time.
0 commit comments