You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve environment management by transforming environment storage from concatenated strings to a proper array structure, enabling better environment handling and future custom environment support.
Current Behavior
Environments stored as concatenated strings ('production|preview' or 'production')
Limited flexibility for environment management
No support for custom environments
Complex string manipulation for multiple environments
Proposed Behavior
Store environments as proper arrays
Link environments to team settings
Support base environments (production, development, preview)
Foundation for custom environments
Cleaner environment management
Implementation Details
Database Schema Changes
// Current Schemaexportconstvariables=pgTable('variables',{id: serial('id').primaryKey(),environment: text('environment').notNull(),// Currently: 'production|preview'// ... other fields})// New Schemaexportconstenvironments=pgTable('environments',{id: serial('id').primaryKey(),teamId: integer('team_id').references(()=>teams.id),name: text('name').notNull(),type: text('type').notNull(),// 'base' or 'custom'createdAt: timestamp('created_at').defaultNow(),})exportconstvariableEnvironments=pgTable('variable_environments',{id: serial('id').primaryKey(),variableId: integer('variable_id').references(()=>variables.id),environmentId: integer('environment_id').references(()=>environments.id),})
Base Implementation
// Environment TypesexportenumBaseEnvironment{PRODUCTION='production',DEVELOPMENT='development',PREVIEW='preview'}// Team Creation with Base EnvironmentsexportclassTeamService{asynccreateTeam(createTeamInput: CreateTeamInput): Promise<Team>{constteam=awaitcreateTeam(createTeamInput)// Initialize base environmentsawaitPromise.all(Object.values(BaseEnvironment).map(env=>createEnvironment({teamId: team.id,name: env,type: 'base'})))returnteam}}
exportclassVariableService{asynccreateVariable(input: CreateVariableInput): Promise<Variable>{constvariable=awaitcreateVariable(input)// Link environmentsawaitPromise.all(input.environments.map(envId=>createVariableEnvironment({variableId: variable.id,environmentId: envId})))returnvariable}}
Future Possibilities
Custom Environments
Team-specific environments
Environment templates
Environment hierarchies
Enhanced Features
Environment-specific permissions
Environment cloning
Environment variables inheritance
Environment health monitoring
Team Management
Environment access control
Environment sharing between teams
Environment audit logs
This is merely a proposal for implementation; the code may not be suitable for the project. This is intended solely to provide a clearer understanding of how the implementation might appear.
The text was updated successfully, but these errors were encountered:
Overview
Improve environment management by transforming environment storage from concatenated strings to a proper array structure, enabling better environment handling and future custom environment support.
Current Behavior
Proposed Behavior
Implementation Details
Database Schema Changes
Base Implementation
Future Possibilities
This is merely a proposal for implementation; the code may not be suitable for the project. This is intended solely to provide a clearer understanding of how the implementation might appear.
The text was updated successfully, but these errors were encountered: