diff --git a/.github/workflows/oracleDatabaseTests.yml b/.github/workflows/oracleDatabaseTests.yml index 29e38deb..6c484c55 100644 --- a/.github/workflows/oracleDatabaseTests.yml +++ b/.github/workflows/oracleDatabaseTests.yml @@ -14,7 +14,7 @@ jobs: steps: - name: Run Oracle DB docker container - run: docker run --name oracle -p 8080:1521 -p 8081:5500 -e ORACLE_PASSWORD=admin -e APP_USER=onlyoffice -e APP_USER_PASSWORD=onlyoffice -d gvenzl/oracle-xe:21-slim + run: docker run --name oracle -p 8080:1521 -p 8081:5500 -e ORACLE_PASSWORD=admin -e ORACLE_DATABASE=onlyoffice -e APP_USER=onlyoffice -e APP_USER_PASSWORD=onlyoffice -d gvenzl/oracle-xe:21-slim - name: Check out repository code uses: actions/checkout@v3 @@ -37,7 +37,7 @@ jobs: - name: Creating service DB configuration run: | - echo '{"services": {"CoAuthoring": {"sql": {"type": "oracle", "dbHost": "127.0.0.1", "dbPort": "8080", "dbUser": "onlyoffice", "dbPass": "onlyoffice", "dbName": "xepdb1"}}}}' >> Common/config/local.json + echo '{"services": {"CoAuthoring": {"sql": {"type": "oracle", "dbHost": "127.0.0.1", "dbPort": "8080", "dbUser": "onlyoffice", "dbPass": "onlyoffice", "dbName": "onlyoffice"}}}}' >> Common/config/local.json - name: Await database service to finish startup run: sleep 15 @@ -45,7 +45,7 @@ jobs: - name: Creating schema run: | docker cp ./schema/oracle/createdb.sql oracle:/ - docker exec oracle sqlplus -s onlyoffice/onlyoffice@//localhost/xepdb1 @/createdb.sql + docker exec oracle sqlplus -s onlyoffice/onlyoffice@//localhost/onlyoffice @/createdb.sql - name: Run Jest run: npm run "integration database tests" diff --git a/schema/oracle/createdb.sql b/schema/oracle/createdb.sql index b6e799d9..2d93d2cc 100644 --- a/schema/oracle/createdb.sql +++ b/schema/oracle/createdb.sql @@ -1,12 +1,10 @@ --- You must be logged in as SYS(sysdba) user. --- Here, "onlyoffice" is a PBD(service) name. -alter session set container = xepdb1; --- Oracle uses users as namespaces for tables creation. In "onlyoffice.table_name" onlyoffice is a user name, so table_name exist only at this namespace. +-- Oracle uses users as namespaces for tables creation. +-- In "onlyoffice.table_name", "onlyoffice" is a user name, and table_name exists only within this namespace. + -- ---------------------------- -- Table structure for doc_changes -- ---------------------------- - CREATE TABLE doc_changes ( tenant NVARCHAR2(255) NOT NULL, id NVARCHAR2(255) NOT NULL, @@ -17,13 +15,12 @@ CREATE TABLE doc_changes ( change_data NCLOB NOT NULL, change_date TIMESTAMP NOT NULL, CONSTRAINT doc_changes_unique UNIQUE (tenant, id, change_id), - CONSTRAINT doc_changes_unsigned_int CHECK (change_id between 0 and 4294967295) + CONSTRAINT doc_changes_unsigned_int CHECK (change_id BETWEEN 0 AND 4294967295) ); -- ---------------------------- -- Table structure for task_result -- ---------------------------- - CREATE TABLE task_result ( tenant NVARCHAR2(255) NOT NULL, id NVARCHAR2(255) NOT NULL, @@ -33,8 +30,8 @@ CREATE TABLE task_result ( last_open_date TIMESTAMP NOT NULL, user_index NUMBER DEFAULT 1 NOT NULL, change_id NUMBER DEFAULT 0 NOT NULL, - callback NCLOB, -- codebase uses '' as default values here, but Oracle treat '' as NULL, so NULL permitted for this value. - baseurl NCLOB, -- codebase uses '' as default values here, but Oracle treat '' as NULL, so NULL permitted for this value. + callback NCLOB, -- Note: codebase uses '' as default value, but Oracle treats '' as NULL + baseurl NCLOB, -- Note: codebase uses '' as default value, but Oracle treats '' as NULL password NCLOB NULL, additional NCLOB NULL, CONSTRAINT task_result_unique UNIQUE (tenant, id), diff --git a/schema/oracle/removetbl.sql b/schema/oracle/removetbl.sql index ba79fbde..6903b873 100644 --- a/schema/oracle/removetbl.sql +++ b/schema/oracle/removetbl.sql @@ -1,6 +1,5 @@ --- You must be logged in as SYS(sysdba) user. --- Here, "onlyoffice" is a PBD(service) name. -alter session set container = xepdb1; - +-- +-- Drop tables +-- DROP TABLE onlyoffice.doc_changes CASCADE CONSTRAINTS PURGE; DROP TABLE onlyoffice.task_result CASCADE CONSTRAINTS PURGE; \ No newline at end of file