compileCommand method

  1. @override
String compileCommand(
  1. String table,
  2. SchemaCommand command
)
override

SQLite cannot add a primary key to an existing table.

Implementation

@override
String compileCommand(String table, SchemaCommand command) {
  if (command is PrimaryCommand) {
    throw DatabaseException(
      'SQLite cannot add a primary key to an existing table; declare it '
      'when creating the table.',
    );
  }
  return super.compileCommand(table, command);
}