@@ -15,7 +15,6 @@ export default {
15
15
if ( v3Config && typeof v3Config === 'object' ) {
16
16
const v4Config = migrateConfig ( v3Config as any as Record < string , RuleStruct > ) ;
17
17
18
- console . log ( 'after' , JSON . stringify ( v4Config , null , 2 ) ) ;
19
18
await connection . query (
20
19
sql `UPDATE schema_policy_config SET config = ${ sql . json ( v4Config ) } WHERE resource_type = ${ resource_type } AND resource_id = ${ resource_id } ` ,
21
20
) ;
@@ -71,12 +70,6 @@ function migrateRuleConfig(ruleName: string, options: any) {
71
70
options : alphabetize ( options ) ,
72
71
} ;
73
72
}
74
- case 'require-description' : {
75
- return {
76
- ruleName : 'require-description' ,
77
- options : requireDescription ( options ) ,
78
- } ;
79
- }
80
73
case 'no-case-insensitive-enum-values-duplicates' : {
81
74
return {
82
75
ruleName : 'unique-enum-value-names' ,
@@ -92,6 +85,10 @@ function migrateRuleConfig(ruleName: string, options: any) {
92
85
}
93
86
}
94
87
88
+ /**
89
+ * "alphabetize" changed "values" to a boolean instead of an array. If the array has value (can be only 1), we replace it with "true".
90
+ * Otherwise, "false".
91
+ */
95
92
function alphabetize ( cfgSource : any ) {
96
93
const cfg = JSON . parse ( JSON . stringify ( cfgSource ) ) ;
97
94
@@ -105,21 +102,3 @@ function alphabetize(cfgSource: any) {
105
102
106
103
return cfg ;
107
104
}
108
-
109
- function requireDescription ( cfgSource : any ) {
110
- const cfg = JSON . parse ( JSON . stringify ( cfgSource ) ) ;
111
-
112
- if ( 'rootField' in cfg ) {
113
- if ( typeof cfg . rootField === 'boolean' && cfg . rootField === false ) {
114
- cfg . rootField = undefined ;
115
- }
116
- }
117
-
118
- if ( 'types' in cfg ) {
119
- if ( typeof cfg . types === 'boolean' && cfg . types === false ) {
120
- cfg . types = undefined ;
121
- }
122
- }
123
-
124
- return cfg ;
125
- }
0 commit comments