createMigrationsTable method

  1. @override
Future<void> createMigrationsTable()
override

Creates the migrations table, with its id, batch and path, if it does not exist.

Implementation

@override
Future<void> createMigrationsTable() async {
  if (!connection.isOpen) {
    throw Exception("PostgreSQL connection is not open");
  }
  await connection.execute('''
  CREATE TABLE IF NOT EXISTS "migrations" (
    id serial,
    batch integer,
    path varchar(500),
    PRIMARY KEY(id)
  );
  ''');
}