furlong

SQLJocky migration tool. Will eventually work with SQLJocky2.

Todo

  • All field specifications
  • Command-line executable
  • Grinder examples
  • More examples

Examples

class SongMigration extends Migration {
  @override
  String get name => "Songs table";

  @override
  Future create(Migrator migrator) async {
    await migrator.create("songs", (TableSchema table) {
      table.primaryKey = table.integer("id", autoIncrement: true);
      
      table.varChar("artist_id");
      table.varChar("title");
      table.varChar("desc")..nullable = true;
      table.timeStamp("created_at");
      table.timeStamp("updated_at");
    });
  }

  @override
  Future destroy(Migrator migrator) async {
    await migrator.drop(["songs"]);
  }
}

Libraries

furlong