What do the psc tables do?

From LinuxMCE
Jump to: navigation, search

When you create a repository sqlCVS will create 6 tables to store information for that repository. Those tables are names psc_[repositoryname]_function, where the function for those tables is:


Contains a list of all the tables in the repository and table-specific settings: "frozen" is true when the table is frozen--no changes can be made without a supervisor's approval. "anonymous" is true if users should be allows to submit changes anonymously or without a password. In all cases anonymous checkins will become an "unauthorized batch" and not merged in without a supervisor's approval. However, this allows a database to be used by the general public, with anybody being able to submit checkins to the table. "last_psc_id" and "last_psc_batch" are just the last psc_id and psc_batch used. "filter" allows you to specify a SQL WHERE clause that will be used to determine which rows a local user is able to checkout or view. For example, maybe there are tables relating to payroll, which all managers in the company need to be able to modify. But you only want a manager to be able to view/modify the payroll records relating to the employees under his supervision. You can add a SQL WHERE clause in the filter and the token <%=U%> will be substituted with the psc_user id of the current user. Only records meeting the criteria will be seen by the local user.


This keeps track of any changes to the database schema. See sqlCVS - Managing schema changes.


repset = repository_settings - Holds settings for the repository in a Setting=Value format. This allows future expansion without changing the database structure.


bathdr = batch_header - Everytime a user completes a new checkin a batch is created, with a corresponding record here to track the date/time, the user and his IP. If the batch is unauthorized, meaning the changes are not authorized because the user is anonymous or the record/table is frozen, then the batch id (the primary key) will be negative.


batdet = batch_detail - For every batch that is checked in, a record will be added here for each table that is checked in with the total number of rows that were new, modified and deleted.


batuser = batch_user - When you do a checkin, you can checkin the changes from many users at once either by having a supervisor login, or by having each of the users login with his password. With each batch added, all users that logged in during the checkin are shown here with a flag indicating if the user is a supervisor, or if the commit was made with the user id but without a a password, which is treated the same as an anonymous checkin.