Skip to content

Commit

Permalink
#105 Testing
Browse files Browse the repository at this point in the history
  • Loading branch information
docktermj committed Sep 6, 2024
1 parent 68b5168 commit 732a99d
Show file tree
Hide file tree
Showing 10 changed files with 106 additions and 72 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,4 @@ update-pkg-cache:

.PHONY: golangci-lint
golangci-lint:
@${GOBIN}/golangci-lint run --config=.github/linters/.golangci.yaml
@${GOBIN}/golangci-lint run -v --config=.github/linters/.golangci.yaml
22 changes: 22 additions & 0 deletions connector/connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ import (
"fmt"
"net"
"net/url"
"path/filepath"
"strings"

"github.com/go-sql-driver/mysql"
"github.com/senzing-garage/go-databasing/connectormssql"
"github.com/senzing-garage/go-databasing/connectormysql"
"github.com/senzing-garage/go-databasing/connectororacle"
"github.com/senzing-garage/go-databasing/connectorpostgresql"
"github.com/senzing-garage/go-databasing/connectorsqlite"
)
Expand Down Expand Up @@ -150,6 +152,26 @@ func NewConnector(ctx context.Context, databaseURL string) (driver.Connector, er
}
result, err = connectormssql.NewConnector(ctx, configuration)

case "oracle":
// See https://pkg.go.dev/github.com/godror/godror
// databaseConnector, err = connectororacle.NewConnector(ctx, "user=sa;password=Passw0rd;database=master;server=localhost")
configurationMap := map[string]string{}
if len(username) > 0 {
configurationMap["user"] = username
}
if isPasswordSet {
configurationMap["password"] = password
}
configurationMap["connectString"] = fmt.Sprintf("%s:%s%s", host, port, filepath.Clean(path))
for key, value := range query {
configurationMap[key] = value[0]
}
configuration := ""
for key, value := range configurationMap {
configuration += fmt.Sprintf("%s=%s ", key, value)
}
result, err = connectororacle.NewConnector(ctx, configuration)

default:
err = fmt.Errorf("unknown database scheme: %s", scheme)
}
Expand Down
2 changes: 0 additions & 2 deletions connectororacle/connectororacle_examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ import (
func ExampleNewConnector() {
// For more information, visit https://github.com/senzing-garage/go-databasing/blob/main/connectormssql/connectororacle_examples_test.go
ctx := context.TODO()
// See https://godror.github.io/godror/doc/connection.html
// See https://pkg.go.dev/github.com/godror/godror
// configuration := `user="sysdba" password="Passw0rd" connectString="localhost:1521/FREEPDB1"`
configuration := `user="sys" sysdba=true password="Passw0rd" connectString="localhost:1521/FREE"`
databaseConnector, err := NewConnector(ctx, configuration)
failOnError(err)
Expand Down
1 change: 0 additions & 1 deletion connectororacle/connectororacle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (

func TestNewConnector(test *testing.T) {
ctx := context.TODO()
// configuration := `user="sysdba" password="Passw0rd" connectString="localhost:1521/FREEPDB1"`
configuration := `user="sys" password="Passw0rd" sysdba=true noTimezoneCheck=true connectString="localhost:1521/FREE"`
databaseConnector, err := NewConnector(ctx, configuration)
require.NoError(test, err)
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ services:
ports:
- 1521:1521
restart: always
volumes:
- ./testdata/oracle:/opt/oracle/scripts/startup
# volumes:
# - ./testdata/oracle:/opt/oracle/scripts/startup

pgadmin:
container_name: senzing-pgadmin
Expand Down
9 changes: 9 additions & 0 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ These are "one-time tasks" which may already have been completed.

```

## Environment variables

1. Add to `LD_LIBRARY_PATH` for Oracle database.
Example:

```console
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/oracle/instantclient_23_5
```

## Lint

1. Run linting.
Expand Down
41 changes: 24 additions & 17 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,32 @@ import (
// ----------------------------------------------------------------------------

const (
Sqlite int = iota
Postgresql
Mssql int = iota
Mysql
Mssql
Oracle
Postgresql
Sqlite
)

// ----------------------------------------------------------------------------
// Main
// ----------------------------------------------------------------------------

func main() {
databaseIDs := []int{Sqlite, Postgresql, Mysql, Mssql}
databaseIDs := []int{Oracle, Mssql, Mysql, Postgresql, Sqlite}
printStatementTemplate := "\n==== %11s ==========================\n\n"
for _, databaseID := range databaseIDs {
switch databaseID {
case Sqlite:
fmt.Printf(printStatementTemplate, "Sqlite")
case Postgresql:
fmt.Printf(printStatementTemplate, "Postgresql")
case Mysql:
fmt.Printf(printStatementTemplate, "Mysql")
case Mssql:
fmt.Printf(printStatementTemplate, "Mssql")
case Mysql:
fmt.Printf(printStatementTemplate, "Mysql")
case Oracle:
fmt.Printf(printStatementTemplate, "Oracle")
case Postgresql:
fmt.Printf(printStatementTemplate, "Postgresql")
case Sqlite:
fmt.Printf(printStatementTemplate, "Sqlite")
}
demonstrateDatabase(databaseID)
}
Expand Down Expand Up @@ -73,13 +76,6 @@ func demonstrateDatabase(databaseID int) {
// Construct database URL and choose SQL file.

switch databaseID {
case Sqlite:
databaseURL = sqliteDatabaseURL
sqlFilename = gitRepositoryDir + "/testdata/sqlite/szcore-schema-sqlite-create.sql"
case Postgresql:
// See https://pkg.go.dev/github.com/lib/pq#hdr-Connection_String_Parameters
databaseURL = "postgresql://postgres:postgres@localhost/G2/?sslmode=disable"
sqlFilename = gitRepositoryDir + "/testdata/postgresql/szcore-schema-postgresql-create.sql"
case Mysql:
// See https://pkg.go.dev/github.com/go-sql-driver/mysql#Config
databaseURL = "mysql://root:root@localhost/G2" // #nosec G101
Expand All @@ -88,6 +84,17 @@ func demonstrateDatabase(databaseID int) {
// See https://github.com/microsoft/go-mssqldb#connection-parameters-and-dsn
databaseURL = "mssql://sa:Passw0rd@localhost/master"
sqlFilename = gitRepositoryDir + "/testdata/mssql/szcore-schema-mssql-create.sql"
case Oracle:
// See https://pkg.go.dev/github.com/godror/godror#pkg-overview
databaseURL = "oracle://sys:Passw0rd@localhost:1521/FREE/?sysdba=true&noTimezoneCheck=true"
sqlFilename = gitRepositoryDir + "/testdata/oracle/szcore-schema-oracle-create.sql"
case Postgresql:
// See https://pkg.go.dev/github.com/lib/pq#hdr-Connection_String_Parameters
databaseURL = "postgresql://postgres:postgres@localhost/G2/?sslmode=disable"
sqlFilename = gitRepositoryDir + "/testdata/postgresql/szcore-schema-postgresql-create.sql"
case Sqlite:
databaseURL = sqliteDatabaseURL
sqlFilename = gitRepositoryDir + "/testdata/sqlite/szcore-schema-sqlite-create.sql"
default:
exitOnError(fmt.Errorf("unknown databaseNumber: %d", databaseID))
}
Expand Down
3 changes: 1 addition & 2 deletions makefiles/linux.mk
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ setup-osarch-specific:

.PHONY: test-osarch-specific
test-osarch-specific:
# @go test -json -v -p 1 ./... 2>&1 | tee /tmp/gotest.log | gotestfmt
@go test -json -v -p 1 ./connectororacle 2>&1 | tee /tmp/gotest.log | gotestfmt
@go test -json -v -p 1 ./... 2>&1 | tee /tmp/gotest.log | gotestfmt

# -----------------------------------------------------------------------------
# Makefile targets supported only by this platform.
Expand Down
2 changes: 1 addition & 1 deletion sqlexecutor/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ var IDMessages = map[int]string{
10: "Exit UnregisterObserver(%s) returned (%v).",
2000: "Entry: %+v",
2001: "Processed %d lines with no failures.",
3001: "SQL.Exec failure number %d on line %d. Error: %v",
3001: "SQL.Exec failure number %d on line %d. Result: %v; Error: %v",
3002: "Processed %d lines having %d failures.",
8001: "ProcessFileName",
8002: "ProcessScanner.Exec",
Expand Down
92 changes: 46 additions & 46 deletions testdata/oracle/szcore-schema-oracle-create.sql
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
CREATE TABLE LIB_FEAT (LIB_FEAT_ID NUMBER NOT NULL, FTYPE_ID NUMBER(5) NOT NULL, VERSION NUMBER(5) NOT NULL, FEAT_HASH VARCHAR2(40) NOT NULL, FEAT_DESC VARCHAR2(150), FELEM_VALUES CLOB NOT NULL, ANONYMIZED CHAR(1) NOT NULL) ;
ALTER TABLE LIB_FEAT ADD CONSTRAINT LIB_FEAT_PK PRIMARY KEY(LIB_FEAT_ID) USING INDEX;
CREATE UNIQUE INDEX LIB_FEAT_SK ON LIB_FEAT(FEAT_HASH, FTYPE_ID, ANONYMIZED) ;
CREATE TABLE SYS_HW_CHECK (LIB_FEAT_ID NUMBER NOT NULL, FTYPE_ID NUMBER(5) NOT NULL, VERSION NUMBER(5) NOT NULL, FEAT_HASH VARCHAR2(40) NOT NULL, FEAT_DESC VARCHAR2(150), FELEM_VALUES CLOB NOT NULL, ANONYMIZED CHAR(1) NOT NULL) ;
ALTER TABLE SYS_HW_CHECK ADD CONSTRAINT SYS_HW_CHECK_PK PRIMARY KEY(LIB_FEAT_ID) USING INDEX;
CREATE UNIQUE INDEX SYS_HW_CHECK_SK ON SYS_HW_CHECK(FEAT_HASH, FTYPE_ID, ANONYMIZED) ;
CREATE TABLE DSRC_RECORD (CONFIG_ID NUMBER, FIRST_SEEN_DT DATE, LAST_SEEN_DT DATE, RECORD_ID VARCHAR2(250) NOT NULL, ENT_SRC_KEY VARCHAR2(40) NOT NULL, DSRC_ID NUMBER(5) NOT NULL, JSON_DATA CLOB) ;
ALTER TABLE DSRC_RECORD ADD CONSTRAINT DSRC_RECORD_PK PRIMARY KEY(RECORD_ID, DSRC_ID) USING INDEX;
CREATE INDEX DSRC_RECORD_SK ON DSRC_RECORD(ENT_SRC_KEY, DSRC_ID) ;
CREATE TABLE OBS_ENT (OBS_ENT_ID NUMBER NOT NULL, LOCKING_ID NUMBER NOT NULL, LAST_TOUCH_DT NUMBER, DSRC_ID NUMBER(5) NOT NULL, LOCK_DSRC_ACTION CHAR(1), ENT_SRC_KEY VARCHAR2(40) NOT NULL, FEATURES CLOB) ;
ALTER TABLE OBS_ENT ADD CONSTRAINT OBS_ENT_PK PRIMARY KEY(OBS_ENT_ID) USING INDEX;
CREATE UNIQUE INDEX OBS_ENT_SK ON OBS_ENT(ENT_SRC_KEY, DSRC_ID) ;
CREATE TABLE RES_ENT (RES_ENT_ID NUMBER NOT NULL, LOCKING_ID NUMBER NOT NULL, LAST_TOUCH_DT NUMBER, ENT_STATE NUMBER, LOCK_DSRC_ACTION CHAR(1)) ;
ALTER TABLE RES_ENT ADD CONSTRAINT RES_ENT_PK PRIMARY KEY(RES_ENT_ID) USING INDEX;
CREATE TABLE RES_ENT_OKEY (OBS_ENT_ID NUMBER NOT NULL, RES_ENT_ID NUMBER NOT NULL, MATCH_KEY CLOB, ERRULE_ID NUMBER(5) NOT NULL) ;
ALTER TABLE RES_ENT_OKEY ADD CONSTRAINT RES_ENT_OKEY_PK PRIMARY KEY(OBS_ENT_ID) USING INDEX;
CREATE INDEX RES_ENT_OKEY_SK ON RES_ENT_OKEY(RES_ENT_ID, OBS_ENT_ID) ;
CREATE TABLE RES_FEAT_EKEY (RES_ENT_ID NUMBER NOT NULL, LIB_FEAT_ID NUMBER NOT NULL, OBS_ENT_CNT NUMBER, USED_FROM_DT DATE, USED_THRU_DT DATE, FTYPE_ID NUMBER(5) NOT NULL, SUPPRESSED CHAR(1), UTYPE_CODE VARCHAR2(255)) ;
CREATE UNIQUE INDEX RES_FEAT_EKEY_PK ON RES_FEAT_EKEY(LIB_FEAT_ID, RES_ENT_ID, UTYPE_CODE) ;
CREATE INDEX RES_FEAT_EKEY_SK ON RES_FEAT_EKEY(RES_ENT_ID) ;
CREATE TABLE RES_FEAT_STAT (LIB_FEAT_ID NUMBER NOT NULL, FTYPE_ID NUMBER(5) NOT NULL, NUM_RES_ENT NUMBER(7) NOT NULL, NUM_RES_ENT_OOM NUMBER(7) NOT NULL, CANDIDATE_CAP_REACHED CHAR(1) DEFAULT 'N' NOT NULL, SCORING_CAP_REACHED CHAR(1) DEFAULT 'N' NOT NULL) ;
ALTER TABLE RES_FEAT_STAT ADD CONSTRAINT RES_FEAT_STAT_PK PRIMARY KEY(LIB_FEAT_ID) USING INDEX;
CREATE TABLE RES_RELATE (RES_REL_ID NUMBER NOT NULL, MIN_RES_ENT_ID NUMBER NOT NULL, MAX_RES_ENT_ID NUMBER NOT NULL, LAST_ERRULE_ID NUMBER(5), IS_DISCLOSED NUMBER(1), IS_AMBIGUOUS NUMBER(1), MATCH_KEY CLOB, MATCH_KEY_DETAILS CLOB, MATCH_LEVELS VARCHAR2(50)) ;
ALTER TABLE RES_RELATE ADD CONSTRAINT RES_RELATE_PK PRIMARY KEY(RES_REL_ID) USING INDEX;
CREATE TABLE RES_REL_EKEY (RES_ENT_ID NUMBER NOT NULL, REL_ENT_ID NUMBER NOT NULL, RES_REL_ID NUMBER NOT NULL) ;
ALTER TABLE RES_REL_EKEY ADD CONSTRAINT RES_REL_EKEY_PK PRIMARY KEY(RES_ENT_ID, REL_ENT_ID) USING INDEX;
CREATE TABLE SYS_SEQUENCE (SEQUENCE_NAME VARCHAR2(50) NOT NULL, NEXT_SEQUENCE NUMBER NOT NULL, CACHE_SIZE NUMBER NOT NULL) ;
ALTER TABLE SYS_SEQUENCE ADD CONSTRAINT SYS_SEQUENCE_PK PRIMARY KEY(SEQUENCE_NAME) USING INDEX;
INSERT INTO SYS_SEQUENCE (SEQUENCE_NAME,NEXT_SEQUENCE,CACHE_SIZE) VALUES ('ER_ID',1,100000);
INSERT INTO SYS_SEQUENCE (SEQUENCE_NAME,NEXT_SEQUENCE,CACHE_SIZE) VALUES ('LIB_FEAT_ID',1,100000);
INSERT INTO SYS_SEQUENCE (SEQUENCE_NAME,NEXT_SEQUENCE,CACHE_SIZE) VALUES ('OBS_ENT_ID',1,100000);
INSERT INTO SYS_SEQUENCE (SEQUENCE_NAME,NEXT_SEQUENCE,CACHE_SIZE) VALUES ('OBS_ID',1,100000);
INSERT INTO SYS_SEQUENCE (SEQUENCE_NAME,NEXT_SEQUENCE,CACHE_SIZE) VALUES ('RES_REL_ID',1,100000);
CREATE TABLE SYS_CFG (CONFIG_DATA_ID NUMBER NOT NULL, CONFIG_DATA CLOB NOT NULL, CONFIG_COMMENTS VARCHAR2(200) NOT NULL, SYS_CREATE_DT DATE NOT NULL) ;
ALTER TABLE SYS_CFG ADD CONSTRAINT SYS_CFG_PK PRIMARY KEY(CONFIG_DATA_ID) USING INDEX;
CREATE TABLE SYS_CODES_USED (CODE_TYPE VARCHAR2(25) NOT NULL, CODE VARCHAR2(25) NOT NULL, CODE_ID NUMBER NOT NULL) ;
ALTER TABLE SYS_CODES_USED ADD CONSTRAINT SYS_CODES_USED_PK PRIMARY KEY(CODE_TYPE, CODE) USING INDEX;
CREATE UNIQUE INDEX SYS_CODES_USED_SK ON SYS_CODES_USED(CODE_TYPE, CODE_ID) ;
CREATE TABLE SYS_VARS (VAR_GROUP VARCHAR2(25) NOT NULL, VAR_CODE VARCHAR2(25) NOT NULL, VAR_VALUE VARCHAR2(25) NOT NULL, SYS_LSTUPD_DT DATE) ;
ALTER TABLE SYS_VARS ADD CONSTRAINT SYS_VARS_PK PRIMARY KEY(VAR_GROUP, VAR_CODE) USING INDEX;
INSERT INTO SYS_VARS (VAR_GROUP,VAR_CODE,VAR_VALUE) VALUES ('VERSION','SCHEMA','4.0');
CREATE TABLE SYS_STATUS (SYSTEM_CODE VARCHAR2(50) NOT NULL, LAST_TOUCH_DT DATE) ;
ALTER TABLE SYS_STATUS ADD CONSTRAINT SYS_STATUS_PK PRIMARY KEY(SYSTEM_CODE) USING INDEX;
CREATE TABLE SYS_EVAL_QUEUE (MSG_ID NUMBER NOT NULL, DSRC_CODE VARCHAR2(25) NOT NULL, ENT_SRC_KEY VARCHAR2(40) NOT NULL, MSG CLOB) ;
ALTER TABLE SYS_EVAL_QUEUE ADD CONSTRAINT SYS_EVAL_QUEUE_PK PRIMARY KEY(MSG_ID) USING INDEX;
CREATE UNIQUE INDEX IX_EVAL_QUEUE ON SYS_EVAL_QUEUE(ENT_SRC_KEY, DSRC_CODE) ;
CREATE TABLE LIB_FEAT (LIB_FEAT_ID NUMBER NOT NULL, FTYPE_ID NUMBER(5) NOT NULL, VERSION NUMBER(5) NOT NULL, FEAT_HASH VARCHAR2(40) NOT NULL, FEAT_DESC VARCHAR2(150), FELEM_VALUES CLOB NOT NULL, ANONYMIZED CHAR(1) NOT NULL)
ALTER TABLE LIB_FEAT ADD CONSTRAINT LIB_FEAT_PK PRIMARY KEY(LIB_FEAT_ID) USING INDEX
CREATE UNIQUE INDEX LIB_FEAT_SK ON LIB_FEAT(FEAT_HASH, FTYPE_ID, ANONYMIZED)
CREATE TABLE SYS_HW_CHECK (LIB_FEAT_ID NUMBER NOT NULL, FTYPE_ID NUMBER(5) NOT NULL, VERSION NUMBER(5) NOT NULL, FEAT_HASH VARCHAR2(40) NOT NULL, FEAT_DESC VARCHAR2(150), FELEM_VALUES CLOB NOT NULL, ANONYMIZED CHAR(1) NOT NULL)
ALTER TABLE SYS_HW_CHECK ADD CONSTRAINT SYS_HW_CHECK_PK PRIMARY KEY(LIB_FEAT_ID) USING INDEX
CREATE UNIQUE INDEX SYS_HW_CHECK_SK ON SYS_HW_CHECK(FEAT_HASH, FTYPE_ID, ANONYMIZED)
CREATE TABLE DSRC_RECORD (CONFIG_ID NUMBER, FIRST_SEEN_DT DATE, LAST_SEEN_DT DATE, RECORD_ID VARCHAR2(250) NOT NULL, ENT_SRC_KEY VARCHAR2(40) NOT NULL, DSRC_ID NUMBER(5) NOT NULL, JSON_DATA CLOB)
ALTER TABLE DSRC_RECORD ADD CONSTRAINT DSRC_RECORD_PK PRIMARY KEY(RECORD_ID, DSRC_ID) USING INDEX
CREATE INDEX DSRC_RECORD_SK ON DSRC_RECORD(ENT_SRC_KEY, DSRC_ID)
CREATE TABLE OBS_ENT (OBS_ENT_ID NUMBER NOT NULL, LOCKING_ID NUMBER NOT NULL, LAST_TOUCH_DT NUMBER, DSRC_ID NUMBER(5) NOT NULL, LOCK_DSRC_ACTION CHAR(1), ENT_SRC_KEY VARCHAR2(40) NOT NULL, FEATURES CLOB)
ALTER TABLE OBS_ENT ADD CONSTRAINT OBS_ENT_PK PRIMARY KEY(OBS_ENT_ID) USING INDEX
CREATE UNIQUE INDEX OBS_ENT_SK ON OBS_ENT(ENT_SRC_KEY, DSRC_ID)
CREATE TABLE RES_ENT (RES_ENT_ID NUMBER NOT NULL, LOCKING_ID NUMBER NOT NULL, LAST_TOUCH_DT NUMBER, ENT_STATE NUMBER, LOCK_DSRC_ACTION CHAR(1))
ALTER TABLE RES_ENT ADD CONSTRAINT RES_ENT_PK PRIMARY KEY(RES_ENT_ID) USING INDEX
CREATE TABLE RES_ENT_OKEY (OBS_ENT_ID NUMBER NOT NULL, RES_ENT_ID NUMBER NOT NULL, MATCH_KEY CLOB, ERRULE_ID NUMBER(5) NOT NULL)
ALTER TABLE RES_ENT_OKEY ADD CONSTRAINT RES_ENT_OKEY_PK PRIMARY KEY(OBS_ENT_ID) USING INDEX
CREATE INDEX RES_ENT_OKEY_SK ON RES_ENT_OKEY(RES_ENT_ID, OBS_ENT_ID)
CREATE TABLE RES_FEAT_EKEY (RES_ENT_ID NUMBER NOT NULL, LIB_FEAT_ID NUMBER NOT NULL, OBS_ENT_CNT NUMBER, USED_FROM_DT DATE, USED_THRU_DT DATE, FTYPE_ID NUMBER(5) NOT NULL, SUPPRESSED CHAR(1), UTYPE_CODE VARCHAR2(255))
CREATE UNIQUE INDEX RES_FEAT_EKEY_PK ON RES_FEAT_EKEY(LIB_FEAT_ID, RES_ENT_ID, UTYPE_CODE)
CREATE INDEX RES_FEAT_EKEY_SK ON RES_FEAT_EKEY(RES_ENT_ID)
CREATE TABLE RES_FEAT_STAT (LIB_FEAT_ID NUMBER NOT NULL, FTYPE_ID NUMBER(5) NOT NULL, NUM_RES_ENT NUMBER(7) NOT NULL, NUM_RES_ENT_OOM NUMBER(7) NOT NULL, CANDIDATE_CAP_REACHED CHAR(1) DEFAULT 'N' NOT NULL, SCORING_CAP_REACHED CHAR(1) DEFAULT 'N' NOT NULL)
ALTER TABLE RES_FEAT_STAT ADD CONSTRAINT RES_FEAT_STAT_PK PRIMARY KEY(LIB_FEAT_ID) USING INDEX
CREATE TABLE RES_RELATE (RES_REL_ID NUMBER NOT NULL, MIN_RES_ENT_ID NUMBER NOT NULL, MAX_RES_ENT_ID NUMBER NOT NULL, LAST_ERRULE_ID NUMBER(5), IS_DISCLOSED NUMBER(1), IS_AMBIGUOUS NUMBER(1), MATCH_KEY CLOB, MATCH_KEY_DETAILS CLOB, MATCH_LEVELS VARCHAR2(50))
ALTER TABLE RES_RELATE ADD CONSTRAINT RES_RELATE_PK PRIMARY KEY(RES_REL_ID) USING INDEX
CREATE TABLE RES_REL_EKEY (RES_ENT_ID NUMBER NOT NULL, REL_ENT_ID NUMBER NOT NULL, RES_REL_ID NUMBER NOT NULL)
ALTER TABLE RES_REL_EKEY ADD CONSTRAINT RES_REL_EKEY_PK PRIMARY KEY(RES_ENT_ID, REL_ENT_ID) USING INDEX
CREATE TABLE SYS_SEQUENCE (SEQUENCE_NAME VARCHAR2(50) NOT NULL, NEXT_SEQUENCE NUMBER NOT NULL, CACHE_SIZE NUMBER NOT NULL)
ALTER TABLE SYS_SEQUENCE ADD CONSTRAINT SYS_SEQUENCE_PK PRIMARY KEY(SEQUENCE_NAME) USING INDEX
INSERT INTO SYS_SEQUENCE (SEQUENCE_NAME,NEXT_SEQUENCE,CACHE_SIZE) VALUES ('ER_ID',1,100000)
INSERT INTO SYS_SEQUENCE (SEQUENCE_NAME,NEXT_SEQUENCE,CACHE_SIZE) VALUES ('LIB_FEAT_ID',1,100000)
INSERT INTO SYS_SEQUENCE (SEQUENCE_NAME,NEXT_SEQUENCE,CACHE_SIZE) VALUES ('OBS_ENT_ID',1,100000)
INSERT INTO SYS_SEQUENCE (SEQUENCE_NAME,NEXT_SEQUENCE,CACHE_SIZE) VALUES ('OBS_ID',1,100000)
INSERT INTO SYS_SEQUENCE (SEQUENCE_NAME,NEXT_SEQUENCE,CACHE_SIZE) VALUES ('RES_REL_ID',1,100000)
CREATE TABLE SYS_CFG (CONFIG_DATA_ID NUMBER NOT NULL, CONFIG_DATA CLOB NOT NULL, CONFIG_COMMENTS VARCHAR2(200) NOT NULL, SYS_CREATE_DT DATE NOT NULL)
ALTER TABLE SYS_CFG ADD CONSTRAINT SYS_CFG_PK PRIMARY KEY(CONFIG_DATA_ID) USING INDEX
CREATE TABLE SYS_CODES_USED (CODE_TYPE VARCHAR2(25) NOT NULL, CODE VARCHAR2(25) NOT NULL, CODE_ID NUMBER NOT NULL)
ALTER TABLE SYS_CODES_USED ADD CONSTRAINT SYS_CODES_USED_PK PRIMARY KEY(CODE_TYPE, CODE) USING INDEX
CREATE UNIQUE INDEX SYS_CODES_USED_SK ON SYS_CODES_USED(CODE_TYPE, CODE_ID)
CREATE TABLE SYS_VARS (VAR_GROUP VARCHAR2(25) NOT NULL, VAR_CODE VARCHAR2(25) NOT NULL, VAR_VALUE VARCHAR2(25) NOT NULL, SYS_LSTUPD_DT DATE)
ALTER TABLE SYS_VARS ADD CONSTRAINT SYS_VARS_PK PRIMARY KEY(VAR_GROUP, VAR_CODE) USING INDEX
INSERT INTO SYS_VARS (VAR_GROUP,VAR_CODE,VAR_VALUE) VALUES ('VERSION','SCHEMA','4.0')
CREATE TABLE SYS_STATUS (SYSTEM_CODE VARCHAR2(50) NOT NULL, LAST_TOUCH_DT DATE)
ALTER TABLE SYS_STATUS ADD CONSTRAINT SYS_STATUS_PK PRIMARY KEY(SYSTEM_CODE) USING INDEX
CREATE TABLE SYS_EVAL_QUEUE (MSG_ID NUMBER NOT NULL, DSRC_CODE VARCHAR2(25) NOT NULL, ENT_SRC_KEY VARCHAR2(40) NOT NULL, MSG CLOB)
ALTER TABLE SYS_EVAL_QUEUE ADD CONSTRAINT SYS_EVAL_QUEUE_PK PRIMARY KEY(MSG_ID) USING INDEX
CREATE UNIQUE INDEX IX_EVAL_QUEUE ON SYS_EVAL_QUEUE(ENT_SRC_KEY, DSRC_CODE)

0 comments on commit 732a99d

Please sign in to comment.