Replies:

Hi, I just did the same thing.
I am using Visual Studio Code with InterSystems plugins.
Using the plugin, connect to your server in the appropriate namespace.

Once done, locate your Production.cls in VSCode explorer, right click and select Export, this will export from IRIS to your local filesystem.


You should be able to find the location of the exported class in your filesystem in the output panel:

export "Namespace.Production.cls" as "/Users/yourself/Developer/Project/Namespace/Production.cls" - SuccessExported items: 1

Do the search and replace that you in the local Production.cls. When saving your modifications, the class is automatically compiled in the server:

The output also shows:

Compilation started on 09/20/2022 13:33:15 with qualifiers 'cuk'
Compiling class EAI.Production
Compiling routine EAI.Production.1
Compilation finished successfully in 0.113s.

While working on your changes, pay attention to the notification that can occur

Hi,

I think you mean IRIS, not ISIS.

can you give more precisions about the installation ?  Platform ? Distribution ? Firewall somewhere ? 

Thanks everyone, I've read all your answers.


I​​ am using a %DocDB.Database. I have many colons created using %CreateProperty and some of them have the UNIQUE indicator set to true, therefore an index is created.
BUT, the %CreateProperty method is quite limited and I couldn't find how to make indexes on multiple columns/properties without doing some kind of trick (adding a property whose propertyExpression is the combination of other properties).

Anyway, I ended up building some indexes manually like that:

SET className = tfullDatabaseName
SET indexDefinition = ##class(%Dictionary.IndexDefinition).%New()
DO indexDefinition.parentSetObjectId(className)
SET indexDefinition.Name = "col1AndColB"
SET indexDefinition.Properties = "col1,colB"
SET indexDefinition.Unique = 1
SET status = indexDefinition.%Save()


Whenever I want to update my database schema, our strategy is to remove all properties and indexes.
Of course, the original %DropProperty drops indexes associated to the property to drop using an internal server only method dropIndex:
 

/// dropIndex() - delete an index definition and its structure. This method returns an oref referencing the index definition
/// document that was removed from the index definition database.
/// <br>
/// <pre>
/// SAMPLES>set people = $system.DocDB.GetDatabase("People")
/// SAMPLES>set index = people.%DropIndex("HC")
/// SAMPLES>write index.%ToJSON()
/// {"database":"People","name":"HC","type":"bitmap","class":"%DocDB.Server.Index.Bitmap","key":[["HomeCity","string"]]}
/// </pre>

Method dropIndex(indexName As %RawString = "") As %Library.DynamicAbstractObject [ Internal, ServerOnly = 1 ]

{
    TRY {
        SET response = $THIS
        $$$THROWONERROR(status,$CLASSMETHOD(..ClassName,"%PurgeIndices",$LISTBUILD(indexName)))
        $$$THROWONERROR(status,##class(%Dictionary.IndexDefinition).%Delete($$$oidForm(..ClassName_"||"_indexName)))
// check status?

    } CATCH exception {
        SET response = ""
        THROW exception
}
RETURN response
}


By the way, the documentation of this method suggest that you can use %DropIndex ... maybe this is an error.

Note that this instance method is called only within the %DropProperty method, within a TSTART TCOMMIT block and the class is also locked.

About my initial question, my original intent was to drop ALL indexes on the database, even those NOT created with %CreateProperty.
I tried to mimic the code of %DroptProperty (TSTART TCOMMIT, lock class, ...) with no success. When I try to recreate properties and columns for all my %DocDb.Databases it fails randomly.


 

Followers:
Michel has no followers yet.
Following:
Michel has not followed anybody yet.
Global Masters badges:
Michel has no Global Masters badges yet.