1# Distributed Data Management Subsystem JS API Changelog 2 3## cl.distributeddatamgr.1 API Change 4Changed the **relationalStore** APIs of the distributed data management (distributeddatamgr) subsystem. 5 6Before change: 7After **getRdbStore()** is called, the application determines whether the RDB store is newly created based on the **openStatus** attribute (openStatus == ON_CREATE) of the returned **rdbStore** object. 8After change: 9After **getRdbStore()** is called, the application determines whether the RDB store is newly created based on the **version** attribute (version == 0) of the returned **rdbStore** object. 10 11You need to adapt your application. 12 13 **Change Impact** 14 15The JS APIs of API version 10 are affected and need to be changed accordingly. Otherwise, certain functions cannot be properly implemented in the SDK of the new version. 16 17**Key API/Component Changes** 18 19| Module | Class | Method/Attribute/Enum/Constant| Change Type| 20| ------------------------------ | --------------- | ---------------- | ------- | 21| @ohos.data.relationalStore | RdbStore | **openStatus: number;** is changed to **version: number;**.| Changed | 22 23 24**Adaptation Guide** 25 26Refer to the following code to set or obtain the RDB store version for an application: 27 28```ts 29const STORE_CONFIG = { 30 name: "rdbstore.db", 31 securityLevel: data_rdb.SecurityLevel.S1 32} 33data_rdb.getRdbStore(this.context, STORE_CONFIG, function (err, rdbStore) { 34 // Before: 35 // if (rdbStore.openStatus == ON_CREATE) { 36 // rdbStore.executeSql("CREATE TABLE IF NOT EXISTS student (id INTEGER PRIMARY KEY AUTOINCREMENT, score REAL);", null) // create table xxx 37 // } 38 39 // Now: 40 if (rdbStore.version == 0) { 41 rdbStore.executeSql("CREATE TABLE IF NOT EXISTS student (id INTEGER PRIMARY KEY AUTOINCREMENT, score REAL);", null) // create table xxx 42 // Set the RDB store version, which is a positive integer greater than 0. 43 rdbStore.version == 3 44 } 45 // Obtain the RDB store version. 46 console.info("Get RdbStore version is " + rdbStore.version) 47}) 48``` 49