In rails 4 with postgres, in public schema, tenants table exists. While creating a tenant entry its schema is generated by an affter_create callback, and migration is perfor