mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
68a6e98292 | ||
|
|
d61bdb028b | ||
|
|
9ddadb1338 | ||
|
|
fa1f225e67 | ||
|
|
7a72adedfa | ||
|
|
3d3e5c2c34 | ||
|
|
708f429c21 | ||
|
|
bca49ed2e2 | ||
|
|
e103ec7706 | ||
|
|
9fc1bec6a9 | ||
|
|
f712635860 | ||
|
|
47a0e38eac | ||
|
|
870d90d055 | ||
|
|
ac1b30782a | ||
|
|
b63445e9c9 | ||
|
|
09f616aae8 | ||
|
|
994fb267ad | ||
|
|
53b1e4d682 | ||
|
|
c7f6c508a6 | ||
|
|
9109fd356f | ||
|
|
55477d4fab | ||
|
|
340281113f | ||
|
|
77610672a9 | ||
|
|
d8238735c1 | ||
|
|
f63b013ef9 | ||
|
|
6fe3ec9355 | ||
|
|
d1c21bf50a | ||
|
|
578560c2e2 | ||
|
|
0f9462b7b5 | ||
|
|
e89891038b | ||
|
|
2a7a2d4dd4 | ||
|
|
f499cc8c2c | ||
|
|
0dc4c6b11b | ||
|
|
f5d0777b86 | ||
|
|
81443b77bc | ||
|
|
2867c50090 | ||
|
|
c04171c1a5 | ||
|
|
e19cbdc2f6 | ||
|
|
3e2e84e8bf | ||
|
|
edb3759b3d | ||
|
|
7ee0610db1 |
@@ -11,6 +11,7 @@ ebean-profiling*.xml
|
||||
/db
|
||||
/mydb.db
|
||||
profiling/
|
||||
.DS_Store
|
||||
|
||||
# Intellij project files
|
||||
*.iml
|
||||
|
||||
+11
-12
@@ -4,13 +4,13 @@ Overview of ebean.properties file
|
||||
|
||||
### DbMigration options
|
||||
|
||||
You can set individual values for different platforms when generating migrations
|
||||
You can set individual values for different platforms when generating migrations.
|
||||
|
||||
`dbmigration.platform.<PLATFORM>.databaseSequenceBatchSize`
|
||||
For DB's using sequences this is the number of sequence values prefetched.
|
||||
|
||||
`dbmigration.platform.<PLATFORM>.dbuuid`
|
||||
Control, how UUID generation should work - it affects DDL which column type is generated. Possible values:
|
||||
Control, how UUID generation should work - it affects which column type is generated in DDL. Possible values:
|
||||
- BINARY enforces binary UUID
|
||||
- VARCHAR enforces varchar UUID
|
||||
- BINARY_OPTIMIZED enforces binary-optimized UUID (makes sense only with Type1 ID)
|
||||
@@ -19,7 +19,7 @@ Control, how UUID generation should work - it affects DDL which column type is g
|
||||
- AUTO_VARCHAR (default) use varchar when platform does not support UUID
|
||||
|
||||
`dbmigration.platform.<PLATFORM>.uuidStoreAsBinary`
|
||||
Same as setting dbuuid to BINARY
|
||||
Same as setting dbuuid to BINARY.
|
||||
|
||||
`dbmigration.platform.<PLATFORM>.geometrySRID`
|
||||
The Geometry SRID value (default 4326).
|
||||
@@ -30,7 +30,6 @@ The ID type (IDENTITY, SEQUENCE, GENERATOR, EXTERNAL)
|
||||
`dbmigration.platform.<PLATFORM>.mapping`
|
||||
Adjust the mapping. For example `BOOLEAN=integer(32);BIT=tinyint(3)`
|
||||
|
||||
|
||||
`ebean.migration.applyPrefix`
|
||||
Set this to "V" to be compatible with FlywayDB.
|
||||
|
||||
@@ -50,7 +49,7 @@ Set to true if the DB migration should be generated on server start.
|
||||
The version of a pending drop that should be generated as the next migration.
|
||||
|
||||
`ebean.migration.includeGeneratedFileComment`
|
||||
TODO
|
||||
Adds the header about the migration files being generated when true. Reading 'THIS IS A GENERATED FILE - DO NOT MODIFY'
|
||||
|
||||
`ebean.migration.metaTable`
|
||||
For running migration the DB table that holds migration execution status. Default 'db_migration'
|
||||
@@ -65,17 +64,17 @@ Subdirectory the model xml files go into. Default 'model'
|
||||
Suffix. Default '.model.xml'
|
||||
|
||||
`ebean.migration.name`
|
||||
Description text that can be appended to the version to become the ddl script file name
|
||||
Description text that can be appended to the version to become the ddl script file name.
|
||||
|
||||
`ebean.migration.patchInsertOn`
|
||||
migration versions that should be added to history without running.
|
||||
Migration versions that should be added to history without running.
|
||||
|
||||
`ebean.migration.patchResetChecksumOn`
|
||||
migration versions that should have their checksum reset and not run.
|
||||
Use this if you get a 'Checksum mismatch' error.
|
||||
|
||||
`ebean.migration.placeholders`
|
||||
A comma and equals delimited placeholders that are substituted in SQL scripts when running migration (used by DB Migration runner only).
|
||||
A comma and equals delimited map of placeholders that are substituted in SQL scripts when running migration (used by DB Migration runner only).
|
||||
|
||||
`ebean.migration.platform`
|
||||
The database platform to generate migration DDL for.
|
||||
@@ -90,7 +89,7 @@ The migration version name (typically FlywayDb compatible). Example: 1.1.1_2
|
||||
### Ebean UUID options
|
||||
|
||||
`ebean.uuidVersion`
|
||||
Controls, how the UUIDs are generated. Possible values
|
||||
Controls how the UUIDs are generated. Possible values:
|
||||
- VERSION4 (default) generate random V4 UUIDs,
|
||||
- VERSION1 generate rfc4122 compliant Type 1 UUIDs (requires a state file)
|
||||
- VERSION1RND generate fake Type 1 UUIDs
|
||||
@@ -98,7 +97,7 @@ Controls, how the UUIDs are generated. Possible values
|
||||
Note, that V1 UUIDs in conjunction with AUTO_BINARY_OPTIMIZED will give you the best index performance, but you MUST understand how this works to avoid collisions.
|
||||
|
||||
`ebean.uuidStateFile`
|
||||
The state file that is Required to generate V1 UUIDs
|
||||
The state file that is required to generate V1 UUIDs.
|
||||
|
||||
|
||||
### DocStoreConfig
|
||||
@@ -107,7 +106,7 @@ The state file that is Required to generate V1 UUIDs
|
||||
True when the Document store integration is active/on.
|
||||
|
||||
`ebean.docstore.allowAllCertificates`
|
||||
Set to true such that the client allows connections to invalid/self signed SSL certificates.
|
||||
Set to true such that the client allows connections to invalid/self-signed SSL certificates.
|
||||
|
||||
`ebean.docstore.bulkBatchSize`
|
||||
The default batch size to use for the Bulk API calls.
|
||||
@@ -192,7 +191,7 @@ Suffix appended to the base table to derive the view that contains the union of
|
||||
Set to true if the DataSource uses autoCommit. Indicates that Ebean should use autoCommit friendly Transactions and TransactionManager.
|
||||
|
||||
`ebean.autoReadOnlyDataSource`
|
||||
When true create a read only DataSource using readOnlyDataSourceConfig defaulting values from dataSourceConfig
|
||||
When true create a read only DataSource using readOnlyDataSourceConfig defaulting values from dataSourceConfig.
|
||||
|
||||
`ebean.autostart`
|
||||
Should the server start all
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-clickhouse</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -41,13 +41,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-clickhouse</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-cockroach</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -41,13 +41,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-db2</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -41,13 +41,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-db2</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-h2</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -41,13 +41,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-h2</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-hana</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -41,13 +41,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-hana</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-mariadb</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -41,13 +41,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-mariadb</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-mysql</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -41,13 +41,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-mysql</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-nuodb</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -41,13 +41,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-nuodb</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-oracle</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -41,13 +41,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-oracle</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-postgres</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -41,13 +41,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-sqlite</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -41,13 +41,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-sqlite</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-sqlserver</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -41,13 +41,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-sqlserver</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-yugabyte</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -41,13 +41,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean (all platforms)</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -40,7 +40,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-jackson-mapper</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -59,13 +59,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-all</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>composites</artifactId>
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean api</name>
|
||||
|
||||
@@ -144,7 +144,7 @@ public class DbConstraintNaming {
|
||||
}
|
||||
sb.append(normaliseColumn(columns[i]));
|
||||
}
|
||||
return sb.toString();
|
||||
return sb.toString().replace(" ", "_");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -27,7 +27,6 @@ public class DbConstraintNormalise {
|
||||
* quoted identifier characters (",',[,] etc).
|
||||
*/
|
||||
public String normaliseTable(String tableName) {
|
||||
|
||||
tableName = trimQuotes(tableName);
|
||||
int lastPeriod = tableName.lastIndexOf('.');
|
||||
if (lastPeriod > -1) {
|
||||
@@ -59,7 +58,6 @@ public class DbConstraintNormalise {
|
||||
* Trim off the platform quoted identifier quotes like [ ' and ".
|
||||
*/
|
||||
public String trimQuotes(String identifier) {
|
||||
|
||||
if (identifier == null) {
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -28,6 +28,16 @@ public class DbPlatformType implements ExtraDbTypes {
|
||||
*/
|
||||
private final boolean canHaveLength;
|
||||
|
||||
/**
|
||||
* The maximum length supported by this platform type. If length is too big, fallback is used.
|
||||
*/
|
||||
private final int maxLength;
|
||||
|
||||
/**
|
||||
* Use this platform type if length exceedes
|
||||
*/
|
||||
private final DbPlatformType fallback;
|
||||
|
||||
/**
|
||||
* Parse a type definition into a DbPlatformType.
|
||||
* <p>
|
||||
@@ -53,6 +63,41 @@ public class DbPlatformType implements ExtraDbTypes {
|
||||
this(name, defaultLength, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct without length, but with a max length limit and a fallback type, that is used if maxLength is exceeded.
|
||||
* This can be used to use <ul>
|
||||
* <li>"longtext" for unspecified length</li>
|
||||
* <li>"text" for length up to 2^16-1</li>
|
||||
* <li>"mediumtext" for length up to 2^24-1</li>
|
||||
* <li>"longtext" else</li>
|
||||
* </ul>
|
||||
*/
|
||||
public DbPlatformType(String name, int maxLength, DbPlatformType fallback) {
|
||||
this.name = name;
|
||||
this.defaultLength = 0;
|
||||
this.defaultScale = 0;
|
||||
this.canHaveLength = false;
|
||||
this.maxLength = maxLength;
|
||||
this.fallback = fallback;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct with a given default length, a max length limit and a fallback type, that is used if maxLength is exceeded.
|
||||
* This can be used to use <ul>
|
||||
* <li>"varchar(255)" for unspecified length</li>
|
||||
* <li>"varchar(N)" for N <= maxLength</li>
|
||||
* <li>"varchar(max)" else</li>
|
||||
* </ul>
|
||||
*/
|
||||
public DbPlatformType(String name, int defaultPrecision, int maxLength, DbPlatformType fallback) {
|
||||
this.name = name;
|
||||
this.defaultLength = defaultPrecision;
|
||||
this.defaultScale = 0;
|
||||
this.canHaveLength = true;
|
||||
this.maxLength = maxLength;
|
||||
this.fallback = fallback;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct for Decimal with precision and scale.
|
||||
*/
|
||||
@@ -61,6 +106,8 @@ public class DbPlatformType implements ExtraDbTypes {
|
||||
this.defaultLength = defaultPrecision;
|
||||
this.defaultScale = defaultScale;
|
||||
this.canHaveLength = true;
|
||||
this.maxLength = Integer.MAX_VALUE;
|
||||
this.fallback = null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -74,6 +121,8 @@ public class DbPlatformType implements ExtraDbTypes {
|
||||
this.defaultLength = 0;
|
||||
this.defaultScale = 0;
|
||||
this.canHaveLength = canHaveLength;
|
||||
this.maxLength = Integer.MAX_VALUE;
|
||||
this.fallback = null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -124,33 +173,33 @@ public class DbPlatformType implements ExtraDbTypes {
|
||||
*/
|
||||
public String renderType(int deployLength, int deployScale, boolean strict) {
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(name);
|
||||
if (canHaveLength || !strict) {
|
||||
renderLengthScale(deployLength, deployScale, sb);
|
||||
}
|
||||
int len = deployLength != 0 ? deployLength : defaultLength;
|
||||
if (len > maxLength) {
|
||||
return fallback.renderType(deployLength, deployScale, strict);
|
||||
} else {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(name);
|
||||
if ((canHaveLength || !strict) && len > 0) {
|
||||
renderLengthScale(len, deployScale, sb);
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the length and scale part of the column definition.
|
||||
*/
|
||||
protected void renderLengthScale(int deployLength, int deployScale, StringBuilder sb) {
|
||||
protected void renderLengthScale(int len, int deployScale, StringBuilder sb) {
|
||||
// see if there is a precision/scale to add (or not)
|
||||
int len = deployLength != 0 ? deployLength : defaultLength;
|
||||
if (len == Integer.MAX_VALUE) {
|
||||
sb.append("(max)"); // TODO: this is sqlserver specific
|
||||
} else if (len > 0) {
|
||||
sb.append("(");
|
||||
sb.append(len);
|
||||
int scale = deployScale != 0 ? deployScale : defaultScale;
|
||||
if (scale > 0) {
|
||||
sb.append(",");
|
||||
sb.append(scale);
|
||||
}
|
||||
sb.append(")");
|
||||
sb.append('(');
|
||||
sb.append(len);
|
||||
int scale = deployScale != 0 ? deployScale : defaultScale;
|
||||
if (scale > 0) {
|
||||
sb.append(',');
|
||||
sb.append(scale);
|
||||
}
|
||||
sb.append(')');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+25
-25
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean bom</name>
|
||||
@@ -89,25 +89,25 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -125,13 +125,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-jackson-mapper</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-ddl-generator</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -155,46 +155,46 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>querybean-generator</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>kotlin-querybean-generator</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-postgis</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-redis</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-spring-txn</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- platforms -->
|
||||
@@ -202,67 +202,67 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-clickhouse</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-db2</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-h2</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-hana</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-mariadb</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-mysql</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-nuodb</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-oracle</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-postgres</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-sqlite</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-sqlserver</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
@@ -16,7 +16,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
+6
-6
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-core</artifactId>
|
||||
@@ -22,7 +22,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -46,7 +46,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -159,21 +159,21 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-h2</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-sqlserver</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ public interface Persister {
|
||||
/**
|
||||
* Execute or queue the update.
|
||||
*/
|
||||
void executeOrQueue(SpiSqlUpdate update, SpiTransaction t, boolean queue);
|
||||
void executeOrQueue(SpiSqlUpdate update, SpiTransaction t, boolean queue, int queuePosition);
|
||||
|
||||
/**
|
||||
* Queue the SqlUpdate for execution with position 0, 1 or 2 defining
|
||||
|
||||
@@ -27,17 +27,24 @@ public final class IndexDefinition {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a unique constraint given the column names.
|
||||
* Create from JPA Index.
|
||||
*/
|
||||
public IndexDefinition(String name, String[] columns) {
|
||||
public IndexDefinition(String name, String[] columns, boolean unique) {
|
||||
this.columns = columns;
|
||||
this.unique = true;
|
||||
this.unique = unique;
|
||||
this.name = name;
|
||||
this.platforms = null;
|
||||
this.concurrent = false;
|
||||
this.definition = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a unique constraint given the column names.
|
||||
*/
|
||||
public IndexDefinition(String name, String[] columns) {
|
||||
this(name, columns, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if this can be used as a unique constraint.
|
||||
*/
|
||||
|
||||
@@ -129,6 +129,10 @@ final class AnnotationClass extends AnnotationParser {
|
||||
for (UniqueConstraint c : uniqueConstraints) {
|
||||
descriptor.addIndex(new IndexDefinition(c.name(), convertColumnNames(c.columnNames())));
|
||||
}
|
||||
for (javax.persistence.Index index : table.indexes()) {
|
||||
final String[] cols = index.columnList().split(",");
|
||||
descriptor.addIndex(new IndexDefinition(index.name(), convertColumnNames(cols), index.unique()));
|
||||
}
|
||||
}
|
||||
StorageEngine storage = typeGet(cls, StorageEngine.class);
|
||||
if (storage != null) {
|
||||
|
||||
@@ -81,7 +81,10 @@ public final class BatchControl {
|
||||
*/
|
||||
private int bufferMax;
|
||||
|
||||
private final Queue[] queues = new Queue[3];
|
||||
private final Queue[] queues = new Queue[2];
|
||||
|
||||
static final int DELETE_QUEUE = 0;
|
||||
static final int INSERT_QUEUE = 1;
|
||||
|
||||
/**
|
||||
* Create for a given transaction, PersistExecute, default size and getGeneratedKeys.
|
||||
@@ -265,10 +268,9 @@ public final class BatchControl {
|
||||
}
|
||||
|
||||
private void flushBuffer(boolean reset) throws BatchedSqlException {
|
||||
flushQueue(queues[0]);
|
||||
flushInternal(reset);
|
||||
flushQueue(queues[1]);
|
||||
flushQueue(queues[2]);
|
||||
flushQueue(queues[DELETE_QUEUE]);
|
||||
flushQueue(queues[INSERT_QUEUE]);
|
||||
}
|
||||
|
||||
private void flushQueue(Queue queue) throws BatchedSqlException {
|
||||
|
||||
@@ -106,9 +106,9 @@ public final class DefaultPersister implements Persister {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void executeOrQueue(SpiSqlUpdate update, SpiTransaction t, boolean queue) {
|
||||
public void executeOrQueue(SpiSqlUpdate update, SpiTransaction t, boolean queue, int queuePosition) {
|
||||
if (queue) {
|
||||
addToFlushQueue(update, t, 2);
|
||||
addToFlushQueue(update, t, queuePosition);
|
||||
} else {
|
||||
executeSqlUpdate(update, t);
|
||||
}
|
||||
@@ -907,7 +907,7 @@ public final class DefaultPersister implements Persister {
|
||||
void deleteManyIntersection(EntityBean bean, BeanPropertyAssocMany<?> many, SpiTransaction t, boolean publish, boolean queue) {
|
||||
SpiSqlUpdate sqlDelete = deleteAllIntersection(bean, many, publish);
|
||||
if (queue) {
|
||||
addToFlushQueue(sqlDelete, t, 1);
|
||||
addToFlushQueue(sqlDelete, t, BatchControl.DELETE_QUEUE);
|
||||
} else {
|
||||
executeSqlUpdate(sqlDelete, t);
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ abstract class SaveManyBase implements SaveMany {
|
||||
final void preElementCollectionUpdate() {
|
||||
if (!insertedParent) {
|
||||
request.preElementCollectionUpdate();
|
||||
persister.addToFlushQueue(many.deleteByParentId(request.beanId(), null), transaction, 1);
|
||||
persister.addToFlushQueue(many.deleteByParentId(request.beanId(), null), transaction, BatchControl.DELETE_QUEUE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -294,7 +294,7 @@ final class SaveManyBeans extends SaveManyBase {
|
||||
// build a intersection row for 'delete'
|
||||
IntersectionRow intRow = many.buildManyToManyMapBean(parentBean, otherDelete, publish);
|
||||
SpiSqlUpdate sqlDelete = intRow.createDelete(server, DeleteMode.HARD);
|
||||
persister.executeOrQueue(sqlDelete, transaction, queue);
|
||||
persister.executeOrQueue(sqlDelete, transaction, queue, BatchControl.DELETE_QUEUE);
|
||||
}
|
||||
}
|
||||
if (additions != null && !additions.isEmpty()) {
|
||||
@@ -314,7 +314,7 @@ final class SaveManyBeans extends SaveManyBase {
|
||||
// build a intersection row for 'insert'
|
||||
IntersectionRow intRow = many.buildManyToManyMapBean(parentBean, otherBean, publish);
|
||||
SpiSqlUpdate sqlInsert = intRow.createInsert(server);
|
||||
persister.executeOrQueue(sqlInsert, transaction, queue);
|
||||
persister.executeOrQueue(sqlInsert, transaction, queue, BatchControl.INSERT_QUEUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ final class SaveManyElementCollection extends SaveManyBase {
|
||||
final SpiSqlUpdate sqlInsert = proto.copy();
|
||||
sqlInsert.setParameter(parentId);
|
||||
many.bindElementValue(sqlInsert, value);
|
||||
persister.addToFlushQueue(sqlInsert, transaction, 2);
|
||||
persister.addToFlushQueue(sqlInsert, transaction, BatchControl.INSERT_QUEUE);
|
||||
}
|
||||
resetModifyState();
|
||||
postElementCollectionUpdate();
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ final class SaveManyElementCollectionMap extends SaveManyBase {
|
||||
sqlInsert.setParameter(parentId);
|
||||
sqlInsert.setParameter(entry.getKey());
|
||||
many.bindElementValue(sqlInsert, entry.getValue());
|
||||
persister.addToFlushQueue(sqlInsert, transaction, 2);
|
||||
persister.addToFlushQueue(sqlInsert, transaction, BatchControl.INSERT_QUEUE);
|
||||
}
|
||||
resetModifyState();
|
||||
postElementCollectionUpdate();
|
||||
|
||||
@@ -385,7 +385,10 @@ public final class CQuery<T> implements DbReadContext, CancelableQuery, SpiProfi
|
||||
this.lazyLoadParentId = lazyLoadParentId;
|
||||
}
|
||||
// add the loadedBean to the appropriate collection of lazyLoadParentBean
|
||||
lazyLoadManyProperty.addBeanToCollectionWithCreate(lazyLoadParentBean, bean, true);
|
||||
if (lazyLoadParentBean != null) {
|
||||
// Note: parentBean can be null, when GC ran between construction of query and building the retrieved bean
|
||||
lazyLoadManyProperty.addBeanToCollectionWithCreate(lazyLoadParentBean, bean, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+13
-8
@@ -52,7 +52,7 @@ public final class JtaTransactionManager implements ExternalTransactionManager {
|
||||
return transactionManager.dataSource();
|
||||
}
|
||||
|
||||
private TransactionSynchronizationRegistry getSyncRegistry() {
|
||||
private TransactionSynchronizationRegistry registry() {
|
||||
try {
|
||||
InitialContext ctx = new InitialContext();
|
||||
return (TransactionSynchronizationRegistry) ctx.lookup("java:comp/TransactionSynchronizationRegistry");
|
||||
@@ -61,7 +61,7 @@ public final class JtaTransactionManager implements ExternalTransactionManager {
|
||||
}
|
||||
}
|
||||
|
||||
private UserTransaction getUserTransaction() {
|
||||
private UserTransaction userTransaction() {
|
||||
try {
|
||||
InitialContext ctx = new InitialContext();
|
||||
return (UserTransaction) ctx.lookup("java:comp/UserTransaction");
|
||||
@@ -78,11 +78,16 @@ public final class JtaTransactionManager implements ExternalTransactionManager {
|
||||
*/
|
||||
@Override
|
||||
public Object getCurrentTransaction() {
|
||||
TransactionSynchronizationRegistry syncRegistry = getSyncRegistry();
|
||||
SpiTransaction t = (SpiTransaction) syncRegistry.getResource(EBEAN_TXN_RESOURCE);
|
||||
if (t != null) {
|
||||
// we have already seen this transaction
|
||||
return t;
|
||||
TransactionSynchronizationRegistry syncRegistry = registry();
|
||||
try {
|
||||
SpiTransaction t = (SpiTransaction) syncRegistry.getResource(EBEAN_TXN_RESOURCE);
|
||||
if (t != null) {
|
||||
// we have already seen this transaction
|
||||
return t;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// deem that there is no current transaction
|
||||
return null;
|
||||
}
|
||||
|
||||
// check current Ebean transaction
|
||||
@@ -93,7 +98,7 @@ public final class JtaTransactionManager implements ExternalTransactionManager {
|
||||
return currentEbeanTransaction;
|
||||
}
|
||||
|
||||
UserTransaction ut = getUserTransaction();
|
||||
UserTransaction ut = userTransaction();
|
||||
if (ut == null) {
|
||||
// no current JTA transaction
|
||||
if (log.isLoggable(DEBUG)) {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean ddl generation</name>
|
||||
@@ -28,14 +28,14 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-all</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
+1
@@ -15,6 +15,7 @@ class ClickHouseDbArray {
|
||||
mapping.put("integer[]", "Array(UInt32)");
|
||||
mapping.put("bigint[]", "Array(UInt64)");
|
||||
mapping.put("float[]", "Array(Float32)");
|
||||
mapping.put("float4[]", "Array(Float32)");
|
||||
mapping.put("decimal[]", "Array(Decimal)");
|
||||
}
|
||||
|
||||
|
||||
+17
-7
@@ -279,7 +279,13 @@ public class PlatformDdl {
|
||||
if (type == null) {
|
||||
return null;
|
||||
}
|
||||
type = extract(type);
|
||||
String[] tmp = type.split(";", -1); // do not discard trailing empty strings
|
||||
int index = extract(tmp);
|
||||
if (index < tmp.length - 1) {
|
||||
// this is a platform specific definition. So do not apply further conversions
|
||||
return tmp[index];
|
||||
}
|
||||
type = tmp[index];
|
||||
if (type.contains("[]")) {
|
||||
return convertArrayType(type);
|
||||
}
|
||||
@@ -294,18 +300,22 @@ public class PlatformDdl {
|
||||
return null;
|
||||
}
|
||||
String[] tmp = type.split(";", -1); // do not discard trailing empty strings
|
||||
if (tmp.length % 2 == 0) {
|
||||
throw new IllegalArgumentException("You need an odd number of arguments in '" + type + "'. See Issue #2559 for details");
|
||||
return tmp[extract(tmp)]; // else
|
||||
}
|
||||
|
||||
protected int extract(String[] types) {
|
||||
if (types.length % 2 == 0) {
|
||||
throw new IllegalArgumentException("You need an odd number of arguments in '" + String.join(";", types) + "'. See Issue #2559 for details");
|
||||
}
|
||||
for (int i = 0; i < tmp.length - 2; i += 2) {
|
||||
String[] platforms = tmp[i].split(",");
|
||||
for (int i = 0; i < types.length - 2; i += 2) {
|
||||
String[] platforms = types[i].split(",");
|
||||
for (String plat : platforms) {
|
||||
if (platform.isPlatform(Platform.valueOf(plat.toUpperCase(Locale.ENGLISH)))) {
|
||||
return tmp[i + 1];
|
||||
return i + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return tmp[tmp.length - 1]; // else
|
||||
return types.length - 1; // else
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+7
-1
@@ -10,17 +10,23 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
public class MySqlPlatformTest {
|
||||
|
||||
MySqlPlatform mySqlPlatform = new MySqlPlatform();
|
||||
|
||||
private static int X = 0xFFFFFF;
|
||||
@Test
|
||||
public void testTypeConversion() {
|
||||
PlatformDdl ddl = PlatformDdlBuilder.create(mySqlPlatform);
|
||||
assertThat(ddl.convert("clob")).isEqualTo("longtext");
|
||||
assertThat(ddl.convert("clob(65535)")).isEqualTo("text");
|
||||
assertThat(ddl.convert("clob(65536)")).isEqualTo("mediumtext");
|
||||
assertThat(ddl.convert("clob(16777215)")).isEqualTo("mediumtext");
|
||||
assertThat(ddl.convert("clob(16777216)")).isEqualTo("longtext");
|
||||
assertThat(ddl.convert("json")).isEqualTo("json");
|
||||
assertThat(ddl.convert("jsonb")).isEqualTo("json");
|
||||
assertThat(ddl.convert("varchar(20)")).isEqualTo("varchar(20)");
|
||||
assertThat(ddl.convert("boolean")).isEqualTo("tinyint(1)");
|
||||
assertThat(ddl.convert("bit")).isEqualTo("tinyint(1)");
|
||||
assertThat(ddl.convert("decimal")).isEqualTo("decimal(16,3)");
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+5
-1
@@ -19,7 +19,7 @@ public class SqlserverPlatformTest {
|
||||
PlatformDdl ddl = PlatformDdlBuilder.create(platform);
|
||||
|
||||
assertThat(ddl.convert("clob")).isEqualTo("nvarchar(max)");
|
||||
assertThat(ddl.convert("blob")).isEqualTo("image");
|
||||
assertThat(ddl.convert("blob")).isEqualTo("varbinary(max)");
|
||||
assertThat(ddl.convert("json")).isEqualTo("nvarchar(max)");
|
||||
assertThat(ddl.convert("jsonb")).isEqualTo("nvarchar(max)");
|
||||
|
||||
@@ -32,6 +32,10 @@ public class SqlserverPlatformTest {
|
||||
assertThat(ddl.convert("bit")).isEqualTo("bit");
|
||||
assertThat(ddl.convert("tinyint")).isEqualTo("smallint");
|
||||
assertThat(ddl.convert("binary(16)")).isEqualTo("binary(16)");
|
||||
|
||||
assertThat(ddl.convert("varchar")).isEqualTo("nvarchar(255)");
|
||||
assertThat(ddl.convert("varchar(4000)")).isEqualTo("nvarchar(4000)");
|
||||
assertThat(ddl.convert("varchar(4001)")).isEqualTo("nvarchar(max)");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean postgis</name>
|
||||
@@ -22,14 +22,14 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- provided scope -->
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean querybean</name>
|
||||
@@ -17,7 +17,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -63,21 +63,21 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-ddl-generator</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>querybean-generator</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
+6
-6
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-redis</artifactId>
|
||||
@@ -22,35 +22,35 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>querybean-generator</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-spring-txn</artifactId>
|
||||
@@ -28,7 +28,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
+6
-6
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean test</name>
|
||||
@@ -28,20 +28,20 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-h2</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-ddl-generator</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -132,14 +132,14 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-jackson-mapper</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-all</artifactId>
|
||||
<version>13.19.0</version>
|
||||
<version>13.20.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ class ClickHouseSetup implements PlatformSetup {
|
||||
config.setUsername("default");
|
||||
config.setPassword("");
|
||||
config.setUrl("jdbc:clickhouse://${host}:${port}/${databaseName}");
|
||||
config.setDriver("ru.yandex.clickhouse.ClickHouseDriver");
|
||||
config.setDriver("com.clickhouse.jdbc.ClickHouseDriver");
|
||||
config.datasourceDefaults();
|
||||
|
||||
return dockerProperties(config);
|
||||
|
||||
@@ -31,6 +31,11 @@ public class DbConstraintNamingTest {
|
||||
assertThat(naming.normaliseTable("foo_bar]")).isEqualTo("foo_bar");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIndexNameWithSpaces() {
|
||||
assertThat(naming.indexName("foo", new String[]{"name", "other desc"})).isEqualTo("ix_foo_name_other_desc");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDefaultToLower() {
|
||||
assertThat(naming.normaliseTable("SCH.FOO_BAR]")).isEqualTo("foo_bar");
|
||||
|
||||
@@ -62,7 +62,7 @@ class DbTypeMapTest {
|
||||
assertThat(dbTypeMap.lookup("json", false).renderType(0, 0)).isEqualTo("nvarchar(max)");
|
||||
assertThat(dbTypeMap.lookup("jsonb", false).renderType(0, 0)).isEqualTo("nvarchar(max)");
|
||||
assertThat(dbTypeMap.lookup("jsonclob", false).renderType(0, 0)).isEqualTo("nvarchar(max)");
|
||||
assertThat(dbTypeMap.lookup("jsonblob", false).renderType(0, 0)).isEqualTo("image");
|
||||
assertThat(dbTypeMap.lookup("jsonblob", false).renderType(0, 0)).isEqualTo("varbinary(max)");
|
||||
assertThat(dbTypeMap.lookup("jsonvarchar", false).renderType(200, 0)).isEqualTo("nvarchar(200)");
|
||||
}
|
||||
|
||||
|
||||
@@ -57,6 +57,10 @@ public class DbMigrationTest extends BaseTestCase {
|
||||
"migtest_ckey_detail",
|
||||
"migtest_ckey_parent",
|
||||
"migtest_e_basic",
|
||||
"migtest_e_test_binary",
|
||||
"migtest_e_test_varchar",
|
||||
"migtest_e_test_lob",
|
||||
"migtest_e_test_json",
|
||||
"migtest_e_enum",
|
||||
"migtest_e_history",
|
||||
"migtest_e_history2",
|
||||
@@ -83,9 +87,14 @@ public class DbMigrationTest extends BaseTestCase {
|
||||
"`migtest_QuOtEd`",
|
||||
"migtest_QuOtEd",
|
||||
"\"migtest_QuOtEd\"",
|
||||
"drop_main_drop_ref_many",
|
||||
"drop_ref_many",
|
||||
"drop_ref_one",
|
||||
"drop_main",
|
||||
"table",
|
||||
"\"table\"",
|
||||
"`table`");
|
||||
|
||||
((DataSourcePool)server().dataSource()).offline();
|
||||
((DataSourcePool)server().dataSource()).online();
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
The migration dir contains 3 folders `v1_0`, `v1_1`, `v1_2`.
|
||||
|
||||
The general idea is, that we try to perform a migration (=`v1.0` -> `v1.1`) and also if it is revertable (= `v1.1` -> `v1.0`)
|
||||
|
||||
To achieve that, the directories `v1_0` and `v1_2` should be as equal as possible. Annomalies should be commented.
|
||||
|
||||
It is also important, if new models are added, that all table names (also for M2M) are added in the `DbMigrationTest`
|
||||
cleanup routine.
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package misc.migration.v1_0;
|
||||
package misc.migration.v1_1;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.List;
|
||||
+1
-2
@@ -1,9 +1,8 @@
|
||||
package misc.migration.v1_0;
|
||||
package misc.migration.v1_1;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.ManyToMany;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.Table;
|
||||
import java.util.List;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package misc.migration.v1_0;
|
||||
package misc.migration.v1_1;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
@@ -0,0 +1,72 @@
|
||||
package misc.migration.v1_1;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
@Entity
|
||||
@Table(name = "migtest_e_test_binary")
|
||||
public class ETestBinary {
|
||||
|
||||
@Id
|
||||
int id;
|
||||
|
||||
@Size(max = 16)
|
||||
byte[] test_byte16;
|
||||
|
||||
@Size(max = 256)
|
||||
byte[] test_byte256;
|
||||
|
||||
@Size(max = 512)
|
||||
byte[] test_byte512;
|
||||
|
||||
@Size(max = 1024)
|
||||
byte[] test_byte1k;
|
||||
|
||||
@Size(max = 2 * 1024)
|
||||
byte[] test_byte2k;
|
||||
|
||||
@Size(max = 4 * 1024)
|
||||
byte[] test_byte4k;
|
||||
|
||||
@Size(max = 8 * 1024)
|
||||
byte[] test_byte8k;
|
||||
|
||||
@Size(max = 16 * 1024)
|
||||
byte[] test_byte16k;
|
||||
|
||||
@Size(max = 32 * 1024)
|
||||
byte[] test_byte32k;
|
||||
|
||||
@Size(max = 64 * 1024)
|
||||
byte[] test_byte64k;
|
||||
|
||||
@Size(max = 128 * 1024)
|
||||
byte[] test_byte128k;
|
||||
|
||||
@Size(max = 256 * 1024)
|
||||
byte[] test_byte256k;
|
||||
|
||||
@Size(max = 512 * 1024)
|
||||
byte[] test_byte512k;
|
||||
|
||||
@Size(max = 1024 * 1024)
|
||||
byte[] test_byte1m;
|
||||
|
||||
@Size(max = 2 * 1024 * 1024)
|
||||
byte[] test_byte2m;
|
||||
|
||||
@Size(max = 4 * 1024 * 1024)
|
||||
byte[] test_byte4m;
|
||||
|
||||
@Size(max = 8 * 1024 * 1024)
|
||||
byte[] test_byte8m;
|
||||
|
||||
@Size(max = 16 * 1024 * 1024)
|
||||
byte[] test_byte16m;
|
||||
|
||||
@Size(max = 32 * 1024 * 1024)
|
||||
byte[] test_byte32m;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package misc.migration.v1_1;
|
||||
|
||||
import io.ebean.annotation.DbJson;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import java.util.List;
|
||||
|
||||
@Entity
|
||||
@Table(name = "migtest_e_test_json")
|
||||
public class ETestJson {
|
||||
|
||||
@Id
|
||||
int id;
|
||||
|
||||
@DbJson(length = 255)
|
||||
List<String> json255;
|
||||
|
||||
@DbJson(length = 256)
|
||||
List<String> json256;
|
||||
|
||||
@DbJson(length = 512)
|
||||
List<String> json512;
|
||||
|
||||
@DbJson(length = 1024)
|
||||
List<String> json1k;
|
||||
|
||||
@DbJson(length = 2 * 1024)
|
||||
List<String> json2k;
|
||||
|
||||
@DbJson(length = 4 * 1024)
|
||||
List<String> json4k;
|
||||
|
||||
@DbJson(length = 8 * 1024)
|
||||
List<String> json8k;
|
||||
|
||||
@DbJson(length = 16 * 1024)
|
||||
List<String> json16k;
|
||||
|
||||
@DbJson(length = 32 * 1024)
|
||||
List<String> json32k;
|
||||
|
||||
@DbJson(length = 64 * 1024)
|
||||
List<String> json64k;
|
||||
|
||||
@DbJson(length = 128 * 1024)
|
||||
List<String> json128k;
|
||||
|
||||
@DbJson(length = 256 * 1024)
|
||||
List<String> json256k;
|
||||
|
||||
@DbJson(length = 512 * 1024)
|
||||
List<String> json512k;
|
||||
|
||||
@DbJson(length = 1024 * 1024)
|
||||
List<String> json1m;
|
||||
|
||||
@DbJson(length = 2 * 1024 * 1024)
|
||||
List<String> json2m;
|
||||
|
||||
@DbJson(length = 4 * 1024 * 1024)
|
||||
List<String> json4m;
|
||||
|
||||
@DbJson(length = 8 * 1024 * 1024)
|
||||
List<String> json8m;
|
||||
|
||||
@DbJson(length = 16 * 1024 * 1024)
|
||||
List<String> json16m;
|
||||
|
||||
@DbJson(length = 32 * 1024 * 1024)
|
||||
List<String> json32m;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package misc.migration.v1_1;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Lob;
|
||||
import javax.persistence.Table;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
@Entity
|
||||
@Table(name = "migtest_e_test_lob")
|
||||
public class ETestLob {
|
||||
|
||||
@Id
|
||||
int id;
|
||||
|
||||
@Size(max = 255)
|
||||
@Lob
|
||||
String lob255;
|
||||
|
||||
@Size(max = 256)
|
||||
@Lob
|
||||
String lob256;
|
||||
|
||||
@Size(max = 512)
|
||||
@Lob
|
||||
String lob512;
|
||||
|
||||
@Size(max = 1024)
|
||||
@Lob
|
||||
String lob1k;
|
||||
|
||||
@Size(max = 2 * 1024)
|
||||
@Lob
|
||||
String lob2k;
|
||||
|
||||
@Size(max = 4 * 1024)
|
||||
@Lob
|
||||
String lob4k;
|
||||
|
||||
@Size(max = 8 * 1024)
|
||||
@Lob
|
||||
String lob8k;
|
||||
|
||||
@Size(max = 16 * 1024)
|
||||
@Lob
|
||||
String lob16k;
|
||||
|
||||
@Size(max = 32 * 1024)
|
||||
@Lob
|
||||
String lob32k;
|
||||
|
||||
@Size(max = 64 * 1024)
|
||||
@Lob
|
||||
String lob64k;
|
||||
|
||||
@Size(max = 128 * 1024)
|
||||
@Lob
|
||||
String lob128k;
|
||||
|
||||
@Size(max = 256 * 1024)
|
||||
@Lob
|
||||
String lob256k;
|
||||
|
||||
@Size(max = 512 * 1024)
|
||||
@Lob
|
||||
String lob512k;
|
||||
|
||||
@Size(max = 1024 * 1024)
|
||||
@Lob
|
||||
String lob1m;
|
||||
|
||||
@Size(max = 2 * 1024 * 1024)
|
||||
@Lob
|
||||
String lob2m;
|
||||
|
||||
@Size(max = 4 * 1024 * 1024)
|
||||
@Lob
|
||||
String lob4m;
|
||||
|
||||
@Size(max = 8 * 1024 * 1024)
|
||||
@Lob
|
||||
String lob8m;
|
||||
|
||||
@Size(max = 16 * 1024 * 1024)
|
||||
@Lob
|
||||
String lob16m;
|
||||
|
||||
@Size(max = 32 * 1024 * 1024)
|
||||
@Lob
|
||||
String lob32m;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package misc.migration.v1_1;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
@Entity
|
||||
@Table(name = "migtest_e_test_varchar")
|
||||
public class ETestVarchar {
|
||||
|
||||
@Id
|
||||
int id;
|
||||
|
||||
@Size(max = 255)
|
||||
String varchar255;
|
||||
|
||||
@Size(max = 256)
|
||||
String varchar256;
|
||||
|
||||
@Size(max = 512)
|
||||
String varchar512;
|
||||
|
||||
@Size(max = 1024)
|
||||
String varchar1k;
|
||||
|
||||
@Size(max = 2 * 1024)
|
||||
String varchar2k;
|
||||
|
||||
@Size(max = 4 * 1024)
|
||||
String varchar4k;
|
||||
|
||||
// Override definition for MariaDB
|
||||
@Column(columnDefinition = "mariadb,mysql;varchar(8193);")
|
||||
@Size(max = 8 * 1024)
|
||||
String varchar8k;
|
||||
|
||||
@Size(max = 16 * 1024)
|
||||
String varchar16k;
|
||||
|
||||
@Size(max = 32 * 1024)
|
||||
String varchar32k;
|
||||
|
||||
@Size(max = 64 * 1024)
|
||||
String varchar64k;
|
||||
|
||||
@Size(max = 128 * 1024)
|
||||
String varchar128k;
|
||||
|
||||
@Size(max = 256 * 1024)
|
||||
String varchar256k;
|
||||
|
||||
@Size(max = 512 * 1024)
|
||||
String varchar512k;
|
||||
|
||||
@Size(max = 1024 * 1024)
|
||||
String varchar1m;
|
||||
|
||||
@Size(max = 2 * 1024 * 1024)
|
||||
String varchar2m;
|
||||
|
||||
@Size(max = 4 * 1024 * 1024)
|
||||
String varchar4m;
|
||||
|
||||
@Size(max = 8 * 1024 * 1024)
|
||||
String varchar8m;
|
||||
|
||||
@Size(max = 16 * 1024 * 1024)
|
||||
String varchar16m;
|
||||
|
||||
@Size(max = 32 * 1024 * 1024)
|
||||
String varchar32m;
|
||||
|
||||
}
|
||||
@@ -11,6 +11,10 @@ import java.util.List;
|
||||
|
||||
@Entity
|
||||
@Table(name = "migtest_e_basic")
|
||||
// Note: tablespaces are currently only supported for DB2
|
||||
// to be prepared for future (when we support sql server filegroups),
|
||||
// we allow to specify the DB-platform here
|
||||
@Tablespace(value = "db2;TSTABLES;", index = "db2;INDEXTS;")
|
||||
public class EBasic {
|
||||
|
||||
public enum Status {
|
||||
@@ -86,7 +90,7 @@ public class EBasic {
|
||||
String indextest6;
|
||||
|
||||
@NotNull
|
||||
@DbDefault("23")
|
||||
@DbDefault("23") // required for revert
|
||||
int user_id;
|
||||
|
||||
public EBasic() {
|
||||
|
||||
@@ -21,6 +21,6 @@ public class EHistory6 {
|
||||
Integer testNumber1;
|
||||
|
||||
@NotNull
|
||||
@DbDefault("7")
|
||||
@DbDefault("7") // required for revert
|
||||
Integer testNumber2;
|
||||
}
|
||||
|
||||
@@ -45,4 +45,13 @@ public class ETable {
|
||||
|
||||
@OneToMany(mappedBy = "foreign")
|
||||
List<ETable> foreigns;
|
||||
|
||||
// @NotNull
|
||||
// @DbDefault("")
|
||||
// private String textfield;
|
||||
// FIXME: MariaDb produces an invalid quoted statement. We would need to fix quotes here.
|
||||
// but using reserved names for tables is a bad idea IMHO
|
||||
// actual: update "table" set textfield = '' where textfield is null;
|
||||
// expected: update `table` set textfield = '' where textfield is null;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
package org.tests.m2m;
|
||||
|
||||
import io.ebean.xtest.BaseTestCase;
|
||||
import io.ebean.DB;
|
||||
import io.ebean.xtest.BaseTestCase;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.tests.model.basic.MRole;
|
||||
import org.tests.model.basic.MUser;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
@@ -52,4 +53,27 @@ public class TestM2MModifyTest extends BaseTestCase {
|
||||
roles = u0.getRoles();
|
||||
assertThat(roles).hasSize(1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test1() {
|
||||
List<MRole> roles = new ArrayList<>();
|
||||
for (int i = 0; i < 56; i++) {
|
||||
MRole r0 = new MRole("mrole" + i);
|
||||
roles.add(r0);
|
||||
}
|
||||
|
||||
DB.saveAll(roles);
|
||||
|
||||
MUser u0 = new MUser("usr0");
|
||||
u0.getRoles().addAll(roles);
|
||||
|
||||
DB.save(u0);
|
||||
|
||||
u0 = DB.find(MUser.class, u0.getUserid());
|
||||
|
||||
u0.getRoles().clear();
|
||||
u0.getRoles().addAll(roles);
|
||||
|
||||
DB.save(u0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,11 +4,12 @@ import io.ebean.annotation.Cache;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Index;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Cache(readOnly = true)
|
||||
@Entity
|
||||
@Table(name = "feature_desc")
|
||||
@Table(name = "feature_desc", indexes = @Index(columnList = "name, description desc"))
|
||||
public class FeatureDescription {
|
||||
|
||||
@Id
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
package org.tests.query;
|
||||
|
||||
import io.ebean.DB;
|
||||
import io.ebean.Transaction;
|
||||
import io.ebean.xtest.BaseTestCase;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.tests.m2m.softdelete.MsManyA;
|
||||
import org.tests.m2m.softdelete.MsManyB;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
public class TestQueryFindEachHeapPressure extends BaseTestCase {
|
||||
|
||||
private byte[] buffer;
|
||||
|
||||
@BeforeEach
|
||||
public void before() {
|
||||
DB.find(MsManyB.class).delete();
|
||||
DB.find(MsManyA.class).delete();
|
||||
|
||||
List<MsManyB> children = new ArrayList<>();
|
||||
for (int i = 0; i < 20; i++) {
|
||||
children.add(new MsManyB("child_" + i));
|
||||
}
|
||||
DB.saveAll(children);
|
||||
|
||||
try (Transaction txn = DB.beginTransaction()) {
|
||||
for (int i = 0; i < 100; i++) {
|
||||
MsManyA parent = new MsManyA("parent_" + i);
|
||||
|
||||
Collections.shuffle(children);
|
||||
|
||||
parent.getManybs().add(children.get(0));
|
||||
|
||||
DB.save(parent);
|
||||
}
|
||||
txn.commit();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reproduce quickly, by manually adding System.gc at the beginning of CQuery#setLazyLoadedChildBean.
|
||||
*/
|
||||
@Test
|
||||
@Disabled("Run manually with -Xmx128M")
|
||||
public void test() throws Exception {
|
||||
for (int j = 0; j < 1000; j++) {
|
||||
System.out.println("Iteration " + j);
|
||||
DB.find(MsManyA.class)
|
||||
.findEach(parent -> {
|
||||
if (Math.random() > 0.9) {
|
||||
buffer = new byte[1_000_000];
|
||||
List<MsManyB> children = parent.getManybs();
|
||||
assertThat(children.size()).isEqualTo(1);
|
||||
assertThat(buffer.length).isEqualTo(1_000_000);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -45,24 +45,6 @@ create table migtest_fk_set_null (
|
||||
one_id UInt64
|
||||
) ENGINE = Log();
|
||||
|
||||
create table drop_main (
|
||||
id UInt32
|
||||
) ENGINE = Log();
|
||||
|
||||
create table drop_main_drop_ref_many (
|
||||
drop_main_id UInt32,
|
||||
drop_ref_many_id UInt32
|
||||
) ENGINE = Log();
|
||||
|
||||
create table drop_ref_many (
|
||||
id UInt32
|
||||
) ENGINE = Log();
|
||||
|
||||
create table drop_ref_one (
|
||||
id UInt32,
|
||||
parent_id UInt32
|
||||
) ENGINE = Log();
|
||||
|
||||
create table migtest_e_basic (
|
||||
id UInt32,
|
||||
status String,
|
||||
|
||||
@@ -6,6 +6,116 @@ alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest2;
|
||||
alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest6;
|
||||
alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_status;
|
||||
-- apply changes
|
||||
create table drop_main (
|
||||
id UInt32
|
||||
) ENGINE = Log();
|
||||
|
||||
create table drop_main_drop_ref_many (
|
||||
drop_main_id UInt32,
|
||||
drop_ref_many_id UInt32
|
||||
) ENGINE = Log();
|
||||
|
||||
create table drop_ref_many (
|
||||
id UInt32
|
||||
) ENGINE = Log();
|
||||
|
||||
create table drop_ref_one (
|
||||
id UInt32,
|
||||
parent_id UInt32
|
||||
) ENGINE = Log();
|
||||
|
||||
create table migtest_e_test_binary (
|
||||
id UInt32,
|
||||
test_byte16 String,
|
||||
test_byte256 String,
|
||||
test_byte512 String,
|
||||
test_byte1k String,
|
||||
test_byte2k String,
|
||||
test_byte4k String,
|
||||
test_byte8k String,
|
||||
test_byte16k String,
|
||||
test_byte32k String,
|
||||
test_byte64k String,
|
||||
test_byte128k String,
|
||||
test_byte256k String,
|
||||
test_byte512k String,
|
||||
test_byte1m String,
|
||||
test_byte2m String,
|
||||
test_byte4m String,
|
||||
test_byte8m String,
|
||||
test_byte16m String,
|
||||
test_byte32m String
|
||||
) ENGINE = Log();
|
||||
|
||||
create table migtest_e_test_json (
|
||||
id UInt32,
|
||||
json255 String,
|
||||
json256 String,
|
||||
json512 String,
|
||||
json1k String,
|
||||
json2k String,
|
||||
json4k String,
|
||||
json8k String,
|
||||
json16k String,
|
||||
json32k String,
|
||||
json64k String,
|
||||
json128k String,
|
||||
json256k String,
|
||||
json512k String,
|
||||
json1m String,
|
||||
json2m String,
|
||||
json4m String,
|
||||
json8m String,
|
||||
json16m String,
|
||||
json32m String
|
||||
) ENGINE = Log();
|
||||
|
||||
create table migtest_e_test_lob (
|
||||
id UInt32,
|
||||
lob255 String,
|
||||
lob256 String,
|
||||
lob512 String,
|
||||
lob1k String,
|
||||
lob2k String,
|
||||
lob4k String,
|
||||
lob8k String,
|
||||
lob16k String,
|
||||
lob32k String,
|
||||
lob64k String,
|
||||
lob128k String,
|
||||
lob256k String,
|
||||
lob512k String,
|
||||
lob1m String,
|
||||
lob2m String,
|
||||
lob4m String,
|
||||
lob8m String,
|
||||
lob16m String,
|
||||
lob32m String
|
||||
) ENGINE = Log();
|
||||
|
||||
create table migtest_e_test_varchar (
|
||||
id UInt32,
|
||||
varchar255 String,
|
||||
varchar256 String,
|
||||
varchar512 String,
|
||||
varchar1k String,
|
||||
varchar2k String,
|
||||
varchar4k String,
|
||||
varchar8k String,
|
||||
varchar16k String,
|
||||
varchar32k String,
|
||||
varchar64k String,
|
||||
varchar128k String,
|
||||
varchar256k String,
|
||||
varchar512k String,
|
||||
varchar1m String,
|
||||
varchar2m String,
|
||||
varchar4m String,
|
||||
varchar8m String,
|
||||
varchar16m String,
|
||||
varchar32m String
|
||||
) ENGINE = Log();
|
||||
|
||||
create table migtest_e_user (
|
||||
id UInt32
|
||||
) ENGINE = Log();
|
||||
|
||||
-4
@@ -7,9 +7,5 @@ alter table migtest_e_basic drop column eref_id;
|
||||
alter table migtest_e_history2 drop column obsolete_string1;
|
||||
alter table migtest_e_history2 drop column obsolete_string2;
|
||||
-- apply post alter
|
||||
drop table if exists drop_main;
|
||||
drop table if exists drop_main_drop_ref_many;
|
||||
drop table if exists drop_ref_many;
|
||||
drop table if exists drop_ref_one;
|
||||
drop table if exists "migtest_QuOtEd";
|
||||
drop table if exists migtest_e_ref;
|
||||
|
||||
+8
@@ -17,6 +17,14 @@ alter table migtest_e_history5 drop column test_boolean;
|
||||
alter table migtest_e_softdelete drop column deleted;
|
||||
alter table migtest_oto_child drop column master_id;
|
||||
-- apply post alter
|
||||
drop table if exists drop_main;
|
||||
drop table if exists drop_main_drop_ref_many;
|
||||
drop table if exists drop_ref_many;
|
||||
drop table if exists drop_ref_one;
|
||||
drop table if exists migtest_e_test_binary;
|
||||
drop table if exists migtest_e_test_json;
|
||||
drop table if exists migtest_e_test_lob;
|
||||
drop table if exists migtest_e_test_varchar;
|
||||
drop table if exists migtest_e_user;
|
||||
drop table if exists migtest_mtm_c_migtest_mtm_m;
|
||||
drop table if exists migtest_mtm_m_migtest_mtm_c;
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
1672735407, 1.0__initial.sql
|
||||
540706946, 1.1.sql
|
||||
-875723380, 1.2__dropsFor_1.1.sql
|
||||
193400547, 1.0__initial.sql
|
||||
1036221356, 1.1.sql
|
||||
688811494, 1.2__dropsFor_1.1.sql
|
||||
1015552567, 1.3.sql
|
||||
255653518, 1.4__dropsFor_1.3.sql
|
||||
-252580551, 1.4__dropsFor_1.3.sql
|
||||
|
||||
|
||||
@@ -54,28 +54,6 @@ create table migtest_fk_set_null (
|
||||
constraint pk_migtest_fk_set_null primary key (id)
|
||||
);
|
||||
|
||||
create table drop_main (
|
||||
id integer generated by default as identity not null,
|
||||
constraint pk_drop_main primary key (id)
|
||||
);
|
||||
|
||||
create table drop_main_drop_ref_many (
|
||||
drop_main_id integer not null,
|
||||
drop_ref_many_id integer not null,
|
||||
constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id)
|
||||
);
|
||||
|
||||
create table drop_ref_many (
|
||||
id integer generated by default as identity not null,
|
||||
constraint pk_drop_ref_many primary key (id)
|
||||
);
|
||||
|
||||
create table drop_ref_one (
|
||||
id integer generated by default as identity not null,
|
||||
parent_id integer,
|
||||
constraint pk_drop_ref_one primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_basic (
|
||||
id integer generated by default as identity not null,
|
||||
status varchar(1),
|
||||
@@ -215,15 +193,6 @@ alter table migtest_fk_cascade add constraint fk_migtest_fk_cascade_one_id forei
|
||||
create index ix_migtest_fk_set_null_one_id on migtest_fk_set_null (one_id);
|
||||
alter table migtest_fk_set_null add constraint fk_migtest_fk_set_null_one_id foreign key (one_id) references migtest_fk_one (id) on delete set null on update restrict;
|
||||
|
||||
create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id);
|
||||
alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id);
|
||||
alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id);
|
||||
alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_migtest_e_basic_eref_id on migtest_e_basic (eref_id);
|
||||
alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign key (eref_id) references migtest_e_ref (id) on delete restrict on update restrict;
|
||||
|
||||
|
||||
@@ -7,13 +7,128 @@ alter table migtest_e_basic drop constraint if exists ck_migtest_e_basic_status2
|
||||
drop index uq_migtest_e_basic_indextest2 cascade;
|
||||
drop index uq_migtest_e_basic_indextest6 cascade;
|
||||
alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_status;
|
||||
alter table if exists drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_main;
|
||||
alter table if exists drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_ref_many;
|
||||
alter table if exists drop_ref_one drop constraint if exists fk_drop_ref_one_parent_id;
|
||||
drop index if exists ix_migtest_e_basic_indextest1;
|
||||
drop index if exists ix_migtest_e_basic_indextest5;
|
||||
drop index if exists ix_migtest_quoted_status1;
|
||||
-- apply changes
|
||||
create table drop_main (
|
||||
id integer generated by default as identity not null,
|
||||
constraint pk_drop_main primary key (id)
|
||||
);
|
||||
|
||||
create table drop_main_drop_ref_many (
|
||||
drop_main_id integer not null,
|
||||
drop_ref_many_id integer not null,
|
||||
constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id)
|
||||
);
|
||||
|
||||
create table drop_ref_many (
|
||||
id integer generated by default as identity not null,
|
||||
constraint pk_drop_ref_many primary key (id)
|
||||
);
|
||||
|
||||
create table drop_ref_one (
|
||||
id integer generated by default as identity not null,
|
||||
parent_id integer,
|
||||
constraint pk_drop_ref_one primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_test_binary (
|
||||
id integer generated by default as identity not null,
|
||||
test_byte16 bytea,
|
||||
test_byte256 bytea,
|
||||
test_byte512 bytea,
|
||||
test_byte1k bytea,
|
||||
test_byte2k bytea,
|
||||
test_byte4k bytea,
|
||||
test_byte8k bytea,
|
||||
test_byte16k bytea,
|
||||
test_byte32k bytea,
|
||||
test_byte64k bytea,
|
||||
test_byte128k bytea,
|
||||
test_byte256k bytea,
|
||||
test_byte512k bytea,
|
||||
test_byte1m bytea,
|
||||
test_byte2m bytea,
|
||||
test_byte4m bytea,
|
||||
test_byte8m bytea,
|
||||
test_byte16m bytea,
|
||||
test_byte32m bytea,
|
||||
constraint pk_migtest_e_test_binary primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_test_json (
|
||||
id integer generated by default as identity not null,
|
||||
json255 json,
|
||||
json256 json,
|
||||
json512 json,
|
||||
json1k json,
|
||||
json2k json,
|
||||
json4k json,
|
||||
json8k json,
|
||||
json16k json,
|
||||
json32k json,
|
||||
json64k json,
|
||||
json128k json,
|
||||
json256k json,
|
||||
json512k json,
|
||||
json1m json,
|
||||
json2m json,
|
||||
json4m json,
|
||||
json8m json,
|
||||
json16m json,
|
||||
json32m json,
|
||||
constraint pk_migtest_e_test_json primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_test_lob (
|
||||
id integer generated by default as identity not null,
|
||||
lob255 text,
|
||||
lob256 text,
|
||||
lob512 text,
|
||||
lob1k text,
|
||||
lob2k text,
|
||||
lob4k text,
|
||||
lob8k text,
|
||||
lob16k text,
|
||||
lob32k text,
|
||||
lob64k text,
|
||||
lob128k text,
|
||||
lob256k text,
|
||||
lob512k text,
|
||||
lob1m text,
|
||||
lob2m text,
|
||||
lob4m text,
|
||||
lob8m text,
|
||||
lob16m text,
|
||||
lob32m text,
|
||||
constraint pk_migtest_e_test_lob primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_test_varchar (
|
||||
id integer generated by default as identity not null,
|
||||
varchar255 varchar(255),
|
||||
varchar256 varchar(256),
|
||||
varchar512 varchar(512),
|
||||
varchar1k varchar(1024),
|
||||
varchar2k varchar(2048),
|
||||
varchar4k varchar(4096),
|
||||
varchar8k varchar(8192),
|
||||
varchar16k varchar(16384),
|
||||
varchar32k varchar(32768),
|
||||
varchar64k varchar(65536),
|
||||
varchar128k varchar(131072),
|
||||
varchar256k varchar(262144),
|
||||
varchar512k varchar(524288),
|
||||
varchar1m varchar(1048576),
|
||||
varchar2m varchar(2097152),
|
||||
varchar4m varchar(4194304),
|
||||
varchar8m varchar(8388608),
|
||||
varchar16m text,
|
||||
varchar32m text,
|
||||
constraint pk_migtest_e_test_varchar primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_user (
|
||||
id integer generated by default as identity not null,
|
||||
constraint pk_migtest_e_user primary key (id)
|
||||
@@ -93,6 +208,15 @@ alter table migtest_e_basic add constraint uq_migtest_e_basic_indextest4 unique
|
||||
alter table migtest_e_basic add constraint uq_migtest_e_basic_indextest5 unique (indextest5);
|
||||
alter table "table" add constraint uq_table_select unique ("select");
|
||||
-- foreign keys and indices
|
||||
create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id);
|
||||
alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id);
|
||||
alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id);
|
||||
alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id);
|
||||
alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict;
|
||||
|
||||
|
||||
-7
@@ -7,13 +7,6 @@ alter table migtest_e_basic drop column eref_id;
|
||||
alter table migtest_e_history2 drop column obsolete_string1;
|
||||
alter table migtest_e_history2 drop column obsolete_string2;
|
||||
-- apply post alter
|
||||
drop table if exists drop_main cascade;
|
||||
drop sequence if exists drop_main_seq;
|
||||
drop table if exists drop_main_drop_ref_many cascade;
|
||||
drop table if exists drop_ref_many cascade;
|
||||
drop sequence if exists drop_ref_many_seq;
|
||||
drop table if exists drop_ref_one cascade;
|
||||
drop sequence if exists drop_ref_one_seq;
|
||||
drop table if exists "migtest_QuOtEd" cascade;
|
||||
drop table if exists migtest_e_ref cascade;
|
||||
drop sequence if exists migtest_e_ref_seq;
|
||||
|
||||
@@ -14,6 +14,9 @@ drop index uq_migtest_e_basic_name cascade;
|
||||
drop index uq_migtest_e_basic_indextest4 cascade;
|
||||
drop index uq_migtest_e_basic_indextest5 cascade;
|
||||
alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_status;
|
||||
alter table if exists drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_main;
|
||||
alter table if exists drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_ref_many;
|
||||
alter table if exists drop_ref_one drop constraint if exists fk_drop_ref_one_parent_id;
|
||||
alter table if exists migtest_mtm_c_migtest_mtm_m drop constraint if exists fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c;
|
||||
alter table if exists migtest_mtm_c_migtest_mtm_m drop constraint if exists fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_m;
|
||||
alter table if exists migtest_mtm_m_migtest_mtm_c drop constraint if exists fk_migtest_mtm_m_migtest_mtm_c_migtest_mtm_m;
|
||||
|
||||
+15
@@ -17,6 +17,21 @@ alter table migtest_e_history5 drop column test_boolean;
|
||||
alter table migtest_e_softdelete drop column deleted;
|
||||
alter table migtest_oto_child drop column master_id;
|
||||
-- apply post alter
|
||||
drop table if exists drop_main cascade;
|
||||
drop sequence if exists drop_main_seq;
|
||||
drop table if exists drop_main_drop_ref_many cascade;
|
||||
drop table if exists drop_ref_many cascade;
|
||||
drop sequence if exists drop_ref_many_seq;
|
||||
drop table if exists drop_ref_one cascade;
|
||||
drop sequence if exists drop_ref_one_seq;
|
||||
drop table if exists migtest_e_test_binary cascade;
|
||||
drop sequence if exists migtest_e_test_binary_seq;
|
||||
drop table if exists migtest_e_test_json cascade;
|
||||
drop sequence if exists migtest_e_test_json_seq;
|
||||
drop table if exists migtest_e_test_lob cascade;
|
||||
drop sequence if exists migtest_e_test_lob_seq;
|
||||
drop table if exists migtest_e_test_varchar cascade;
|
||||
drop sequence if exists migtest_e_test_varchar_seq;
|
||||
drop table if exists migtest_e_user cascade;
|
||||
drop sequence if exists migtest_e_user_seq;
|
||||
drop table if exists migtest_mtm_c_migtest_mtm_m cascade;
|
||||
|
||||
+5
-5
@@ -1,7 +1,7 @@
|
||||
1867456246, 1.0__initial.sql
|
||||
-412570267, 1.1.sql
|
||||
395394572, 1.2__dropsFor_1.1.sql
|
||||
-861259583, 1.3.sql
|
||||
-971909974, 1.4__dropsFor_1.3.sql
|
||||
1434934404, 1.0__initial.sql
|
||||
-1445091875, 1.1.sql
|
||||
856096334, 1.2__dropsFor_1.1.sql
|
||||
-279468991, 1.3.sql
|
||||
-1398154763, 1.4__dropsFor_1.3.sql
|
||||
561281075, R__order_views.sql
|
||||
|
||||
|
||||
@@ -54,28 +54,6 @@ create table migtest_fk_set_null (
|
||||
constraint pk_migtest_fk_set_null primary key (id)
|
||||
);
|
||||
|
||||
create table drop_main (
|
||||
id integer generated by default as identity not null,
|
||||
constraint pk_drop_main primary key (id)
|
||||
);
|
||||
|
||||
create table drop_main_drop_ref_many (
|
||||
drop_main_id integer not null,
|
||||
drop_ref_many_id integer not null,
|
||||
constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id)
|
||||
);
|
||||
|
||||
create table drop_ref_many (
|
||||
id integer generated by default as identity not null,
|
||||
constraint pk_drop_ref_many primary key (id)
|
||||
);
|
||||
|
||||
create table drop_ref_one (
|
||||
id integer generated by default as identity not null,
|
||||
parent_id integer,
|
||||
constraint pk_drop_ref_one primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_basic (
|
||||
id integer generated by default as identity not null,
|
||||
status varchar(1),
|
||||
@@ -254,15 +232,6 @@ alter table migtest_fk_cascade add constraint fk_migtest_fk_cascade_one_id forei
|
||||
create index ix_migtest_fk_set_null_one_id on migtest_fk_set_null (one_id);
|
||||
alter table migtest_fk_set_null add constraint fk_migtest_fk_set_null_one_id foreign key (one_id) references migtest_fk_one (id) on delete set null on update restrict;
|
||||
|
||||
create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id);
|
||||
alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id);
|
||||
alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id);
|
||||
alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_migtest_e_basic_eref_id on migtest_e_basic (eref_id);
|
||||
alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign key (eref_id) references migtest_e_ref (id) on delete restrict on update restrict;
|
||||
|
||||
|
||||
@@ -65,27 +65,6 @@ end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_DROP_MAIN_DROP_REF_MANY_DROP_MAIN' and ucase(tabname) = 'DROP_MAIN_DROP_REF_MANY') then
|
||||
prepare stmt from 'alter table drop_main_drop_ref_many drop constraint fk_drop_main_drop_ref_many_drop_main';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_DROP_MAIN_DROP_REF_MANY_DROP_REF_MANY' and ucase(tabname) = 'DROP_MAIN_DROP_REF_MANY') then
|
||||
prepare stmt from 'alter table drop_main_drop_ref_many drop constraint fk_drop_main_drop_ref_many_drop_ref_many';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_DROP_REF_ONE_PARENT_ID' and ucase(tabname) = 'DROP_REF_ONE') then
|
||||
prepare stmt from 'alter table drop_ref_one drop constraint fk_drop_ref_one_parent_id';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MIGTEST_E_BASIC_INDEXTEST1') then
|
||||
prepare stmt from 'drop index ix_migtest_e_basic_indextest1';
|
||||
execute stmt;
|
||||
@@ -106,6 +85,124 @@ if exists (select indname from syscat.indexes where indschema = current_schema a
|
||||
end if;
|
||||
end$$;
|
||||
-- apply changes
|
||||
create table drop_main (
|
||||
id integer generated by default as identity not null,
|
||||
constraint pk_drop_main primary key (id)
|
||||
);
|
||||
|
||||
create table drop_main_drop_ref_many (
|
||||
drop_main_id integer not null,
|
||||
drop_ref_many_id integer not null,
|
||||
constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id)
|
||||
);
|
||||
|
||||
create table drop_ref_many (
|
||||
id integer generated by default as identity not null,
|
||||
constraint pk_drop_ref_many primary key (id)
|
||||
);
|
||||
|
||||
create table drop_ref_one (
|
||||
id integer generated by default as identity not null,
|
||||
parent_id integer,
|
||||
constraint pk_drop_ref_one primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_test_binary (
|
||||
id integer generated by default as identity not null,
|
||||
test_byte16 varbinary(16),
|
||||
test_byte256 varbinary(256),
|
||||
test_byte512 varbinary(512),
|
||||
test_byte1k varbinary(1024),
|
||||
test_byte2k varbinary(2048),
|
||||
test_byte4k varbinary(4096),
|
||||
test_byte8k blob(8192),
|
||||
test_byte16k blob(16384),
|
||||
test_byte32k blob(32768),
|
||||
test_byte64k blob(65536),
|
||||
test_byte128k blob(131072),
|
||||
test_byte256k blob(262144),
|
||||
test_byte512k blob(524288),
|
||||
test_byte1m blob(1048576),
|
||||
test_byte2m blob(2097152),
|
||||
test_byte4m blob(4194304),
|
||||
test_byte8m blob(8388608),
|
||||
test_byte16m blob(16777216),
|
||||
test_byte32m blob(33554432),
|
||||
constraint pk_migtest_e_test_binary primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_test_json (
|
||||
id integer generated by default as identity not null,
|
||||
json255 varchar(255),
|
||||
json256 varchar(256),
|
||||
json512 varchar(512),
|
||||
json1k varchar(1024),
|
||||
json2k varchar(2048),
|
||||
json4k clob(4096),
|
||||
json8k clob(8192),
|
||||
json16k clob(16384),
|
||||
json32k clob(32768),
|
||||
json64k clob(65536),
|
||||
json128k clob(131072),
|
||||
json256k clob(262144),
|
||||
json512k clob(524288),
|
||||
json1m clob(1048576),
|
||||
json2m clob(2097152),
|
||||
json4m clob(4194304),
|
||||
json8m clob(8388608),
|
||||
json16m clob(16777216),
|
||||
json32m clob(33554432),
|
||||
constraint pk_migtest_e_test_json primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_test_lob (
|
||||
id integer generated by default as identity not null,
|
||||
lob255 clob,
|
||||
lob256 clob,
|
||||
lob512 clob,
|
||||
lob1k clob,
|
||||
lob2k clob,
|
||||
lob4k clob,
|
||||
lob8k clob,
|
||||
lob16k clob,
|
||||
lob32k clob,
|
||||
lob64k clob,
|
||||
lob128k clob,
|
||||
lob256k clob,
|
||||
lob512k clob,
|
||||
lob1m clob,
|
||||
lob2m clob,
|
||||
lob4m clob,
|
||||
lob8m clob,
|
||||
lob16m clob,
|
||||
lob32m clob,
|
||||
constraint pk_migtest_e_test_lob primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_test_varchar (
|
||||
id integer generated by default as identity not null,
|
||||
varchar255 varchar(255),
|
||||
varchar256 varchar(256),
|
||||
varchar512 varchar(512),
|
||||
varchar1k varchar(1024),
|
||||
varchar2k varchar(2048),
|
||||
varchar4k clob(4096),
|
||||
varchar8k clob(8192),
|
||||
varchar16k clob(16384),
|
||||
varchar32k clob(32768),
|
||||
varchar64k clob(65536),
|
||||
varchar128k clob(131072),
|
||||
varchar256k clob(262144),
|
||||
varchar512k clob(524288),
|
||||
varchar1m clob(1048576),
|
||||
varchar2m clob(2097152),
|
||||
varchar4m clob(4194304),
|
||||
varchar8m clob(8388608),
|
||||
varchar16m clob(16777216),
|
||||
varchar32m clob(33554432),
|
||||
constraint pk_migtest_e_test_varchar primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_user (
|
||||
id integer generated by default as identity not null,
|
||||
constraint pk_migtest_e_user primary key (id)
|
||||
@@ -231,6 +328,15 @@ comment on column "table"."index" is 'this is an other comment';
|
||||
alter table "table" add versioning use history table table_history;
|
||||
create unique index uq_table_select on "table"("select") exclude null keys;
|
||||
-- foreign keys and indices
|
||||
create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id);
|
||||
alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id);
|
||||
alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id);
|
||||
alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id);
|
||||
alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict;
|
||||
|
||||
|
||||
@@ -15,31 +15,6 @@ alter table migtest_e_history2_history drop column obsolete_string2;
|
||||
call sysproc.admin_cmd('reorg table migtest_e_history2_history');
|
||||
-- apply post alter
|
||||
alter table migtest_e_history2 add versioning use history table migtest_e_history2_history;
|
||||
drop table drop_main;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'DROP_MAIN_SEQ') then
|
||||
prepare stmt from 'drop sequence drop_main_seq';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
drop table drop_main_drop_ref_many;
|
||||
drop table drop_ref_many;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'DROP_REF_MANY_SEQ') then
|
||||
prepare stmt from 'drop sequence drop_ref_many_seq';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
drop table drop_ref_one;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'DROP_REF_ONE_SEQ') then
|
||||
prepare stmt from 'drop sequence drop_ref_one_seq';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
drop table "migtest_QuOtEd";
|
||||
drop table migtest_e_ref;
|
||||
delimiter $$
|
||||
|
||||
@@ -135,6 +135,27 @@ end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_DROP_MAIN_DROP_REF_MANY_DROP_MAIN' and ucase(tabname) = 'DROP_MAIN_DROP_REF_MANY') then
|
||||
prepare stmt from 'alter table drop_main_drop_ref_many drop constraint fk_drop_main_drop_ref_many_drop_main';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_DROP_MAIN_DROP_REF_MANY_DROP_REF_MANY' and ucase(tabname) = 'DROP_MAIN_DROP_REF_MANY') then
|
||||
prepare stmt from 'alter table drop_main_drop_ref_many drop constraint fk_drop_main_drop_ref_many_drop_ref_many';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_DROP_REF_ONE_PARENT_ID' and ucase(tabname) = 'DROP_REF_ONE') then
|
||||
prepare stmt from 'alter table drop_ref_one drop constraint fk_drop_ref_one_parent_id';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_MTM_C_MIGTEST_MTM_M_MIGTEST_MTM_C' and ucase(tabname) = 'MIGTEST_MTM_C_MIGTEST_MTM_M') then
|
||||
prepare stmt from 'alter table migtest_mtm_c_migtest_mtm_m drop constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c';
|
||||
execute stmt;
|
||||
@@ -211,6 +232,7 @@ update migtest_e_basic set status2 = 'N' where status2 is null;
|
||||
update migtest_e_basic set a_lob = 'X' where a_lob is null;
|
||||
|
||||
update migtest_e_basic set user_id = 23 where user_id is null;
|
||||
CALL SYSPROC.ADMIN_MOVE_TABLE(CURRENT_SCHEMA,'MIGTEST_E_BASIC','TSTABLES','INDEXTS','TSTABLES','','','','','','MOVE');
|
||||
alter table migtest_e_history2 drop versioning;
|
||||
alter table migtest_e_history3 drop versioning;
|
||||
alter table migtest_e_history4 drop versioning;
|
||||
|
||||
@@ -48,6 +48,63 @@ drop table migtest_e_history_history;
|
||||
alter table migtest_e_history2 add versioning use history table migtest_e_history2_history;
|
||||
alter table migtest_e_history5 add versioning use history table migtest_e_history5_history;
|
||||
alter table "table" add versioning use history table table_history;
|
||||
drop table drop_main;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'DROP_MAIN_SEQ') then
|
||||
prepare stmt from 'drop sequence drop_main_seq';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
drop table drop_main_drop_ref_many;
|
||||
drop table drop_ref_many;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'DROP_REF_MANY_SEQ') then
|
||||
prepare stmt from 'drop sequence drop_ref_many_seq';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
drop table drop_ref_one;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'DROP_REF_ONE_SEQ') then
|
||||
prepare stmt from 'drop sequence drop_ref_one_seq';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
drop table migtest_e_test_binary;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'MIGTEST_E_TEST_BINARY_SEQ') then
|
||||
prepare stmt from 'drop sequence migtest_e_test_binary_seq';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
drop table migtest_e_test_json;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'MIGTEST_E_TEST_JSON_SEQ') then
|
||||
prepare stmt from 'drop sequence migtest_e_test_json_seq';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
drop table migtest_e_test_lob;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'MIGTEST_E_TEST_LOB_SEQ') then
|
||||
prepare stmt from 'drop sequence migtest_e_test_lob_seq';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
drop table migtest_e_test_varchar;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'MIGTEST_E_TEST_VARCHAR_SEQ') then
|
||||
prepare stmt from 'drop sequence migtest_e_test_varchar_seq';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
drop table migtest_e_user;
|
||||
delimiter $$
|
||||
begin
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
-283216660, 1.0__initial.sql
|
||||
1120848440, 1.1.sql
|
||||
135256939, 1.2__dropsFor_1.1.sql
|
||||
-2139056187, 1.3.sql
|
||||
946163478, 1.4__dropsFor_1.3.sql
|
||||
-1467839063, 1.0__initial.sql
|
||||
1392865974, 1.1.sql
|
||||
-1187336846, 1.2__dropsFor_1.1.sql
|
||||
-1811865535, 1.3.sql
|
||||
1864105401, 1.4__dropsFor_1.3.sql
|
||||
561281075, R__order_views.sql
|
||||
|
||||
|
||||
@@ -54,28 +54,6 @@ create table migtest_fk_set_null (
|
||||
constraint pk_migtest_fk_set_null primary key (id)
|
||||
);
|
||||
|
||||
create table drop_main (
|
||||
id integer auto_increment not null,
|
||||
constraint pk_drop_main primary key (id)
|
||||
);
|
||||
|
||||
create table drop_main_drop_ref_many (
|
||||
drop_main_id integer not null,
|
||||
drop_ref_many_id integer not null,
|
||||
constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id)
|
||||
);
|
||||
|
||||
create table drop_ref_many (
|
||||
id integer auto_increment not null,
|
||||
constraint pk_drop_ref_many primary key (id)
|
||||
);
|
||||
|
||||
create table drop_ref_one (
|
||||
id integer auto_increment not null,
|
||||
parent_id integer,
|
||||
constraint pk_drop_ref_one primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_basic (
|
||||
id integer auto_increment not null,
|
||||
status varchar(1),
|
||||
@@ -216,15 +194,6 @@ alter table migtest_fk_cascade add constraint fk_migtest_fk_cascade_one_id forei
|
||||
create index ix_migtest_fk_set_null_one_id on migtest_fk_set_null (one_id);
|
||||
alter table migtest_fk_set_null add constraint fk_migtest_fk_set_null_one_id foreign key (one_id) references migtest_fk_one (id) on delete set null on update restrict;
|
||||
|
||||
create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id);
|
||||
alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id);
|
||||
alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id);
|
||||
alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_migtest_e_basic_eref_id on migtest_e_basic (eref_id);
|
||||
alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign key (eref_id) references migtest_e_ref (id) on delete restrict on update restrict;
|
||||
|
||||
|
||||
@@ -7,13 +7,128 @@ alter table migtest_e_basic drop constraint if exists ck_migtest_e_basic_status2
|
||||
alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest2;
|
||||
alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest6;
|
||||
alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_status;
|
||||
alter table drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_main;
|
||||
alter table drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_ref_many;
|
||||
alter table drop_ref_one drop constraint if exists fk_drop_ref_one_parent_id;
|
||||
drop index if exists ix_migtest_e_basic_indextest1;
|
||||
drop index if exists ix_migtest_e_basic_indextest5;
|
||||
drop index if exists ix_migtest_quoted_status1;
|
||||
-- apply changes
|
||||
create table drop_main (
|
||||
id integer auto_increment not null,
|
||||
constraint pk_drop_main primary key (id)
|
||||
);
|
||||
|
||||
create table drop_main_drop_ref_many (
|
||||
drop_main_id integer not null,
|
||||
drop_ref_many_id integer not null,
|
||||
constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id)
|
||||
);
|
||||
|
||||
create table drop_ref_many (
|
||||
id integer auto_increment not null,
|
||||
constraint pk_drop_ref_many primary key (id)
|
||||
);
|
||||
|
||||
create table drop_ref_one (
|
||||
id integer auto_increment not null,
|
||||
parent_id integer,
|
||||
constraint pk_drop_ref_one primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_test_binary (
|
||||
id integer auto_increment not null,
|
||||
test_byte16 varbinary(16),
|
||||
test_byte256 varbinary(256),
|
||||
test_byte512 varbinary(512),
|
||||
test_byte1k varbinary(1024),
|
||||
test_byte2k varbinary(2048),
|
||||
test_byte4k varbinary(4096),
|
||||
test_byte8k varbinary(8192),
|
||||
test_byte16k varbinary(16384),
|
||||
test_byte32k varbinary(32768),
|
||||
test_byte64k varbinary(65536),
|
||||
test_byte128k varbinary(131072),
|
||||
test_byte256k varbinary(262144),
|
||||
test_byte512k varbinary(524288),
|
||||
test_byte1m varbinary(1048576),
|
||||
test_byte2m varbinary(2097152),
|
||||
test_byte4m varbinary(4194304),
|
||||
test_byte8m varbinary(8388608),
|
||||
test_byte16m varbinary(16777216),
|
||||
test_byte32m varbinary(33554432),
|
||||
constraint pk_migtest_e_test_binary primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_test_json (
|
||||
id integer auto_increment not null,
|
||||
json255 varchar(255),
|
||||
json256 varchar(256),
|
||||
json512 varchar(512),
|
||||
json1k varchar(1024),
|
||||
json2k varchar(2048),
|
||||
json4k varchar(4096),
|
||||
json8k varchar(8192),
|
||||
json16k varchar(16384),
|
||||
json32k varchar(32768),
|
||||
json64k varchar(65536),
|
||||
json128k varchar(131072),
|
||||
json256k varchar(262144),
|
||||
json512k varchar(524288),
|
||||
json1m varchar(1048576),
|
||||
json2m varchar(2097152),
|
||||
json4m varchar(4194304),
|
||||
json8m varchar(8388608),
|
||||
json16m varchar(16777216),
|
||||
json32m varchar(33554432),
|
||||
constraint pk_migtest_e_test_json primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_test_lob (
|
||||
id integer auto_increment not null,
|
||||
lob255 clob,
|
||||
lob256 clob,
|
||||
lob512 clob,
|
||||
lob1k clob,
|
||||
lob2k clob,
|
||||
lob4k clob,
|
||||
lob8k clob,
|
||||
lob16k clob,
|
||||
lob32k clob,
|
||||
lob64k clob,
|
||||
lob128k clob,
|
||||
lob256k clob,
|
||||
lob512k clob,
|
||||
lob1m clob,
|
||||
lob2m clob,
|
||||
lob4m clob,
|
||||
lob8m clob,
|
||||
lob16m clob,
|
||||
lob32m clob,
|
||||
constraint pk_migtest_e_test_lob primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_test_varchar (
|
||||
id integer auto_increment not null,
|
||||
varchar255 varchar(255),
|
||||
varchar256 varchar(256),
|
||||
varchar512 varchar(512),
|
||||
varchar1k varchar(1024),
|
||||
varchar2k varchar(2048),
|
||||
varchar4k varchar(4096),
|
||||
varchar8k varchar(8192),
|
||||
varchar16k varchar(16384),
|
||||
varchar32k varchar(32768),
|
||||
varchar64k varchar(65536),
|
||||
varchar128k varchar(131072),
|
||||
varchar256k varchar(262144),
|
||||
varchar512k varchar(524288),
|
||||
varchar1m varchar(1048576),
|
||||
varchar2m varchar(2097152),
|
||||
varchar4m varchar(4194304),
|
||||
varchar8m varchar(8388608),
|
||||
varchar16m varchar(16777216),
|
||||
varchar32m varchar(33554432),
|
||||
constraint pk_migtest_e_test_varchar primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_user (
|
||||
id integer auto_increment not null,
|
||||
constraint pk_migtest_e_user primary key (id)
|
||||
@@ -96,6 +211,15 @@ comment on table migtest_e_history is 'We have history now';
|
||||
comment on column "table"."index" is 'this is an other comment';
|
||||
alter table "table" add constraint uq_table_select unique ("select");
|
||||
-- foreign keys and indices
|
||||
create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id);
|
||||
alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id);
|
||||
alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id);
|
||||
alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id);
|
||||
alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict;
|
||||
|
||||
|
||||
-4
@@ -7,9 +7,5 @@ alter table migtest_e_basic drop column eref_id;
|
||||
alter table migtest_e_history2 drop column obsolete_string1;
|
||||
alter table migtest_e_history2 drop column obsolete_string2;
|
||||
-- apply post alter
|
||||
drop table if exists drop_main;
|
||||
drop table if exists drop_main_drop_ref_many;
|
||||
drop table if exists drop_ref_many;
|
||||
drop table if exists drop_ref_one;
|
||||
drop table if exists "migtest_QuOtEd";
|
||||
drop table if exists migtest_e_ref;
|
||||
|
||||
@@ -14,6 +14,9 @@ alter table migtest_e_basic drop constraint uq_migtest_e_basic_name;
|
||||
alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest4;
|
||||
alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest5;
|
||||
alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_status;
|
||||
alter table drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_main;
|
||||
alter table drop_main_drop_ref_many drop constraint if exists fk_drop_main_drop_ref_many_drop_ref_many;
|
||||
alter table drop_ref_one drop constraint if exists fk_drop_ref_one_parent_id;
|
||||
alter table migtest_mtm_c_migtest_mtm_m drop constraint if exists fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c;
|
||||
alter table migtest_mtm_c_migtest_mtm_m drop constraint if exists fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_m;
|
||||
alter table migtest_mtm_m_migtest_mtm_c drop constraint if exists fk_migtest_mtm_m_migtest_mtm_c_migtest_mtm_m;
|
||||
|
||||
+8
@@ -17,6 +17,14 @@ alter table migtest_e_history5 drop column test_boolean;
|
||||
alter table migtest_e_softdelete drop column deleted;
|
||||
alter table migtest_oto_child drop column master_id;
|
||||
-- apply post alter
|
||||
drop table if exists drop_main;
|
||||
drop table if exists drop_main_drop_ref_many;
|
||||
drop table if exists drop_ref_many;
|
||||
drop table if exists drop_ref_one;
|
||||
drop table if exists migtest_e_test_binary;
|
||||
drop table if exists migtest_e_test_json;
|
||||
drop table if exists migtest_e_test_lob;
|
||||
drop table if exists migtest_e_test_varchar;
|
||||
drop table if exists migtest_e_user;
|
||||
drop table if exists migtest_mtm_c_migtest_mtm_m;
|
||||
drop table if exists migtest_mtm_m_migtest_mtm_c;
|
||||
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
-528359263, 1.0__initial.sql
|
||||
-1374084944, 1.1.sql
|
||||
-875723380, 1.2__dropsFor_1.1.sql
|
||||
-819139044, 1.3.sql
|
||||
255653518, 1.4__dropsFor_1.3.sql
|
||||
-1547037623, 1.0__initial.sql
|
||||
275373095, 1.1.sql
|
||||
688811494, 1.2__dropsFor_1.1.sql
|
||||
674925120, 1.3.sql
|
||||
-252580551, 1.4__dropsFor_1.3.sql
|
||||
|
||||
|
||||
@@ -54,28 +54,6 @@ create table migtest_fk_set_null (
|
||||
constraint pk_migtest_fk_set_null primary key (id)
|
||||
);
|
||||
|
||||
create table drop_main (
|
||||
id integer generated by default as identity not null,
|
||||
constraint pk_drop_main primary key (id)
|
||||
);
|
||||
|
||||
create table drop_main_drop_ref_many (
|
||||
drop_main_id integer not null,
|
||||
drop_ref_many_id integer not null,
|
||||
constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id)
|
||||
);
|
||||
|
||||
create table drop_ref_many (
|
||||
id integer generated by default as identity not null,
|
||||
constraint pk_drop_ref_many primary key (id)
|
||||
);
|
||||
|
||||
create table drop_ref_one (
|
||||
id integer generated by default as identity not null,
|
||||
parent_id integer,
|
||||
constraint pk_drop_ref_one primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_basic (
|
||||
id integer generated by default as identity not null,
|
||||
status varchar(1),
|
||||
@@ -254,15 +232,6 @@ alter table migtest_fk_cascade add constraint fk_migtest_fk_cascade_one_id forei
|
||||
create index ix_migtest_fk_set_null_one_id on migtest_fk_set_null (one_id);
|
||||
alter table migtest_fk_set_null add constraint fk_migtest_fk_set_null_one_id foreign key (one_id) references migtest_fk_one (id) on delete set null on update restrict;
|
||||
|
||||
create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id);
|
||||
alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id);
|
||||
alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id);
|
||||
alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_migtest_e_basic_eref_id on migtest_e_basic (eref_id);
|
||||
alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign key (eref_id) references migtest_e_ref (id) on delete restrict on update restrict;
|
||||
|
||||
|
||||
@@ -65,27 +65,6 @@ end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_DROP_MAIN_DROP_REF_MANY_DROP_MAIN' and ucase(tabname) = 'DROP_MAIN_DROP_REF_MANY') then
|
||||
prepare stmt from 'alter table drop_main_drop_ref_many drop constraint fk_drop_main_drop_ref_many_drop_main';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_DROP_MAIN_DROP_REF_MANY_DROP_REF_MANY' and ucase(tabname) = 'DROP_MAIN_DROP_REF_MANY') then
|
||||
prepare stmt from 'alter table drop_main_drop_ref_many drop constraint fk_drop_main_drop_ref_many_drop_ref_many';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_DROP_REF_ONE_PARENT_ID' and ucase(tabname) = 'DROP_REF_ONE') then
|
||||
prepare stmt from 'alter table drop_ref_one drop constraint fk_drop_ref_one_parent_id';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MIGTEST_E_BASIC_INDEXTEST1') then
|
||||
prepare stmt from 'drop index ix_migtest_e_basic_indextest1';
|
||||
execute stmt;
|
||||
@@ -106,6 +85,124 @@ if exists (select indname from syscat.indexes where indschema = current_schema a
|
||||
end if;
|
||||
end$$;
|
||||
-- apply changes
|
||||
create table drop_main (
|
||||
id integer generated by default as identity not null,
|
||||
constraint pk_drop_main primary key (id)
|
||||
);
|
||||
|
||||
create table drop_main_drop_ref_many (
|
||||
drop_main_id integer not null,
|
||||
drop_ref_many_id integer not null,
|
||||
constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id)
|
||||
);
|
||||
|
||||
create table drop_ref_many (
|
||||
id integer generated by default as identity not null,
|
||||
constraint pk_drop_ref_many primary key (id)
|
||||
);
|
||||
|
||||
create table drop_ref_one (
|
||||
id integer generated by default as identity not null,
|
||||
parent_id integer,
|
||||
constraint pk_drop_ref_one primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_test_binary (
|
||||
id integer generated by default as identity not null,
|
||||
test_byte16 varbinary(16),
|
||||
test_byte256 varbinary(256),
|
||||
test_byte512 varbinary(512),
|
||||
test_byte1k varbinary(1024),
|
||||
test_byte2k varbinary(2048),
|
||||
test_byte4k varbinary(4096),
|
||||
test_byte8k blob(8192),
|
||||
test_byte16k blob(16384),
|
||||
test_byte32k blob(32768),
|
||||
test_byte64k blob(65536),
|
||||
test_byte128k blob(131072),
|
||||
test_byte256k blob(262144),
|
||||
test_byte512k blob(524288),
|
||||
test_byte1m blob(1048576),
|
||||
test_byte2m blob(2097152),
|
||||
test_byte4m blob(4194304),
|
||||
test_byte8m blob(8388608),
|
||||
test_byte16m blob(16777216),
|
||||
test_byte32m blob(33554432),
|
||||
constraint pk_migtest_e_test_binary primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_test_json (
|
||||
id integer generated by default as identity not null,
|
||||
json255 varchar(255),
|
||||
json256 varchar(256),
|
||||
json512 varchar(512),
|
||||
json1k varchar(1024),
|
||||
json2k varchar(2048),
|
||||
json4k clob(4096),
|
||||
json8k clob(8192),
|
||||
json16k clob(16384),
|
||||
json32k clob(32768),
|
||||
json64k clob(65536),
|
||||
json128k clob(131072),
|
||||
json256k clob(262144),
|
||||
json512k clob(524288),
|
||||
json1m clob(1048576),
|
||||
json2m clob(2097152),
|
||||
json4m clob(4194304),
|
||||
json8m clob(8388608),
|
||||
json16m clob(16777216),
|
||||
json32m clob(33554432),
|
||||
constraint pk_migtest_e_test_json primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_test_lob (
|
||||
id integer generated by default as identity not null,
|
||||
lob255 clob,
|
||||
lob256 clob,
|
||||
lob512 clob,
|
||||
lob1k clob,
|
||||
lob2k clob,
|
||||
lob4k clob,
|
||||
lob8k clob,
|
||||
lob16k clob,
|
||||
lob32k clob,
|
||||
lob64k clob,
|
||||
lob128k clob,
|
||||
lob256k clob,
|
||||
lob512k clob,
|
||||
lob1m clob,
|
||||
lob2m clob,
|
||||
lob4m clob,
|
||||
lob8m clob,
|
||||
lob16m clob,
|
||||
lob32m clob,
|
||||
constraint pk_migtest_e_test_lob primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_test_varchar (
|
||||
id integer generated by default as identity not null,
|
||||
varchar255 varchar(255),
|
||||
varchar256 varchar(256),
|
||||
varchar512 varchar(512),
|
||||
varchar1k varchar(1024),
|
||||
varchar2k varchar(2048),
|
||||
varchar4k clob(4096),
|
||||
varchar8k clob(8192),
|
||||
varchar16k clob(16384),
|
||||
varchar32k clob(32768),
|
||||
varchar64k clob(65536),
|
||||
varchar128k clob(131072),
|
||||
varchar256k clob(262144),
|
||||
varchar512k clob(524288),
|
||||
varchar1m clob(1048576),
|
||||
varchar2m clob(2097152),
|
||||
varchar4m clob(4194304),
|
||||
varchar8m clob(8388608),
|
||||
varchar16m clob(16777216),
|
||||
varchar32m clob(33554432),
|
||||
constraint pk_migtest_e_test_varchar primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_user (
|
||||
id integer generated by default as identity not null,
|
||||
constraint pk_migtest_e_user primary key (id)
|
||||
@@ -231,6 +328,15 @@ comment on column "table"."index" is 'this is an other comment';
|
||||
alter table "table" add versioning use history table table_history;
|
||||
create unique index uq_table_select on "table"("select") exclude null keys;
|
||||
-- foreign keys and indices
|
||||
create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id);
|
||||
alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id);
|
||||
alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id);
|
||||
alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id);
|
||||
alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict;
|
||||
|
||||
|
||||
@@ -15,31 +15,6 @@ alter table migtest_e_history2_history drop column obsolete_string2;
|
||||
call sysproc.admin_cmd('reorg table migtest_e_history2_history');
|
||||
-- apply post alter
|
||||
alter table migtest_e_history2 add versioning use history table migtest_e_history2_history;
|
||||
drop table drop_main;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'DROP_MAIN_SEQ') then
|
||||
prepare stmt from 'drop sequence drop_main_seq';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
drop table drop_main_drop_ref_many;
|
||||
drop table drop_ref_many;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'DROP_REF_MANY_SEQ') then
|
||||
prepare stmt from 'drop sequence drop_ref_many_seq';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
drop table drop_ref_one;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'DROP_REF_ONE_SEQ') then
|
||||
prepare stmt from 'drop sequence drop_ref_one_seq';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
drop table "migtest_QuOtEd";
|
||||
drop table migtest_e_ref;
|
||||
delimiter $$
|
||||
|
||||
@@ -135,6 +135,27 @@ end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_DROP_MAIN_DROP_REF_MANY_DROP_MAIN' and ucase(tabname) = 'DROP_MAIN_DROP_REF_MANY') then
|
||||
prepare stmt from 'alter table drop_main_drop_ref_many drop constraint fk_drop_main_drop_ref_many_drop_main';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_DROP_MAIN_DROP_REF_MANY_DROP_REF_MANY' and ucase(tabname) = 'DROP_MAIN_DROP_REF_MANY') then
|
||||
prepare stmt from 'alter table drop_main_drop_ref_many drop constraint fk_drop_main_drop_ref_many_drop_ref_many';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_DROP_REF_ONE_PARENT_ID' and ucase(tabname) = 'DROP_REF_ONE') then
|
||||
prepare stmt from 'alter table drop_ref_one drop constraint fk_drop_ref_one_parent_id';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_MTM_C_MIGTEST_MTM_M_MIGTEST_MTM_C' and ucase(tabname) = 'MIGTEST_MTM_C_MIGTEST_MTM_M') then
|
||||
prepare stmt from 'alter table migtest_mtm_c_migtest_mtm_m drop constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c';
|
||||
execute stmt;
|
||||
@@ -211,6 +232,7 @@ update migtest_e_basic set status2 = 'N' where status2 is null;
|
||||
update migtest_e_basic set a_lob = 'X' where a_lob is null;
|
||||
|
||||
update migtest_e_basic set user_id = 23 where user_id is null;
|
||||
CALL SYSPROC.ADMIN_MOVE_TABLE(CURRENT_SCHEMA,'MIGTEST_E_BASIC','TSTABLES','INDEXTS','TSTABLES','','','','','','MOVE');
|
||||
alter table migtest_e_history2 drop versioning;
|
||||
alter table migtest_e_history3 drop versioning;
|
||||
alter table migtest_e_history4 drop versioning;
|
||||
|
||||
@@ -48,6 +48,63 @@ drop table migtest_e_history_history;
|
||||
alter table migtest_e_history2 add versioning use history table migtest_e_history2_history;
|
||||
alter table migtest_e_history5 add versioning use history table migtest_e_history5_history;
|
||||
alter table "table" add versioning use history table table_history;
|
||||
drop table drop_main;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'DROP_MAIN_SEQ') then
|
||||
prepare stmt from 'drop sequence drop_main_seq';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
drop table drop_main_drop_ref_many;
|
||||
drop table drop_ref_many;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'DROP_REF_MANY_SEQ') then
|
||||
prepare stmt from 'drop sequence drop_ref_many_seq';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
drop table drop_ref_one;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'DROP_REF_ONE_SEQ') then
|
||||
prepare stmt from 'drop sequence drop_ref_one_seq';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
drop table migtest_e_test_binary;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'MIGTEST_E_TEST_BINARY_SEQ') then
|
||||
prepare stmt from 'drop sequence migtest_e_test_binary_seq';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
drop table migtest_e_test_json;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'MIGTEST_E_TEST_JSON_SEQ') then
|
||||
prepare stmt from 'drop sequence migtest_e_test_json_seq';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
drop table migtest_e_test_lob;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'MIGTEST_E_TEST_LOB_SEQ') then
|
||||
prepare stmt from 'drop sequence migtest_e_test_lob_seq';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
drop table migtest_e_test_varchar;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'MIGTEST_E_TEST_VARCHAR_SEQ') then
|
||||
prepare stmt from 'drop sequence migtest_e_test_varchar_seq';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
drop table migtest_e_user;
|
||||
delimiter $$
|
||||
begin
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
1307787475, I__create_tablespaces.sql
|
||||
1681764655, 1.0__initial.sql
|
||||
1259437403, 1.1.sql
|
||||
135256939, 1.2__dropsFor_1.1.sql
|
||||
1091218936, 1.3.sql
|
||||
946163478, 1.4__dropsFor_1.3.sql
|
||||
2058232717, 1.0__initial.sql
|
||||
372361421, 1.1.sql
|
||||
-1187336846, 1.2__dropsFor_1.1.sql
|
||||
469192394, 1.3.sql
|
||||
1864105401, 1.4__dropsFor_1.3.sql
|
||||
561281075, R__order_views.sql
|
||||
|
||||
|
||||
@@ -54,28 +54,6 @@ create table migtest_fk_set_null (
|
||||
constraint pk_migtest_fk_set_null primary key (id)
|
||||
);
|
||||
|
||||
create table drop_main (
|
||||
id integer generated by default as identity not null,
|
||||
constraint pk_drop_main primary key (id)
|
||||
);
|
||||
|
||||
create table drop_main_drop_ref_many (
|
||||
drop_main_id integer not null,
|
||||
drop_ref_many_id integer not null,
|
||||
constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id)
|
||||
);
|
||||
|
||||
create table drop_ref_many (
|
||||
id integer generated by default as identity not null,
|
||||
constraint pk_drop_ref_many primary key (id)
|
||||
);
|
||||
|
||||
create table drop_ref_one (
|
||||
id integer generated by default as identity not null,
|
||||
parent_id integer,
|
||||
constraint pk_drop_ref_one primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_basic (
|
||||
id integer generated by default as identity not null,
|
||||
status varchar(1),
|
||||
@@ -254,15 +232,6 @@ alter table migtest_fk_cascade add constraint fk_migtest_fk_cascade_one_id forei
|
||||
create index ix_migtest_fk_set_null_one_id on migtest_fk_set_null (one_id);
|
||||
alter table migtest_fk_set_null add constraint fk_migtest_fk_set_null_one_id foreign key (one_id) references migtest_fk_one (id) on delete set null on update restrict;
|
||||
|
||||
create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id);
|
||||
alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id);
|
||||
alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id);
|
||||
alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_migtest_e_basic_eref_id on migtest_e_basic (eref_id);
|
||||
alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign key (eref_id) references migtest_e_ref (id) on delete restrict on update restrict;
|
||||
|
||||
|
||||
@@ -65,27 +65,6 @@ end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_DROP_MAIN_DROP_REF_MANY_DROP_MAIN' and ucase(tabname) = 'DROP_MAIN_DROP_REF_MANY') then
|
||||
prepare stmt from 'alter table drop_main_drop_ref_many drop constraint fk_drop_main_drop_ref_many_drop_main';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_DROP_MAIN_DROP_REF_MANY_DROP_REF_MANY' and ucase(tabname) = 'DROP_MAIN_DROP_REF_MANY') then
|
||||
prepare stmt from 'alter table drop_main_drop_ref_many drop constraint fk_drop_main_drop_ref_many_drop_ref_many';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_DROP_REF_ONE_PARENT_ID' and ucase(tabname) = 'DROP_REF_ONE') then
|
||||
prepare stmt from 'alter table drop_ref_one drop constraint fk_drop_ref_one_parent_id';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MIGTEST_E_BASIC_INDEXTEST1') then
|
||||
prepare stmt from 'drop index ix_migtest_e_basic_indextest1';
|
||||
execute stmt;
|
||||
@@ -106,6 +85,124 @@ if exists (select indname from syscat.indexes where indschema = current_schema a
|
||||
end if;
|
||||
end$$;
|
||||
-- apply changes
|
||||
create table drop_main (
|
||||
id integer generated by default as identity not null,
|
||||
constraint pk_drop_main primary key (id)
|
||||
);
|
||||
|
||||
create table drop_main_drop_ref_many (
|
||||
drop_main_id integer not null,
|
||||
drop_ref_many_id integer not null,
|
||||
constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id)
|
||||
);
|
||||
|
||||
create table drop_ref_many (
|
||||
id integer generated by default as identity not null,
|
||||
constraint pk_drop_ref_many primary key (id)
|
||||
);
|
||||
|
||||
create table drop_ref_one (
|
||||
id integer generated by default as identity not null,
|
||||
parent_id integer,
|
||||
constraint pk_drop_ref_one primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_test_binary (
|
||||
id integer generated by default as identity not null,
|
||||
test_byte16 varbinary(16),
|
||||
test_byte256 varbinary(256),
|
||||
test_byte512 varbinary(512),
|
||||
test_byte1k varbinary(1024),
|
||||
test_byte2k varbinary(2048),
|
||||
test_byte4k varbinary(4096),
|
||||
test_byte8k blob(8192),
|
||||
test_byte16k blob(16384),
|
||||
test_byte32k blob(32768),
|
||||
test_byte64k blob(65536),
|
||||
test_byte128k blob(131072),
|
||||
test_byte256k blob(262144),
|
||||
test_byte512k blob(524288),
|
||||
test_byte1m blob(1048576),
|
||||
test_byte2m blob(2097152),
|
||||
test_byte4m blob(4194304),
|
||||
test_byte8m blob(8388608),
|
||||
test_byte16m blob(16777216),
|
||||
test_byte32m blob(33554432),
|
||||
constraint pk_migtest_e_test_binary primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_test_json (
|
||||
id integer generated by default as identity not null,
|
||||
json255 varchar(255),
|
||||
json256 varchar(256),
|
||||
json512 varchar(512),
|
||||
json1k varchar(1024),
|
||||
json2k varchar(2048),
|
||||
json4k clob(4096),
|
||||
json8k clob(8192),
|
||||
json16k clob(16384),
|
||||
json32k clob(32768),
|
||||
json64k clob(65536),
|
||||
json128k clob(131072),
|
||||
json256k clob(262144),
|
||||
json512k clob(524288),
|
||||
json1m clob(1048576),
|
||||
json2m clob(2097152),
|
||||
json4m clob(4194304),
|
||||
json8m clob(8388608),
|
||||
json16m clob(16777216),
|
||||
json32m clob(33554432),
|
||||
constraint pk_migtest_e_test_json primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_test_lob (
|
||||
id integer generated by default as identity not null,
|
||||
lob255 clob,
|
||||
lob256 clob,
|
||||
lob512 clob,
|
||||
lob1k clob,
|
||||
lob2k clob,
|
||||
lob4k clob,
|
||||
lob8k clob,
|
||||
lob16k clob,
|
||||
lob32k clob,
|
||||
lob64k clob,
|
||||
lob128k clob,
|
||||
lob256k clob,
|
||||
lob512k clob,
|
||||
lob1m clob,
|
||||
lob2m clob,
|
||||
lob4m clob,
|
||||
lob8m clob,
|
||||
lob16m clob,
|
||||
lob32m clob,
|
||||
constraint pk_migtest_e_test_lob primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_test_varchar (
|
||||
id integer generated by default as identity not null,
|
||||
varchar255 varchar(255),
|
||||
varchar256 varchar(256),
|
||||
varchar512 varchar(512),
|
||||
varchar1k varchar(1024),
|
||||
varchar2k varchar(2048),
|
||||
varchar4k clob(4096),
|
||||
varchar8k clob(8192),
|
||||
varchar16k clob(16384),
|
||||
varchar32k clob(32768),
|
||||
varchar64k clob(65536),
|
||||
varchar128k clob(131072),
|
||||
varchar256k clob(262144),
|
||||
varchar512k clob(524288),
|
||||
varchar1m clob(1048576),
|
||||
varchar2m clob(2097152),
|
||||
varchar4m clob(4194304),
|
||||
varchar8m clob(8388608),
|
||||
varchar16m clob(16777216),
|
||||
varchar32m clob(33554432),
|
||||
constraint pk_migtest_e_test_varchar primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_user (
|
||||
id integer generated by default as identity not null,
|
||||
constraint pk_migtest_e_user primary key (id)
|
||||
@@ -231,6 +328,15 @@ comment on column "table"."index" is 'this is an other comment';
|
||||
alter table "table" add versioning use history table table_history;
|
||||
create unique index uq_table_select on "table"("select") exclude null keys;
|
||||
-- foreign keys and indices
|
||||
create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id);
|
||||
alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id);
|
||||
alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id);
|
||||
alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c on migtest_mtm_c_migtest_mtm_m (migtest_mtm_c_id);
|
||||
alter table migtest_mtm_c_migtest_mtm_m add constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c foreign key (migtest_mtm_c_id) references migtest_mtm_c (id) on delete restrict on update restrict;
|
||||
|
||||
|
||||
@@ -15,31 +15,6 @@ alter table migtest_e_history2_history drop column obsolete_string2;
|
||||
call sysproc.admin_cmd('reorg table migtest_e_history2_history');
|
||||
-- apply post alter
|
||||
alter table migtest_e_history2 add versioning use history table migtest_e_history2_history;
|
||||
drop table drop_main;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'DROP_MAIN_SEQ') then
|
||||
prepare stmt from 'drop sequence drop_main_seq';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
drop table drop_main_drop_ref_many;
|
||||
drop table drop_ref_many;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'DROP_REF_MANY_SEQ') then
|
||||
prepare stmt from 'drop sequence drop_ref_many_seq';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
drop table drop_ref_one;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'DROP_REF_ONE_SEQ') then
|
||||
prepare stmt from 'drop sequence drop_ref_one_seq';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
drop table "migtest_QuOtEd";
|
||||
drop table migtest_e_ref;
|
||||
delimiter $$
|
||||
|
||||
@@ -135,6 +135,27 @@ end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_DROP_MAIN_DROP_REF_MANY_DROP_MAIN' and ucase(tabname) = 'DROP_MAIN_DROP_REF_MANY') then
|
||||
prepare stmt from 'alter table drop_main_drop_ref_many drop constraint fk_drop_main_drop_ref_many_drop_main';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_DROP_MAIN_DROP_REF_MANY_DROP_REF_MANY' and ucase(tabname) = 'DROP_MAIN_DROP_REF_MANY') then
|
||||
prepare stmt from 'alter table drop_main_drop_ref_many drop constraint fk_drop_main_drop_ref_many_drop_ref_many';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_DROP_REF_ONE_PARENT_ID' and ucase(tabname) = 'DROP_REF_ONE') then
|
||||
prepare stmt from 'alter table drop_ref_one drop constraint fk_drop_ref_one_parent_id';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_MTM_C_MIGTEST_MTM_M_MIGTEST_MTM_C' and ucase(tabname) = 'MIGTEST_MTM_C_MIGTEST_MTM_M') then
|
||||
prepare stmt from 'alter table migtest_mtm_c_migtest_mtm_m drop constraint fk_migtest_mtm_c_migtest_mtm_m_migtest_mtm_c';
|
||||
execute stmt;
|
||||
@@ -211,6 +232,7 @@ update migtest_e_basic set status2 = 'N' where status2 is null;
|
||||
update migtest_e_basic set a_lob = 'X' where a_lob is null;
|
||||
|
||||
update migtest_e_basic set user_id = 23 where user_id is null;
|
||||
CALL SYSPROC.ADMIN_MOVE_TABLE(CURRENT_SCHEMA,'MIGTEST_E_BASIC','TSTABLES','INDEXTS','TSTABLES','','','','','','MOVE');
|
||||
alter table migtest_e_history2 drop versioning;
|
||||
alter table migtest_e_history3 drop versioning;
|
||||
alter table migtest_e_history4 drop versioning;
|
||||
|
||||
@@ -48,6 +48,63 @@ drop table migtest_e_history_history;
|
||||
alter table migtest_e_history2 add versioning use history table migtest_e_history2_history;
|
||||
alter table migtest_e_history5 add versioning use history table migtest_e_history5_history;
|
||||
alter table "table" add versioning use history table table_history;
|
||||
drop table drop_main;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'DROP_MAIN_SEQ') then
|
||||
prepare stmt from 'drop sequence drop_main_seq';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
drop table drop_main_drop_ref_many;
|
||||
drop table drop_ref_many;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'DROP_REF_MANY_SEQ') then
|
||||
prepare stmt from 'drop sequence drop_ref_many_seq';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
drop table drop_ref_one;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'DROP_REF_ONE_SEQ') then
|
||||
prepare stmt from 'drop sequence drop_ref_one_seq';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
drop table migtest_e_test_binary;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'MIGTEST_E_TEST_BINARY_SEQ') then
|
||||
prepare stmt from 'drop sequence migtest_e_test_binary_seq';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
drop table migtest_e_test_json;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'MIGTEST_E_TEST_JSON_SEQ') then
|
||||
prepare stmt from 'drop sequence migtest_e_test_json_seq';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
drop table migtest_e_test_lob;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'MIGTEST_E_TEST_LOB_SEQ') then
|
||||
prepare stmt from 'drop sequence migtest_e_test_lob_seq';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
drop table migtest_e_test_varchar;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'MIGTEST_E_TEST_VARCHAR_SEQ') then
|
||||
prepare stmt from 'drop sequence migtest_e_test_varchar_seq';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
drop table migtest_e_user;
|
||||
delimiter $$
|
||||
begin
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
1681764655, 1.0__initial.sql
|
||||
1259437403, 1.1.sql
|
||||
135256939, 1.2__dropsFor_1.1.sql
|
||||
1091218936, 1.3.sql
|
||||
946163478, 1.4__dropsFor_1.3.sql
|
||||
2058232717, 1.0__initial.sql
|
||||
372361421, 1.1.sql
|
||||
-1187336846, 1.2__dropsFor_1.1.sql
|
||||
469192394, 1.3.sql
|
||||
1864105401, 1.4__dropsFor_1.3.sql
|
||||
561281075, R__order_views.sql
|
||||
|
||||
|
||||
@@ -54,28 +54,6 @@ create table migtest_fk_set_null (
|
||||
constraint pk_migtest_fk_set_null primary key (id)
|
||||
);
|
||||
|
||||
create table drop_main (
|
||||
id integer auto_increment not null,
|
||||
constraint pk_drop_main primary key (id)
|
||||
);
|
||||
|
||||
create table drop_main_drop_ref_many (
|
||||
drop_main_id integer not null,
|
||||
drop_ref_many_id integer not null,
|
||||
constraint pk_drop_main_drop_ref_many primary key (drop_main_id,drop_ref_many_id)
|
||||
);
|
||||
|
||||
create table drop_ref_many (
|
||||
id integer auto_increment not null,
|
||||
constraint pk_drop_ref_many primary key (id)
|
||||
);
|
||||
|
||||
create table drop_ref_one (
|
||||
id integer auto_increment not null,
|
||||
parent_id integer,
|
||||
constraint pk_drop_ref_one primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_basic (
|
||||
id integer auto_increment not null,
|
||||
status varchar(1),
|
||||
@@ -216,15 +194,6 @@ alter table migtest_fk_cascade add constraint fk_migtest_fk_cascade_one_id forei
|
||||
create index ix_migtest_fk_set_null_one_id on migtest_fk_set_null (one_id);
|
||||
alter table migtest_fk_set_null add constraint fk_migtest_fk_set_null_one_id foreign key (one_id) references migtest_fk_one (id) on delete set null on update restrict;
|
||||
|
||||
create index ix_drop_main_drop_ref_many_drop_main on drop_main_drop_ref_many (drop_main_id);
|
||||
alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_main foreign key (drop_main_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_drop_main_drop_ref_many_drop_ref_many on drop_main_drop_ref_many (drop_ref_many_id);
|
||||
alter table drop_main_drop_ref_many add constraint fk_drop_main_drop_ref_many_drop_ref_many foreign key (drop_ref_many_id) references drop_ref_many (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_drop_ref_one_parent_id on drop_ref_one (parent_id);
|
||||
alter table drop_ref_one add constraint fk_drop_ref_one_parent_id foreign key (parent_id) references drop_main (id) on delete restrict on update restrict;
|
||||
|
||||
create index ix_migtest_e_basic_eref_id on migtest_e_basic (eref_id);
|
||||
alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign key (eref_id) references migtest_e_ref (id) on delete restrict on update restrict;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user