func (s *StateStore) DeleteDeployment(index uint64, deploymentIDs []string) error {
	txn := s.db.Txn(true)
	defer txn.Abort()

	if len(deploymentIDs) == 0 {
		return nil
	}

	for _, deploymentID := range deploymentIDs {
		// Lookup the deployment
		existing, err := txn.First("deployment", "id", deploymentID)
		if err != nil {
			return fmt.Errorf("deployment lookup failed: %v", err)
		}
		if existing == nil {
			return fmt.Errorf("deployment not found")
		}

		// Delete the deployment
		if err := txn.Delete("deployment", existing); err != nil {
			return fmt.Errorf("deployment delete failed: %v", err)
		}
	}

	if err := txn.Insert("index", &IndexEntry{"deployment", index}); err != nil {
		return fmt.Errorf("index update failed: %v", err)
	}

	txn.Commit()
	return nil
}
// DeleteDeployment is used to delete a set of deployments by ID
DeleteDeployment is used to delete a set of deployments by ID
// DeleteDeployment is used to delete a set of deployments by ID
func (s *StateStore) DeleteDeployment(index uint64, deploymentIDs []string) error {
	txn := s.db.Txn(true)
	defer txn.Abort()
	if len(deploymentIDs) == 0 {
		return nil
	}
	for _, deploymentID := range deploymentIDs {
		existing, err := txn.First("deployment", "id", deploymentID)
		if err != nil {
			return fmt.Errorf("deployment lookup failed: %v", err)
		}
		if existing == nil {
			return fmt.Errorf("deployment not found")
		}
		if err := txn.Delete("deployment", existing); err != nil {
			return fmt.Errorf("deployment delete failed: %v", err)
		}
	}
	if err := txn.Insert("index", &IndexEntry{"deployment", index}); err != nil {
		return fmt.Errorf("index update failed: %v", err)
	}
	txn.Commit()
	return nil
}
func ( s * StateStore ) DeleteDeployment ( index uint64 , deploymentIDs [ ] string ) error { txn := s . db . Txn ( true ) defer txn . Abort ( ) if len ( deploymentIDs ) == 0 { return nil } for _ , deploymentID := range deploymentIDs { existing , err := txn . First ( " " , " " , deploymentID ) if err != nil { return fmt . Errorf ( " " , err ) } if existing == nil { return fmt . Errorf ( " " ) } if err := txn . Delete ( " " , existing ) ; err != nil { return fmt . Errorf ( " " , err ) } } if err := txn . Insert ( " " , & IndexEntry { " " , index } ) ; err != nil { return fmt . Errorf ( " " , err ) } txn . Commit ( ) return nil }
DeleteDeployment is used to delete a set of deployments by ID
DeleteDeployment is used to delete a set of deployments by ID
// Lookup the deployment // Delete the deployment