Skip to content

Default_resources_per_workspace_container, max_resources_per_workspace fields

What does this MR do and why?

Add default_resources_per_workspace_container, max_resources_per_workspace to remote_development_agent_configs table

  • These are non-required fields and default would be {} so non JSON schema

Related to #427143 (closed)

Migration Output

$ bin/rails db:migrate:up:main VERSION=20231114133600 RAILS_ENV=development
main: == [advisory_lock_connection] object_id: 184180, pg_backend_pid: 492604
main: == 20231114133600 AddDefaultResourcesPerWorkspaceContainerToRemoteDevelopmentAgentConfigs: migrating 
main: -- add_column(:remote_development_agent_configs, :default_resources_per_workspace_container, :jsonb, {:default=>{}, :null=>false})
main:    -> 0.0019s
main: == 20231114133600 AddDefaultResourcesPerWorkspaceContainerToRemoteDevelopmentAgentConfigs: migrated (0.0047s) 
main: == [advisory_lock_connection] object_id: 184180, pg_backend_pid: 492604

$ bin/rails db:migrate:down:main VERSION=20231114133600 RAILS_ENV=development
main: == [advisory_lock_connection] object_id: 184160, pg_backend_pid: 492934
main: == 20231114133600 AddDefaultResourcesPerWorkspaceContainerToRemoteDevelopmentAgentConfigs: reverting 
main: -- remove_column(:remote_development_agent_configs, :default_resources_per_workspace_container, :jsonb, {:default=>{}, :null=>false})
main:    -> 0.0012s
main: == 20231114133600 AddDefaultResourcesPerWorkspaceContainerToRemoteDevelopmentAgentConfigs: reverted (0.0046s) 
main: == [advisory_lock_connection] object_id: 184160, pg_backend_pid: 492934

$ bin/rails db:migrate:up:main VERSION=20231114133619  RAILS_ENV=development
main: == [advisory_lock_connection] object_id: 184180, pg_backend_pid: 493427
main: == 20231114133619 AddMaxResourcesPerWorkspaceToRemoteDevelopmentAgentConfigs: migrating 
main: -- add_column(:remote_development_agent_configs, :max_resources_per_workspace, :jsonb, {:default=>{}, :null=>false})
main:    -> 0.0025s
main: == 20231114133619 AddMaxResourcesPerWorkspaceToRemoteDevelopmentAgentConfigs: migrated (0.0063s) 
main: == [advisory_lock_connection] object_id: 184180, pg_backend_pid: 493427

$ bin/rails db:migrate:down:main VERSION=20231114133619 RAILS_ENV=development
main: == [advisory_lock_connection] object_id: 184180, pg_backend_pid: 493930
main: == 20231114133619 AddMaxResourcesPerWorkspaceToRemoteDevelopmentAgentConfigs: reverting 
main: -- remove_column(:remote_development_agent_configs, :max_resources_per_workspace, :jsonb, {:default=>{}, :null=>false})
main:    -> 0.0013s
main: == 20231114133619 AddMaxResourcesPerWorkspaceToRemoteDevelopmentAgentConfigs: reverted (0.0058s) 

main: == [advisory_lock_connection] object_id: 184180, pg_backend_pid: 493930

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Alper Akgun

Merge request reports

Loading