File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -285,16 +285,15 @@ func checkDestinationColumns(schemas schema.Schemas) error {
285285 if ! sc .HasField (schema .CqSyncTimeColumn .Name ) {
286286 return fmt .Errorf ("table %s is missing column %s. please consider upgrading source plugin" , schema .TableName (sc ), schema .CqSourceNameField .Name )
287287 }
288- if ! sc .HasField (schema .CqIDColumn .Name ) {
289- return fmt .Errorf ("table %s is missing column %s. please consider upgrading source plugin" , schema .TableName (sc ), schema .CqIDColumn .Name )
290- }
291- fields , _ := sc .FieldsByName (schema .CqIDColumn .Name )
292- cqID := fields [0 ]
293- if cqID .Nullable {
294- return fmt .Errorf ("column %s.%s cannot be nullable. please consider upgrading source plugin" , schema .TableName (sc ), schema .CqIDColumn .Name )
295- }
296- if ! schema .IsUnique (cqID ) {
297- return fmt .Errorf ("column %s.%s must be unique. please consider upgrading source plugin" , schema .TableName (sc ), schema .CqIDColumn .Name )
288+ fields , ok := sc .FieldsByName (schema .CqIDColumn .Name )
289+ if ok {
290+ cqID := fields [0 ]
291+ if cqID .Nullable {
292+ return fmt .Errorf ("column %s.%s cannot be nullable. please consider upgrading source plugin" , schema .TableName (sc ), schema .CqIDColumn .Name )
293+ }
294+ if ! schema .IsUnique (cqID ) {
295+ return fmt .Errorf ("column %s.%s must be unique. please consider upgrading source plugin" , schema .TableName (sc ), schema .CqIDColumn .Name )
296+ }
298297 }
299298 }
300299 return nil
You can’t perform that action at this time.
0 commit comments