Ejemplo n.º 1
0
 private TypeSpec migrationType() {
   MigrationVersionMetadata migrationVersion = schemaName().migrationVersion();
   ClassName className = migrationVersion.className();
   return TypeSpec.classBuilder(className.simpleName())
       .addAnnotation(migrationAnnotation())
       .addTypes(
           tableInfoList()
               .stream()
               .map(TableInfoMetadata::type)
               .collect(MoreCollectors.toImmutableList()))
       .build();
 }
Ejemplo n.º 2
0
 private AnnotationSpec schemaAnnotation(MigrationVersionMetadata migrationVersion) {
   return AnnotationSpec.builder(Schema.class)
       .addMember("migrations", "{ $T.class }", migrationVersion.className())
       .build();
 }