Skip to main content

Introduction to the Versions Table

The Versions table is designed to track different versions of the application. This table plays a crucial role in maintaining a historical record of application releases and their associated metadata.

Table Structure

The Versions table is structured to store comprehensive information about each application version. Here’s a detailed breakdown of its columns:
Column NameData TypeConstraintsDescription
iduuidprimary keyUnique identifier for each version record
app_versiontextnot nullThe version number or identifier of the application
release_datetextnot nullThe date when the version was released
environmenttextnot nullThe environment for which the version is intended
git_committextnot nullThe Git commit hash associated with this version
notestextnullableAdditional notes or description about the version
created_attimestamptznot null, defaultTimestamp when the version record was created

Usage and Functionality

The Versions table is designed to be a comprehensive log of application releases. Here are some key points about its usage:
  1. Version Tracking: The table allows the system to keep track of all released versions of the application, including their release dates and associated Git commits.
  2. Environment Specificity: By including an ‘environment’ column, the table can differentiate between versions released for different environments (e.g., development, staging, production).
  3. Auditing and Rollbacks: The detailed information stored in this table can be crucial for auditing purposes or when needing to roll back to a previous version.

Notes

  • The table uses timestamptz for the ‘created_at’ column, ensuring that timezone information is preserved.
  • Row-level security is implemented on this table, allowing authenticated users to select records:
    CREATE POLICY "Enable read access for authenticated users" ON "public"."versions"
    AS PERMISSIVE FOR SELECT
    TO authenticated
    USING (true)
    
  • The ‘notes’ column allows for additional context or changelog information to be stored with each version.
By leveraging the Versions table, the Serial application can maintain a detailed history of its releases, facilitating version control, auditing, and potentially enabling features like version comparison or rollback functionality.