creating scopes in subject model, add relationships between databases and creating the migration for the join table of admin_users and pages