Added a different VIEW definition for sqlite3 and refactored some has_many
code for the sip_account.
Merge branch 'migration_fix' into develop