use of com.robotoworks.mechanoid.db.generator.SqliteMigrationGenerator in project mechanoid by robotoworks.
the class SqliteModelGenerator method generateMigration.
public void generateMigration(final Resource resource, final IFileSystemAccess fsa, final MigrationBlock migration, final int version) {
EList<EObject> _contents = resource.getContents();
EObject _head = IterableExtensions.<EObject>head(_contents);
Model model = ((Model) _head);
String _packageName = model.getPackageName();
String _concat = _packageName.concat(".migrations");
DatabaseBlock _database = model.getDatabase();
String _name = _database.getName();
String _pascalize = Strings.pascalize(_name);
String _concat_1 = "Default".concat(_pascalize);
String _concat_2 = _concat_1.concat("MigrationV");
String _valueOf = String.valueOf(version);
String _concat_3 = _concat_2.concat(_valueOf);
String genFileName = Strings.resolveFileName(_concat, _concat_3);
SqliteMigrationGenerator generator = this.mMigrationGenerator.get();
CharSequence _generate = generator.generate(model, migration, version);
fsa.generateFile(genFileName, _generate);
}
Aggregations