Unicode columns for SqlServer (#248)

* ENT-1291 Switch liquibase changelogs to use nvarchar instead of varchar

* Configure Hibernate to use nationalised strings

* Configure Hibernate to use nationalised strings

* Change schema so that UUIDs are varchars

* Update schema certificate signing request status is not unicode

* Upper case suffix for audit tables

* nvarchar -> varchar for status in the audit table

* Capitalisation

* Capitalisation

* Force hibernate to use unicode columns on SQL server

* Force hibernate to use unicode columns on SQL server

* Schema change to make PostgreSql happy

* SQL files to initialise the perfcluster db for SQL server and PostgreSql

* Code ordering and extra comment
This commit is contained in:
Christian Sailer 2017-12-21 17:34:21 +00:00 committed by GitHub
parent 2a0eefd351
commit a2344f15fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 189 additions and 121 deletions

View File

@ -5,13 +5,13 @@
<column name="output_index" type="INT">
<constraints nullable="false"/>
</column>
<column name="transaction_id" type="VARCHAR(64)">
<column name="transaction_id" type="NVARCHAR(64)">
<constraints nullable="false"/>
</column>
<column name="ccy_code" type="VARCHAR(3)"/>
<column name="issuer_key_hash" type="VARCHAR(130)"/>
<column name="ccy_code" type="NVARCHAR(3)"/>
<column name="issuer_key_hash" type="NVARCHAR(130)"/>
<column name="issuer_ref" type="varbinary(512)"/>
<column name="owner_name" type="VARCHAR(255)"/>
<column name="owner_name" type="NVARCHAR(255)"/>
<column name="pennies" type="BIGINT"/>
</createTable>
</changeSet>

View File

@ -5,17 +5,17 @@
<column name="output_index" type="INT">
<constraints nullable="false"/>
</column>
<column name="transaction_id" type="VARCHAR(64)">
<column name="transaction_id" type="NVARCHAR(64)">
<constraints nullable="false"/>
</column>
<column name="ccy_code" type="VARCHAR(3)"/>
<column name="ccy_code" type="NVARCHAR(3)"/>
<column name="face_value" type="BIGINT"/>
<column name="face_value_issuer_key_hash" type="VARCHAR(130)"/>
<column name="face_value_issuer_key_hash" type="NVARCHAR(130)"/>
<column name="face_value_issuer_ref" type="varbinary(512)"/>
<column name="issuance_key_hash" type="VARCHAR(130)"/>
<column name="issuance_key_hash" type="NVARCHAR(130)"/>
<column name="issuance_ref" type="varbinary(255)"/>
<column name="maturity_instant" type="timestamp"/>
<column name="owner_key_hash" type="VARCHAR(130)"/>
<column name="owner_key_hash" type="NVARCHAR(130)"/>
</createTable>
</changeSet>
<changeSet author="tudormalene (generated)" id="1511451595465-29">

View File

@ -8,13 +8,13 @@
<column name="output_index" type="INT">
<constraints nullable="false"/>
</column>
<column name="transaction_id" type="VARCHAR(64)">
<column name="transaction_id" type="NVARCHAR(64)">
<constraints nullable="false"/>
</column>
<column name="ccy_code" type="VARCHAR(3)"/>
<column name="issuer_key_hash" type="VARCHAR(130)"/>
<column name="ccy_code" type="NVARCHAR(3)"/>
<column name="issuer_key_hash" type="NVARCHAR(130)"/>
<column name="issuer_ref" type="varbinary(512)"/>
<column name="owner_key_hash" type="VARCHAR(130)"/>
<column name="owner_key_hash" type="NVARCHAR(130)"/>
<column name="pennies" type="BIGINT"/>
</createTable>
</changeSet>

View File

@ -9,14 +9,14 @@
<column name="output_index" type="INT(10)">
<constraints nullable="false"/>
</column>
<column name="transaction_id" type="VARCHAR(64)">
<column name="transaction_id" type="NVARCHAR(64)">
<constraints nullable="false"/>
</column>
<column name="issuer_name" type="VARCHAR(255)"/>
<column name="issuer_name" type="NVARCHAR(255)"/>
<column name="issuer_ref" type="VARBINARY(512)"/>
<column name="owner_name" type="VARCHAR(255)"/>
<column name="owner_name" type="NVARCHAR(255)"/>
<column name="quantity" type="BIGINT(19)"/>
<column name="ccy_code" type="VARCHAR(3)"/>
<column name="ccy_code" type="NVARCHAR(3)"/>
</createTable>
<addPrimaryKey columnNames="output_index, transaction_id" constraintName="CONSTRAINT_D"

View File

@ -9,13 +9,13 @@
<column name="output_index" type="INT(10)">
<constraints nullable="false"/>
</column>
<column name="transaction_id" type="VARCHAR(64)">
<column name="transaction_id" type="NVARCHAR(64)">
<constraints nullable="false"/>
</column>
<column name="ccy_code" type="VARCHAR(3)"/>
<column name="issuer_name" type="VARCHAR(255)"/>
<column name="ccy_code" type="NVARCHAR(3)"/>
<column name="issuer_name" type="NVARCHAR(255)"/>
<column name="issuer_ref" type="VARBINARY(512)"/>
<column name="owner_name" type="VARCHAR(255)"/>
<column name="owner_name" type="NVARCHAR(255)"/>
<column name="pennies" type="BIGINT(19)"/>
</createTable>

View File

@ -8,17 +8,17 @@
<column name="output_index" type="INT">
<constraints nullable="false"/>
</column>
<column name="transaction_id" type="VARCHAR(64)">
<column name="transaction_id" type="NVARCHAR(64)">
<constraints nullable="false"/>
</column>
<column name="ccy_code" type="VARCHAR(3)"/>
<column name="ccy_code" type="NVARCHAR(3)"/>
<column name="face_value" type="BIGINT"/>
<column name="face_value_issuer_key_hash" type="VARCHAR(130)"/>
<column name="face_value_issuer_key_hash" type="NVARCHAR(130)"/>
<column name="face_value_issuer_ref" type="varbinary(512)"/>
<column name="issuance_key_hash" type="VARCHAR(130)"/>
<column name="issuance_key_hash" type="NVARCHAR(130)"/>
<column name="issuance_ref" type="varbinary(255)"/>
<column name="maturity_instant" type="timestamp"/>
<column name="owner_key_hash" type="VARCHAR(130)"/>
<column name="owner_key_hash" type="NVARCHAR(130)"/>
</createTable>
</changeSet>
<changeSet author="tudormalene (generated)" id="1511451595465-29">

View File

@ -8,15 +8,15 @@
<column name="output_index" type="INT(10)">
<constraints nullable="false"/>
</column>
<column name="transaction_id" type="VARCHAR(64)">
<column name="transaction_id" type="NVARCHAR(64)">
<constraints nullable="false"/>
</column>
<column name="issuer_name" type="VARCHAR(255)"/>
<column name="issuer_name" type="NVARCHAR(255)"/>
<column name="issuer_ref" type="VARBINARY(512)"/>
<column name="owner_name" type="VARCHAR(255)"/>
<column name="owner_name" type="NVARCHAR(255)"/>
<column name="quantity" type="BIGINT(19)"/>
<column name="ccy_code" type="VARCHAR(3)"/>
<column name="face_value_issuer_key_hash" type="VARCHAR(130)"/>
<column name="ccy_code" type="NVARCHAR(3)"/>
<column name="face_value_issuer_key_hash" type="NVARCHAR(130)"/>
<column name="face_value_issuer_ref" type="VARBINARY(512)"/>
<column name="maturity_instant" type="TIMESTAMP"/>
</createTable>

View File

@ -42,7 +42,7 @@ fun configureDatabase(dataSourceProperties: Properties,
SchemaMigration(schemas, dataSource, databaseConfig.schema).runMigration()
}
return CordaPersistence(dataSource, databaseConfig, schemas, emptyList())
return CordaPersistence(dataSource, databaseConfig, schemas, config.dataSourceProperties.getProperty("url", ""), emptyList())
}
sealed class NetworkManagementSchemaServices {

View File

@ -11,10 +11,10 @@
</changeSet>
<changeSet author="tudormalene (generated)" id="1513267683777-2">
<createTable tableName="CertificateSigningRequestEntity_modifiedBy">
<column name="CertificateSigningRequestEntity_request_id" type="VARCHAR(64)">
<column name="CertificateSigningRequestEntity_request_id" type="NVARCHAR(64)">
<constraints nullable="false"/>
</column>
<column name="modified_by" type="VARCHAR(512)"/>
<column name="modified_by" type="NVARCHAR(512)"/>
</createTable>
</changeSet>
<changeSet author="tudormalene (generated)" id="1513267683777-3">
@ -22,10 +22,10 @@
<column name="REV" type="INT(10)">
<constraints nullable="false"/>
</column>
<column name="CertificateSigningRequestEntity_request_id" type="VARCHAR(64)">
<column name="CertificateSigningRequestEntity_request_id" type="NVARCHAR(64)">
<constraints nullable="false"/>
</column>
<column name="modified_by" type="VARCHAR(512)">
<column name="modified_by" type="NVARCHAR(512)">
<constraints nullable="false"/>
</column>
<column name="revtype" type="TINYINT(3)"/>
@ -38,24 +38,24 @@
</column>
<column name="certificate_path_bytes" type="BLOB"/>
<column name="certificate_status" type="INT(10)"/>
<column name="public_key_hash" type="VARCHAR(64)"/>
<column name="certificate_signing_request" type="VARCHAR(64)">
<column name="public_key_hash" type="NVARCHAR(64)"/>
<column name="certificate_signing_request" type="NVARCHAR(64)">
<constraints nullable="false"/>
</column>
</createTable>
</changeSet>
<changeSet author="tudormalene (generated)" id="1513267683777-5">
<createTable tableName="certificate_signing_request">
<column name="request_id" type="VARCHAR(64)">
<column name="request_id" type="NVARCHAR(64)">
<constraints nullable="false"/>
</column>
<column name="legal_name" type="VARCHAR(256)">
<column name="legal_name" type="NVARCHAR(256)">
<constraints nullable="false"/>
</column>
<column name="modified_at" type="TIMESTAMP">
<constraints nullable="false"/>
</column>
<column name="remark" type="VARCHAR(256)"/>
<column name="remark" type="NVARCHAR(256)"/>
<column name="request_bytes" type="BLOB">
<constraints nullable="false"/>
</column>
@ -66,7 +66,7 @@
</changeSet>
<changeSet author="tudormalene (generated)" id="1513267683777-6">
<createTable tableName="certificate_signing_request_AUD">
<column name="request_id" type="VARCHAR(64)">
<column name="request_id" type="NVARCHAR(64)">
<constraints nullable="false"/>
</column>
<column name="rev" type="INT(10)">
@ -74,7 +74,7 @@
</column>
<column name="revtype" type="TINYINT(3)"/>
<column name="modified_at" type="TIMESTAMP"/>
<column name="remark" type="VARCHAR(256)"/>
<column name="remark" type="NVARCHAR(256)"/>
<column name="status" type="VARCHAR(255)"/>
</createTable>
</changeSet>
@ -94,16 +94,16 @@
<constraints nullable="false"/>
</column>
<column name="bytes" type="BLOB"/>
<column name="hash" type="VARCHAR(64)"/>
<column name="hash" type="NVARCHAR(64)"/>
</createTable>
</changeSet>
<changeSet author="tudormalene (generated)" id="1513267683777-9">
<createTable tableName="node_info">
<column name="node_info_hash" type="VARCHAR(64)">
<column name="node_info_hash" type="NVARCHAR(64)">
<constraints nullable="false"/>
</column>
<column name="signed_node_info_bytes" type="BLOB"/>
<column name="certificate_signing_request" type="VARCHAR(64)">
<column name="certificate_signing_request" type="NVARCHAR(64)">
<constraints nullable="false"/>
</column>
</createTable>

View File

@ -42,13 +42,14 @@ class CordaPersistence(
val dataSource: DataSource,
databaseConfig: DatabaseConfig,
schemas: Set<MappedSchema>,
val jdbcUrl: String,
attributeConverters: Collection<AttributeConverter<*, *>> = emptySet()
) : Closeable {
val defaultIsolationLevel = databaseConfig.transactionIsolationLevel
val hibernateConfig: HibernateConfiguration by lazy {
transaction {
HibernateConfiguration(schemas, databaseConfig, attributeConverters)
HibernateConfiguration(schemas, databaseConfig, attributeConverters, jdbcUrl)
}
}
val entityManagerFactory get() = hibernateConfig.sessionFactoryForRegisteredSchemas

View File

@ -23,7 +23,8 @@ import javax.persistence.AttributeConverter
class HibernateConfiguration(
schemas: Set<MappedSchema>,
private val databaseConfig: DatabaseConfig,
private val attributeConverters: Collection<AttributeConverter<*, *>>
private val attributeConverters: Collection<AttributeConverter<*, *>>,
private val jdbcUrl: String
) {
companion object {
private val logger = contextLogger()
@ -94,6 +95,10 @@ class HibernateConfiguration(
// to avoid OOM when large blobs might get logged.
applyBasicType(CordaMaterializedBlobType, CordaMaterializedBlobType.name)
applyBasicType(CordaWrapperBinaryType, CordaWrapperBinaryType.name)
// When connecting to SqlServer (and only then) do we need to tell hibernate to use
// nationalised (i.e. Unicode) strings by default
val forceUnicodeForSqlServer = jdbcUrl.contains(":sqlserver:", ignoreCase = true);
enableGlobalNationalizedCharacterDataSupport(forceUnicodeForSqlServer)
build()
}

View File

@ -9,11 +9,11 @@
<column name="output_index" type="INT">
<constraints nullable="false"/>
</column>
<column name="transaction_id" type="VARCHAR(64)">
<column name="transaction_id" type="NVARCHAR(64)">
<constraints nullable="false"/>
</column>
<column name="message_by" type="VARCHAR(255)"/>
<column name="message_value" type="VARCHAR(255)"/>
<column name="message_by" type="NVARCHAR(255)"/>
<column name="message_value" type="NVARCHAR(255)"/>
</createTable>
</changeSet>

View File

@ -879,5 +879,5 @@ fun configureDatabase(dataSourceProperties: Properties,
SchemaMigration(schemaService.schemaOptions.keys, dataSource, databaseConfig.schema).runMigration()
}
return CordaPersistence(dataSource, databaseConfig, schemaService.schemaOptions.keys, attributeConverters)
return CordaPersistence(dataSource, databaseConfig, schemaService.schemaOptions.keys, config.dataSourceProperties.getProperty("url", ""), attributeConverters)
}

View File

@ -16,13 +16,13 @@
<changeSet author="tudormalene (generated)" id="create state_participants table">
<createTable tableName="state_participants">
<column name="output_index" type="INT(10)">
<column name="output_index" type="INT">
<constraints nullable="false"/>
</column>
<column name="transaction_id" type="VARCHAR(64)">
<column name="transaction_id" type="NVARCHAR(64)">
<constraints nullable="false"/>
</column>
<column name="participants" type="VARCHAR(255)"/>
<column name="participants" type="NVARCHAR(255)"/>
</createTable>
</changeSet>

View File

@ -8,14 +8,14 @@
<column name="node_info_id" type="INT">
<constraints nullable="false"/>
</column>
<column name="party_name" type="VARCHAR(255)">
<column name="party_name" type="NVARCHAR(255)">
<constraints nullable="false"/>
</column>
</createTable>
</changeSet>
<changeSet author="tudormalene (generated)" id="1511451595465-10">
<createTable tableName="node_info_hosts">
<column name="host" type="VARCHAR(255)">
<column name="host" type="NVARCHAR(255)">
<constraints nullable="false"/>
</column>
<column name="port" type="INT">
@ -26,13 +26,13 @@
</changeSet>
<changeSet author="tudormalene (generated)" id="1511451595465-11">
<createTable tableName="node_info_party_cert">
<column name="party_name" type="VARCHAR(255)">
<column name="party_name" type="NVARCHAR(255)">
<constraints nullable="false"/>
</column>
<column name="ismain" type="BOOLEAN">
<constraints nullable="false"/>
</column>
<column name="owning_key_hash" type="VARCHAR(130)"/>
<column name="owning_key_hash" type="NVARCHAR(130)"/>
<column name="party_cert_binary" type="blob"/>
</createTable>
</changeSet>
@ -41,7 +41,7 @@
<column name="node_info_id" type="INT">
<constraints nullable="false"/>
</column>
<column name="node_info_hash" type="VARCHAR(64)"/>
<column name="node_info_hash" type="NVARCHAR(64)"/>
<column name="platform_version" type="INT"/>
<column name="serial" type="BIGINT"/>
</createTable>

View File

@ -6,15 +6,15 @@
<changeSet author="tudormalene (generated)" id="1511451595465-5">
<createTable tableName="node_attachments">
<column name="att_id" type="VARCHAR(255)">
<column name="att_id" type="NVARCHAR(255)">
<constraints nullable="false"/>
</column>
<column name="content" type="blob"/>
<column name="filename" type="VARCHAR(255)"/>
<column name="filename" type="NVARCHAR(255)"/>
<column name="insertion_date" type="timestamp">
<constraints nullable="false"/>
</column>
<column name="uploader" type="VARCHAR(255)"/>
<column name="uploader" type="NVARCHAR(255)"/>
</createTable>
</changeSet>
<changeSet author="tudormalene (generated)" id="1511451595465-6">
@ -22,18 +22,18 @@
<column name="output_index" type="INT">
<constraints nullable="false"/>
</column>
<column name="transaction_id" type="VARCHAR(64)">
<column name="transaction_id" type="NVARCHAR(64)">
<constraints nullable="false"/>
</column>
<column name="consuming_input_index" type="INT"/>
<column name="consuming_transaction_id" type="VARCHAR(255)"/>
<column name="requesting_party_name" type="VARCHAR(255)"/>
<column name="consuming_transaction_id" type="NVARCHAR(255)"/>
<column name="requesting_party_name" type="NVARCHAR(255)"/>
<column name="requesting_party_key" type="varbinary(255)"/>
</createTable>
</changeSet>
<changeSet author="tudormalene (generated)" id="1511451595465-7">
<createTable tableName="node_checkpoints">
<column name="checkpoint_id" type="VARCHAR(64)">
<column name="checkpoint_id" type="NVARCHAR(64)">
<constraints nullable="false"/>
</column>
<column name="checkpoint_value" type="blob"/>
@ -41,15 +41,15 @@
</changeSet>
<changeSet author="tudormalene (generated)" id="1511451595465-8">
<createTable tableName="node_contract_upgrades">
<column name="state_ref" type="VARCHAR(96)">
<column name="state_ref" type="NVARCHAR(96)">
<constraints nullable="false"/>
</column>
<column name="contract_class_name" type="VARCHAR(255)"/>
<column name="contract_class_name" type="NVARCHAR(255)"/>
</createTable>
</changeSet>
<changeSet author="tudormalene (generated)" id="1511451595465-9">
<createTable tableName="node_identities">
<column name="pk_hash" type="VARCHAR(130)">
<column name="pk_hash" type="NVARCHAR(130)">
<constraints nullable="false"/>
</column>
<column name="identity_value" type="blob"/>
@ -58,7 +58,7 @@
<changeSet author="tudormalene (generated)" id="1511451595465-13">
<createTable tableName="node_message_ids">
<column name="message_id" type="VARCHAR(64)">
<column name="message_id" type="NVARCHAR(64)">
<constraints nullable="false"/>
</column>
<column name="insertion_time" type="timestamp"/>
@ -75,10 +75,10 @@
</changeSet>
<changeSet author="tudormalene (generated)" id="1511451595465-15">
<createTable tableName="node_named_identities">
<column name="name" type="VARCHAR(128)">
<column name="name" type="NVARCHAR(128)">
<constraints nullable="false"/>
</column>
<column name="pk_hash" type="VARCHAR(130)"/>
<column name="pk_hash" type="NVARCHAR(130)"/>
</createTable>
</changeSet>
<changeSet author="tudormalene (generated)" id="1511451595465-16">
@ -86,18 +86,18 @@
<column name="output_index" type="INT">
<constraints nullable="false"/>
</column>
<column name="transaction_id" type="VARCHAR(64)">
<column name="transaction_id" type="NVARCHAR(64)">
<constraints nullable="false"/>
</column>
<column name="consuming_input_index" type="INT"/>
<column name="consuming_transaction_id" type="VARCHAR(255)"/>
<column name="requesting_party_name" type="VARCHAR(255)"/>
<column name="consuming_transaction_id" type="NVARCHAR(255)"/>
<column name="requesting_party_name" type="NVARCHAR(255)"/>
<column name="requesting_party_key" type="varbinary(255)"/>
</createTable>
</changeSet>
<changeSet author="tudormalene (generated)" id="1511451595465-17">
<createTable tableName="node_our_key_pairs">
<column name="public_key_hash" type="VARCHAR(130)">
<column name="public_key_hash" type="NVARCHAR(130)">
<constraints nullable="false"/>
</column>
<column name="private_key" type="blob"/>
@ -106,7 +106,7 @@
</changeSet>
<changeSet author="tudormalene (generated)" id="1511451595465-18">
<createTable tableName="node_raft_committed_states">
<column name="id" type="VARCHAR(255)">
<column name="id" type="NVARCHAR(255)">
<constraints nullable="false"/>
</column>
<column name="state_index" type="BIGINT"/>
@ -118,7 +118,7 @@
<column name="output_index" type="INT">
<constraints nullable="false"/>
</column>
<column name="transaction_id" type="VARCHAR(64)">
<column name="transaction_id" type="NVARCHAR(64)">
<constraints nullable="false"/>
</column>
<column name="scheduled_at" type="timestamp">
@ -128,15 +128,15 @@
</changeSet>
<changeSet author="tudormalene (generated)" id="1511451595465-20">
<createTable tableName="node_transaction_mappings">
<column name="tx_id" type="VARCHAR(64)">
<column name="tx_id" type="NVARCHAR(64)">
<constraints nullable="false"/>
</column>
<column name="state_machine_run_id" type="VARCHAR(36)"/>
<column name="state_machine_run_id" type="NVARCHAR(36)"/>
</createTable>
</changeSet>
<changeSet author="tudormalene (generated)" id="1511451595465-21">
<createTable tableName="node_transactions">
<column name="tx_id" type="VARCHAR(64)">
<column name="tx_id" type="NVARCHAR(64)">
<constraints nullable="false"/>
</column>
<column name="transaction_value" type="blob"/>
@ -144,11 +144,11 @@
</changeSet>
<changeSet author="tudormalene" id="create mutual exclusion">
<createTable tableName="node_mutual_exclusion">
<column name="mutual_exclusion_id" type="CHAR(255)">
<column name="mutual_exclusion_id" type="NCHAR(255)">
<constraints nullable="false"/>
</column>
<column name="MACHINE_NAME" type="VARCHAR(255)"/>
<column name="PID" type="VARCHAR(255)"/>
<column name="MACHINE_NAME" type="NVARCHAR(255)"/>
<column name="PID" type="NVARCHAR(255)"/>
<column name="MUTUAL_EXCLUSION_TIMESTAMP" type="timestamp"/>
</createTable>
<addPrimaryKey columnNames="mutual_exclusion_id" constraintName="node_mutual_exclusion_pkey" tableName="node_mutual_exclusion"/>

View File

@ -9,12 +9,12 @@
<column name="output_index" type="INT">
<constraints nullable="false"/>
</column>
<column name="transaction_id" type="VARCHAR(64)">
<column name="transaction_id" type="NVARCHAR(64)">
<constraints nullable="false"/>
</column>
<column name="issuer_name" type="VARCHAR(255)"/>
<column name="issuer_name" type="NVARCHAR(255)"/>
<column name="issuer_ref" type="varbinary(512)"/>
<column name="owner_name" type="VARCHAR(255)"/>
<column name="owner_name" type="NVARCHAR(255)"/>
<column name="quantity" type="BIGINT"/>
</createTable>
</changeSet>
@ -23,10 +23,10 @@
<column name="output_index" type="INT">
<constraints nullable="false"/>
</column>
<column name="transaction_id" type="VARCHAR(64)">
<column name="transaction_id" type="NVARCHAR(64)">
<constraints nullable="false"/>
</column>
<column name="participants" type="VARCHAR(255)"/>
<column name="participants" type="NVARCHAR(255)"/>
</createTable>
</changeSet>
<changeSet author="tudormalene (generated)" id="1511451595465-24">
@ -34,10 +34,10 @@
<column name="output_index" type="INT">
<constraints nullable="false"/>
</column>
<column name="transaction_id" type="VARCHAR(64)">
<column name="transaction_id" type="NVARCHAR(64)">
<constraints nullable="false"/>
</column>
<column name="external_id" type="VARCHAR(255)"/>
<column name="external_id" type="NVARCHAR(255)"/>
<column name="uuid" type="VARCHAR(255)">
<constraints nullable="false"/>
</column>
@ -48,10 +48,10 @@
<column name="output_index" type="INT">
<constraints nullable="false"/>
</column>
<column name="transaction_id" type="VARCHAR(64)">
<column name="transaction_id" type="NVARCHAR(64)">
<constraints nullable="false"/>
</column>
<column name="participants" type="VARCHAR(255)"/>
<column name="participants" type="NVARCHAR(255)"/>
</createTable>
</changeSet>
<changeSet author="tudormalene (generated)" id="1511451595465-26">
@ -59,14 +59,14 @@
<column name="output_index" type="INT">
<constraints nullable="false"/>
</column>
<column name="transaction_id" type="VARCHAR(64)">
<column name="transaction_id" type="NVARCHAR(64)">
<constraints nullable="false"/>
</column>
<column name="consumed_timestamp" type="timestamp"/>
<column name="contract_state_class_name" type="VARCHAR(255)"/>
<column name="lock_id" type="VARCHAR(255)"/>
<column name="contract_state_class_name" type="NVARCHAR(255)"/>
<column name="lock_id" type="NVARCHAR(255)"/>
<column name="lock_timestamp" type="timestamp"/>
<column name="notary_name" type="VARCHAR(255)"/>
<column name="notary_name" type="NVARCHAR(255)"/>
<column name="recorded_timestamp" type="timestamp"/>
<column name="state_status" type="INT"/>
</createTable>
@ -76,8 +76,8 @@
<column name="seq_no" type="INT">
<constraints nullable="false"/>
</column>
<column name="note" type="VARCHAR(255)"/>
<column name="transaction_id" type="VARCHAR(64)"/>
<column name="note" type="NVARCHAR(255)"/>
<column name="transaction_id" type="NVARCHAR(64)"/>
</createTable>
</changeSet>
<changeSet author="tudormalene (generated)" id="1511451595465-47">

View File

@ -6,7 +6,7 @@
<column name="output_index" type="INT(10)">
<constraints nullable="false"/>
</column>
<column name="transaction_id" type="VARCHAR(64)">
<column name="transaction_id" type="NVARCHAR(64)">
<constraints nullable="false"/>
</column>
</createTable>
@ -20,7 +20,7 @@
<constraints nullable="false"/>
</column>
<column name="output_index" type="INT(10)"/>
<column name="transaction_id" type="VARCHAR(64)"/>
<column name="transaction_id" type="NVARCHAR(64)"/>
</createTable>
<addPrimaryKey columnNames="child_id" constraintName="CONSTRAINT_9" tableName="children"/>

View File

@ -5,13 +5,13 @@
<column name="output_index" type="INT">
<constraints nullable="false"/>
</column>
<column name="transaction_id" type="VARCHAR(64)">
<column name="transaction_id" type="NVARCHAR(64)">
<constraints nullable="false"/>
</column>
<column name="ccy_code" type="VARCHAR(3)"/>
<column name="issuer_key_hash" type="VARCHAR(130)"/>
<column name="ccy_code" type="NVARCHAR(3)"/>
<column name="issuer_key_hash" type="NVARCHAR(130)"/>
<column name="issuer_ref" type="varbinary(512)"/>
<column name="owner_name" type="VARCHAR(255)"/>
<column name="owner_name" type="NVARCHAR(255)"/>
<column name="pennies" type="BIGINT"/>
</createTable>
</changeSet>

View File

@ -5,17 +5,17 @@
<column name="output_index" type="INT">
<constraints nullable="false"/>
</column>
<column name="transaction_id" type="VARCHAR(64)">
<column name="transaction_id" type="NVARCHAR(64)">
<constraints nullable="false"/>
</column>
<column name="ccy_code" type="VARCHAR(3)"/>
<column name="ccy_code" type="NVARCHAR(3)"/>
<column name="face_value" type="BIGINT"/>
<column name="face_value_issuer_key_hash" type="VARCHAR(130)"/>
<column name="face_value_issuer_key_hash" type="NVARCHAR(130)"/>
<column name="face_value_issuer_ref" type="varbinary(512)"/>
<column name="issuance_key_hash" type="VARCHAR(130)"/>
<column name="issuance_key_hash" type="NVARCHAR(130)"/>
<column name="issuance_ref" type="varbinary(255)"/>
<column name="maturity_instant" type="timestamp"/>
<column name="owner_key_hash" type="VARCHAR(130)"/>
<column name="owner_key_hash" type="NVARCHAR(130)"/>
</createTable>
</changeSet>
<changeSet author="tudormalene (generated)" id="1511451595465-29">

View File

@ -0,0 +1,8 @@
create database perftesting
CREATE ROLE perfnode1 with LOGIN PASSWORD 'yourStrong(!)Password';
CREATE ROLE perfnode2 with LOGIN PASSWORD 'yourStrong(!)Password';
CREATE ROLE perfnode3 with LOGIN PASSWORD 'yourStrong(!)Password';
CREATE ROLE perfnode4 with LOGIN PASSWORD 'yourStrong(!)Password';
CREATE ROLE perfnotary with LOGIN PASSWORD 'yourStrong(!)Password';
CREATE ROLE perfnetworkmap with LOGIN PASSWORD 'yourStrong(!)Password';

View File

@ -0,0 +1,48 @@
CREATE SCHEMA perfnode1;
GRANT ALL ON SCHEMA perfnode1 TO perfnode1;
GRANT ALL ON ALL tables IN SCHEMA perfnode1 TO perfnode1;
ALTER DEFAULT privileges IN SCHEMA perfnode1 GRANT ALL ON tables TO perfnode1;
GRANT ALL ON ALL sequences IN SCHEMA perfnode1 TO perfnode1;
ALTER DEFAULT privileges IN SCHEMA perfnode1 GRANT ALL ON sequences TO perfnode1;
CREATE sequence perfnode1.hibernate_sequence start 1 increment 1
CREATE SCHEMA perfnode2;
GRANT ALL ON SCHEMA perfnode2 TO perfnode2;
GRANT ALL ON ALL tables IN SCHEMA perfnode2 TO perfnode2;
ALTER DEFAULT privileges IN SCHEMA perfnode2 GRANT ALL ON tables TO perfnode2;
GRANT ALL ON ALL sequences IN SCHEMA perfnode2 TO perfnode2;
ALTER DEFAULT privileges IN SCHEMA perfnode2 GRANT ALL ON sequences TO perfnode2;
CREATE sequence perfnode2.hibernate_sequence start 1 increment 1
CREATE SCHEMA perfnode3;
GRANT ALL ON SCHEMA perfnode3 TO perfnode3;
GRANT ALL ON ALL tables IN SCHEMA perfnode3 TO perfnode3;
ALTER DEFAULT privileges IN SCHEMA perfnode3 GRANT ALL ON tables TO perfnode3;
GRANT ALL ON ALL sequences IN SCHEMA perfnode3 TO perfnode3;
ALTER DEFAULT privileges IN SCHEMA perfnode3 GRANT ALL ON sequences TO perfnode3;
CREATE sequence perfnode3.hibernate_sequence start 1 increment 1
CREATE SCHEMA perfnode4;
GRANT ALL ON SCHEMA perfnode4 TO perfnode4;
GRANT ALL ON ALL tables IN SCHEMA perfnode4 TO perfnode4;
ALTER DEFAULT privileges IN SCHEMA perfnode4 GRANT ALL ON tables TO perfnode4;
GRANT ALL ON ALL sequences IN SCHEMA perfnode4 TO perfnode4;
ALTER DEFAULT privileges IN SCHEMA perfnode4 GRANT ALL ON sequences TO perfnode4;
CREATE sequence perfnode4.hibernate_sequence start 1 increment 1
CREATE SCHEMA perfnotary;
GRANT ALL ON SCHEMA perfnotary TO perfnotary;
GRANT ALL ON ALL tables IN SCHEMA perfnotary TO perfnotary;
ALTER DEFAULT privileges IN SCHEMA perfnotary GRANT ALL ON tables TO perfnotary;
GRANT ALL ON ALL sequences IN SCHEMA perfnotary TO perfnotary;
ALTER DEFAULT privileges IN SCHEMA perfnotary GRANT ALL ON sequences TO perfnotary;
CREATE sequence perfnotary.hibernate_sequence start 1 increment 1
CREATE SCHEMA perfnetworkmap;
GRANT ALL ON SCHEMA perfnetworkmap TO perfnetworkmap;
GRANT ALL ON ALL tables IN SCHEMA perfnetworkmap TO perfnetworkmap;
ALTER DEFAULT privileges IN SCHEMA perfnetworkmap GRANT ALL ON tables TO perfnetworkmap;
GRANT ALL ON ALL sequences IN SCHEMA perfnetworkmap TO perfnetworkmap;
ALTER DEFAULT privileges IN SCHEMA perfnetworkmap GRANT ALL ON sequences TO perfnetworkmap;
CREATE sequence perfnetworkmap.hibernate_sequence start 1 increment 1

View File

@ -5,3 +5,4 @@ CREATE LOGIN perfnode2 with PASSWORD = 'yourStrong(!)Password';
CREATE LOGIN perfnode3 with PASSWORD = 'yourStrong(!)Password';
CREATE LOGIN perfnode4 with PASSWORD = 'yourStrong(!)Password';
CREATE LOGIN perfnotary with PASSWORD = 'yourStrong(!)Password';
CREATE LOGIN perfnetworkmap with PASSWORD = 'yourStrong(!)Password';

View File

@ -24,3 +24,8 @@ IF NOT EXISTS (SELECT schema_name FROM information_schema.schemata WHERE schema_
IF NOT EXISTS (SELECT * FROM sys.sysusers WHERE name='perfnotary') CREATE USER perfnotary FOR LOGIN perfnotary WITH DEFAULT_SCHEMA = perfnotary;
GRANT ALTER, DELETE, EXECUTE, INSERT, REFERENCES, SELECT, UPDATE, VIEW DEFINITION ON SCHEMA::perfnotary TO perfnotary;
GRANT CREATE TABLE, CREATE PROCEDURE, CREATE FUNCTION, CREATE VIEW TO perfnotary;
IF NOT EXISTS (SELECT schema_name FROM information_schema.schemata WHERE schema_name = 'perfnetworkmap') EXEC('CREATE SCHEMA perfnetworkmap');
IF NOT EXISTS (SELECT * FROM sys.sysusers WHERE name='perfnetworkmap') CREATE USER perfnetworkmap FOR LOGIN perfnetworkmap WITH DEFAULT_SCHEMA = perfnetworkmap;
GRANT ALTER, DELETE, EXECUTE, INSERT, REFERENCES, SELECT, UPDATE, VIEW DEFINITION ON SCHEMA::perfnetworkmap TO perfnetworkmap;
GRANT CREATE TABLE, CREATE PROCEDURE, CREATE FUNCTION, CREATE VIEW TO perfnetworkmap;

View File

@ -9,10 +9,10 @@
<column name="output_index" type="INT(10)">
<constraints nullable="false"/>
</column>
<column name="transaction_id" type="VARCHAR(64)">
<column name="transaction_id" type="NVARCHAR(64)">
<constraints nullable="false"/>
</column>
<column name="external_id" type="VARCHAR(255)"/>
<column name="external_id" type="NVARCHAR(255)"/>
<column name="uuid" type="VARCHAR(255)">
<constraints nullable="false"/>
</column>

View File

@ -7,13 +7,13 @@
<column name="output_index" type="INT(10)">
<constraints nullable="false"/>
</column>
<column name="transaction_id" type="VARCHAR(64)">
<column name="transaction_id" type="NVARCHAR(64)">
<constraints nullable="false"/>
</column>
<column name="external_id" type="VARCHAR(255)"/>
<column name="external_id" type="NVARCHAR(255)"/>
<column name="linear_boolean" type="BOOLEAN(1)"/>
<column name="linear_number" type="BIGINT(19)"/>
<column name="linear_string" type="VARCHAR(255)"/>
<column name="linear_string" type="NVARCHAR(255)"/>
<column name="linear_timestamp" type="TIMESTAMP"/>
<column name="uuid" type="VARCHAR(255)">
<constraints nullable="false"/>

View File

@ -8,16 +8,16 @@
<column name="output_index" type="INT(10)">
<constraints nullable="false"/>
</column>
<column name="transaction_id" type="VARCHAR(64)">
<column name="transaction_id" type="NVARCHAR(64)">
<constraints nullable="false"/>
</column>
<column name="external_id" type="VARCHAR(255)"/>
<column name="external_id" type="NVARCHAR(255)"/>
<column name="uuid" type="VARCHAR(255)">
<constraints nullable="false"/>
</column>
<column name="linear_boolean" type="BOOLEAN(1)"/>
<column name="linear_number" type="BIGINT(19)"/>
<column name="linear_string" type="VARCHAR(255)"/>
<column name="linear_string" type="NVARCHAR(255)"/>
<column name="linear_timestamp" type="TIMESTAMP"/>
</createTable>