Skip to content
Permalink
Browse files

0002904: Parameter to exclude the indexes in table create

  • Loading branch information...
erilong committed Jan 8, 2019
1 parent 9a9282e commit 857b6c49a347f72602abe9e6738ab2ff84611730
@@ -167,6 +167,7 @@ private ParameterConstants() {

public final static String CREATE_TABLE_WITHOUT_DEFAULTS = "create.table.without.defaults";
public final static String CREATE_TABLE_WITHOUT_FOREIGN_KEYS = "create.table.without.foreign.keys";
public final static String CREATE_TABLE_WITHOUT_INDEXES = "create.table.without.indexes";
public final static String CREATE_TABLE_WITHOUT_PK_IF_SOURCE_WITHOUT_PK = "create.table.without.pk.if.source.without.pk";

public final static String CREATE_TABLE_NOT_NULL_COLUMNS = "create.table.not.null.columns.supported";
@@ -2441,6 +2441,7 @@ public CsvData next() {

boolean excludeDefaults = parameterService.is(ParameterConstants.CREATE_TABLE_WITHOUT_DEFAULTS, false);
boolean excludeForeignKeys = parameterService.is(ParameterConstants.CREATE_TABLE_WITHOUT_FOREIGN_KEYS, false);
boolean excludeIndexes = parameterService.is(ParameterConstants.CREATE_TABLE_WITHOUT_INDEXES, false);

/*
* Force a reread of table so new columns are picked up. A create
@@ -2475,6 +2476,9 @@ public CsvData next() {
if (excludeForeignKeys) {
copyTargetTable.removeAllForeignKeys();
}
if (excludeIndexes) {
copyTargetTable.removeAllIndexes();
}

if (parameterService.is(ParameterConstants.CREATE_TABLE_WITHOUT_PK_IF_SOURCE_WITHOUT_PK, false)
&& sourceTable.getPrimaryKeyColumnCount() == 0
@@ -1383,6 +1383,13 @@ create.table.without.defaults=false
# Type: boolean
create.table.without.foreign.keys=false

# If set to true, when a table's schema is sent to the target database, indexes will not
# be included.
#
# DatabaseOverridable: true
# Type: boolean
create.table.without.indexes=false

# If set to true, when a table's schema is sent to the target database it will not have all
# columns set as the primary key if the source does not have any primary keys.
#
@@ -138,6 +138,10 @@ public void removeAllForeignKeys() {
foreignKeys.clear();
}

public void removeAllIndexes() {
indices.clear();
}

/**
* Returns the catalog of this table as read from the database.
*

0 comments on commit 857b6c4

Please sign in to comment.
You can’t perform that action at this time.