class PaymentMethodsTable extends AbstractSqlTable<PaymentMethod> {

    @Override
    public synchronized void onUpgrade(@NonNull SQLiteDatabase db, int oldVersion, int newVersion, @NonNull TableDefaultsCustomizer customizer) {
        super.onUpgrade(db, oldVersion, newVersion, customizer);
        if (oldVersion <= 11) {
            final String sql = "CREATE TABLE " + getTableName() + " ("
                    + COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, "
                    + COLUMN_METHOD + " TEXT"
                    + ");";

            Logger.debug(this, sql);
            db.execSQL(sql);
            customizer.insertPaymentMethodDefaults(this);
        }

        if (oldVersion <= 14) { // v14 => v15. adding sync info
            onUpgradeToAddSyncInformation(db, oldVersion, newVersion);
        }

        if (oldVersion <= 15) { // v15 => v16. adding custom_order_id column
            final String addCustomOrderColumn = String.format("ALTER TABLE %s ADD COLUMN %s INTEGER DEFAULT 0",
                    getTableName(), AbstractColumnTable.COLUMN_CUSTOM_ORDER_ID);
            Logger.debug(this, addCustomOrderColumn);
            db.execSQL(addCustomOrderColumn);
        }

        if (oldVersion <= 16) { // v16 => 17. add the custom_order_id column to iOS (which was forgotten)
            if (!hasCustomOrderIdColumn(db)) {
                final String addCustomOrderColumn = String.format("ALTER TABLE %s ADD COLUMN %s INTEGER DEFAULT 0", getTableName(), AbstractColumnTable.COLUMN_CUSTOM_ORDER_ID);
                final String updateDefaultCustomOrder = String.format("UPDATE %s SET %s = ROWID", getTableName(), AbstractColumnTable.COLUMN_CUSTOM_ORDER_ID);
                Logger.debug(this, addCustomOrderColumn);
                Logger.debug(this, updateDefaultCustomOrder);
                db.execSQL(addCustomOrderColumn);
                db.execSQL(updateDefaultCustomOrder);
            }
        }

        if (oldVersion <= 18) { // v18 => 19 added UUID column
            onUpgradeToAddUUID(db, oldVersion);
        }

        if (oldVersion <= 21) { // v20 => 21 added reimbursable column
            final String alterPaymentMethods = "ALTER TABLE " + getTableName() + " ADD COLUMN " + COLUMN_REIMBURSABLE + " BOOLEAN DEFAULT 0";
            Logger.debug(this, alterPaymentMethods);
            db.execSQL(alterPaymentMethods);
        }
    }

    public  PaymentMethodsTable(@NonNull SQLiteOpenHelper sqLiteOpenHelper,
                               @NonNull OrderingPreferencesManager orderingPreferencesManager);

}