Database optimizations and SQL for Postgres

Table optimizations:
- Table "oauth_session_access_tokens":
  - Renamed to "oauth_access_tokens"
- Table "oauth_session_authcodes":
  - Renamed to "oauth_authcodes"
  - Made key unique
- Table "oauth_session_redirects":
  - Renamed to "oauth_redirects"
- Table "oauth_session_refresh_tokens":
  - Renamed to "oauth_refresh_tokens"
  - Renamed column "session_access_token_id" to "access_token_id"
  - Removed unnecessary column "client_id" (can be used from "oauth_session")
- Table oauth_scopes:
  - Allow NULL for name 
- Table "oauth_session_token_scopes":
  - Renamed to "oauth_access_token_scopes"
  - Renamed column "session_access_token_id" to "access_token_id"
- Table "oauth_session_authcode_scopes":
  - Renamed to "oauth_authcode_scopes"
  - Renamed column "oauth_session_authcode_id" to "authcode_id"
- Key optimizations and renaming
- Data type optimizations (replaced special MySQL type ENUM)

Query optimizations:
- Unnecessary LEFT JOINs turned into JOINs in Client Storage