1e41f4b71Sopenharmony_ci# Distributed Data Management Subsystem JS API Changelog
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ci## cl.distributeddatamgr.1 API Change
4e41f4b71Sopenharmony_ciChanged the **relationalStore** APIs of the distributed data management (distributeddatamgr) subsystem.
5e41f4b71Sopenharmony_ci
6e41f4b71Sopenharmony_ciBefore change:
7e41f4b71Sopenharmony_ciAfter **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.
8e41f4b71Sopenharmony_ciAfter change:
9e41f4b71Sopenharmony_ciAfter **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.
10e41f4b71Sopenharmony_ci
11e41f4b71Sopenharmony_ciYou need to adapt your application.
12e41f4b71Sopenharmony_ci
13e41f4b71Sopenharmony_ci **Change Impact**
14e41f4b71Sopenharmony_ci
15e41f4b71Sopenharmony_ciThe 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.
16e41f4b71Sopenharmony_ci
17e41f4b71Sopenharmony_ci**Key API/Component Changes**
18e41f4b71Sopenharmony_ci
19e41f4b71Sopenharmony_ci| Module                            | Class            | Method/Attribute/Enum/Constant| Change Type|
20e41f4b71Sopenharmony_ci| ------------------------------    | --------------- | ---------------- | ------- |
21e41f4b71Sopenharmony_ci| @ohos.data.relationalStore        | RdbStore        | **openStatus: number;** is changed to **version: number;**.|  Changed  |
22e41f4b71Sopenharmony_ci
23e41f4b71Sopenharmony_ci
24e41f4b71Sopenharmony_ci**Adaptation Guide**
25e41f4b71Sopenharmony_ci
26e41f4b71Sopenharmony_ciRefer to the following code to set or obtain the RDB store version for an application:
27e41f4b71Sopenharmony_ci
28e41f4b71Sopenharmony_ci```ts
29e41f4b71Sopenharmony_ciconst STORE_CONFIG = {
30e41f4b71Sopenharmony_ci    name: "rdbstore.db",
31e41f4b71Sopenharmony_ci    securityLevel: data_rdb.SecurityLevel.S1
32e41f4b71Sopenharmony_ci}
33e41f4b71Sopenharmony_cidata_rdb.getRdbStore(this.context, STORE_CONFIG, function (err, rdbStore) {
34e41f4b71Sopenharmony_ci    // Before:
35e41f4b71Sopenharmony_ci    // if (rdbStore.openStatus == ON_CREATE) {
36e41f4b71Sopenharmony_ci    //     rdbStore.executeSql("CREATE TABLE IF NOT EXISTS student (id INTEGER PRIMARY KEY AUTOINCREMENT, score REAL);", null) // create table xxx
37e41f4b71Sopenharmony_ci    // }
38e41f4b71Sopenharmony_ci    
39e41f4b71Sopenharmony_ci    // Now:
40e41f4b71Sopenharmony_ci    if (rdbStore.version == 0) {
41e41f4b71Sopenharmony_ci        rdbStore.executeSql("CREATE TABLE IF NOT EXISTS student (id INTEGER PRIMARY KEY AUTOINCREMENT, score REAL);", null) // create table xxx
42e41f4b71Sopenharmony_ci        // Set the RDB store version, which is a positive integer greater than 0.
43e41f4b71Sopenharmony_ci        rdbStore.version == 3
44e41f4b71Sopenharmony_ci    }
45e41f4b71Sopenharmony_ci    // Obtain the RDB store version.
46e41f4b71Sopenharmony_ci    console.info("Get RdbStore version is " + rdbStore.version)
47e41f4b71Sopenharmony_ci})
48e41f4b71Sopenharmony_ci```
49