scalingo_addonscalingo_alertscalingo_appscalingo_app_eventscalingo_autoscalerscalingo_collaboratorscalingo_containerscalingo_container_typescalingo_cronscalingo_databasescalingo_database_backupscalingo_database_maintenancescalingo_database_type_versionscalingo_database_userscalingo_deploymentscalingo_domainscalingo_environmentscalingo_event_typescalingo_invoicescalingo_keyscalingo_log_drainscalingo_log_drain_addonscalingo_notification_platformscalingo_notifierscalingo_regionscalingo_scm_integrationscalingo_scm_repo_linkscalingo_stackscalingo_tokenscalingo_user_eventscalingo_user_scm_repo_link
Table: scalingo_database_type_version
Get the version of a database.
The scalingo_database_type_version
table can be used to query information about a version of a database, and you must specify which application in the where or join clause using the app_name
column and the addon_id
as well as the version id
.
Examples
Get Database version
select *from scalingo_database_type_versionwhere app_name = 'caresteouvert-api' and addon_id = 'ad-0c33a92f-000-000-000-0000000' and id = '60a4ab3d406c12000eed29e7';
Get all Database versions of an application
with database as ( select db.app_name, ad.id as addon_id, db.version_id from scalingo_addon ad inner join scalingo_database db on ad.id = db.addon_id and ad.app_name = db.app_name where ad.app_name = 'caresteouvert-api' order by db.id)select *from database db join scalingo_database_type_version tv on ( tv.id = db.version_id and tv.addon_id = db.addon_id and tv.app_name = db.app_name );
Check if an upgrade exist for your database
select case when next_upgrade_id is null then false else true end as toupdatefrom scalingo_database_type_versionwhere app_name = 'caresteouvert-api' and addon_id = 'ad-0c33a92f-000-000-000-0000000' and id = '60a4ab3d406c12000eed29e7';
Schema for scalingo_database_type_version
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
addon_id | text | = | ID of the addon. |
app_name | text | = | Name of the app. |
build | bigint | Build version number. | |
created_at | timestamp with time zone | When the database type version was created. | |
database_type_id | text | Unique ID identifying the database type (e.g. PostgreSQL, MySQL, etc). | |
features | jsonb | List of available features for this version. | |
id | text | = | Unique ID identifying the database type version. |
major | bigint | Major version number. | |
minor | bigint | Minor version number. | |
next_upgrade_build | bigint | Next upgrade build version number. | |
next_upgrade_created_at | timestamp with time zone | Next upgrade creation date. | |
next_upgrade_database_type_id | text | Next upgrade unique ID identifying the database type (e.g. PostgreSQL, MySQL, etc). | |
next_upgrade_id | text | Next upgrade ID identifying the database type version. | |
next_upgrade_major | bigint | Next upgrade major version number. | |
next_upgrade_minor | bigint | Next upgrade minor version number. | |
next_upgrade_patch | bigint | Next upgrade patch version number. | |
next_upgrade_updated_at | timestamp with time zone | Next upgrade update date. | |
patch | bigint | Patch version number. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
updated_at | timestamp with time zone | When the database type version was updated. |