Lab 06: RBAC SQL Script

Back to Lab 06 Dashboard


This page summarizes the SQL changes for Part (a). The executable script is included in the project as rbac_schema.sql.

What the Script Does

  1. Creates ROLE_t if missing.
  2. Adds Role_Id and Customer_Id to Users if missing.
  3. Seeds standard roles: admin, staff, customer.
  4. Backfills Users.Role_Id from legacy User_Role.
  5. Links customer users to CUSTOMER_t where names match.
  6. Adds foreign keys from Users to ROLE_t and CUSTOMER_t.

Execution Notes


Back to Lab 06 Dashboard