Shouldn't this definition be outside the function,  so all tables share the same mega table instead of creating a new meta table for each read only table? 
That would also allow for something like 'is_readonly()' to be added.