+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.sonar.server.platform.db.migration.version.v66;
-
-import java.sql.SQLException;
-import org.sonar.db.Database;
-import org.sonar.server.platform.db.migration.step.DataChange;
-import org.sonar.server.platform.db.migration.step.MassUpdate;
-import org.sonar.server.platform.db.migration.step.Select;
-import org.sonar.server.platform.db.migration.step.SqlStatement;
-
-public class PopulateAnalysisUuidColumnOnWebhookDeliveries extends DataChange {
-
- public PopulateAnalysisUuidColumnOnWebhookDeliveries(Database db) {
- super(db);
- }
-
- @Override
- public void execute(Context context) throws SQLException {
- MassUpdate massUpdate = context.prepareMassUpdate();
- massUpdate.select("SELECT wd.uuid, ca.analysis_uuid " +
- " FROM webhook_deliveries wd " +
- " INNER JOIN ce_activity ca ON ca.uuid=wd.ce_task_uuid " +
- " WHERE wd.analysis_uuid IS NULL AND ca.analysis_uuid IS NOT NULL");
- massUpdate.update("UPDATE webhook_deliveries SET analysis_uuid=? WHERE uuid=?");
- massUpdate.rowPluralName("webhook_deliveries");
- massUpdate.execute(PopulateAnalysisUuidColumnOnWebhookDeliveries::handle);
- }
-
- private static boolean handle(Select.Row row, SqlStatement update) throws SQLException {
- String uuid = row.getString(1);
- String analysisUuid = row.getString(2);
-
- update.setString(1, analysisUuid);
- update.setString(2, uuid);
-
- return true;
- }
-}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-package org.sonar.server.platform.db.migration.version.v66;
-
-import java.sql.SQLException;
-import org.sonar.db.Database;
-import org.sonar.server.platform.db.migration.def.VarcharColumnDef;
-import org.sonar.server.platform.db.migration.sql.AlterColumnsBuilder;
-import org.sonar.server.platform.db.migration.step.DdlChange;
-
-public class UpdateCeTaskUuidColumnToNullableOnWebhookDeliveries extends DdlChange {
-
- public static final String TABLE_WEBHOOK_DELIVERIES = "webhook_deliveries";
-
- public UpdateCeTaskUuidColumnToNullableOnWebhookDeliveries(Database db) {
- super(db);
- }
-
- @Override
- public void execute(Context context) throws SQLException {
- context.execute(new AlterColumnsBuilder(getDialect(), TABLE_WEBHOOK_DELIVERIES)
- .updateColumn(VarcharColumnDef.newVarcharColumnDefBuilder()
- .setColumnName("ce_task_uuid")
- .setLimit(40)
- .setIsNullable(true)
- .build())
- .build());
- }
-}
.add(1831, "Add webhook_deliveries.analysis_uuid", AddAnalysisUuidToWebhookDeliveries.class)
.add(1832, "Create table ANALYSIS_PROPERTIES", CreateTableAnalysisProperties.class)
.add(1833, "Cleanup disabled users", CleanupDisabledUsers.class)
+ .add(1834, "Set WEBHOOK_DELIVERIES.CE_TASK_UUID as nullable", UpdateCeTaskUuidColumnToNullableOnWebhookDeliveries.class)
+ .add(1835, "Populate WEBHOOK_DELIVERIES.ANALYSIS_UUID", PopulateAnalysisUuidColumnOnWebhookDeliveries.class)
;
}
}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.sonar.server.platform.db.migration.version.v67;
+
+import java.sql.SQLException;
+import org.sonar.db.Database;
+import org.sonar.server.platform.db.migration.step.DataChange;
+import org.sonar.server.platform.db.migration.step.MassUpdate;
+import org.sonar.server.platform.db.migration.step.Select;
+import org.sonar.server.platform.db.migration.step.SqlStatement;
+
+public class PopulateAnalysisUuidColumnOnWebhookDeliveries extends DataChange {
+
+ public PopulateAnalysisUuidColumnOnWebhookDeliveries(Database db) {
+ super(db);
+ }
+
+ @Override
+ public void execute(Context context) throws SQLException {
+ MassUpdate massUpdate = context.prepareMassUpdate();
+ massUpdate.select("SELECT wd.uuid, ca.analysis_uuid " +
+ " FROM webhook_deliveries wd " +
+ " INNER JOIN ce_activity ca ON ca.uuid=wd.ce_task_uuid " +
+ " WHERE wd.analysis_uuid IS NULL AND ca.analysis_uuid IS NOT NULL");
+ massUpdate.update("UPDATE webhook_deliveries SET analysis_uuid=? WHERE uuid=?");
+ massUpdate.rowPluralName("webhook_deliveries");
+ massUpdate.execute(PopulateAnalysisUuidColumnOnWebhookDeliveries::handle);
+ }
+
+ private static boolean handle(Select.Row row, SqlStatement update) throws SQLException {
+ String uuid = row.getString(1);
+ String analysisUuid = row.getString(2);
+
+ update.setString(1, analysisUuid);
+ update.setString(2, uuid);
+
+ return true;
+ }
+}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+package org.sonar.server.platform.db.migration.version.v67;
+
+import java.sql.SQLException;
+import org.sonar.db.Database;
+import org.sonar.server.platform.db.migration.def.VarcharColumnDef;
+import org.sonar.server.platform.db.migration.sql.AlterColumnsBuilder;
+import org.sonar.server.platform.db.migration.step.DdlChange;
+
+public class UpdateCeTaskUuidColumnToNullableOnWebhookDeliveries extends DdlChange {
+
+ public static final String TABLE_WEBHOOK_DELIVERIES = "webhook_deliveries";
+
+ public UpdateCeTaskUuidColumnToNullableOnWebhookDeliveries(Database db) {
+ super(db);
+ }
+
+ @Override
+ public void execute(Context context) throws SQLException {
+ context.execute(new AlterColumnsBuilder(getDialect(), TABLE_WEBHOOK_DELIVERIES)
+ .updateColumn(VarcharColumnDef.newVarcharColumnDefBuilder()
+ .setColumnName("ce_task_uuid")
+ .setLimit(40)
+ .setIsNullable(true)
+ .build())
+ .build());
+ }
+}
+++ /dev/null
-package org.sonar.server.platform.db.migration.version.v66;/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-import java.sql.SQLException;
-import java.util.List;
-import java.util.Map;
-import javax.annotation.Nullable;
-import org.apache.commons.lang.math.RandomUtils;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.ExpectedException;
-import org.sonar.db.CoreDbTester;
-
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.entry;
-
-public class PopulateAnalysisUuidColumnOnWebhookDeliveriesTest {
- private static final String TABLE_WEBHOOK_DELIVERY = "webhook_deliveries";
- private static final String TABLE_CE_ACTIVITIY = "ce_activity";
-
- @Rule
- public final CoreDbTester db = CoreDbTester.createForSchema(PopulateAnalysisUuidColumnOnWebhookDeliveriesTest.class, "initial.sql");
- @Rule
- public ExpectedException expectedException = ExpectedException.none();
-
- private PopulateAnalysisUuidColumnOnWebhookDeliveries underTest = new PopulateAnalysisUuidColumnOnWebhookDeliveries(db.database());
-
- @Test
- public void migration_must_set_analysis_uuid() throws SQLException {
- String ceTaskUuid = randomAlphanumeric(40);
- String analysisUuid = randomAlphanumeric(40);
- String webhookDeliveryUuid = randomAlphanumeric(40);
- insertWebhookDelivery(webhookDeliveryUuid,null, ceTaskUuid);
- insertCeActivity(ceTaskUuid, analysisUuid);
-
- assertThat(db.countRowsOfTable(TABLE_WEBHOOK_DELIVERY)).isEqualTo(1);
- assertThat(db.countRowsOfTable(TABLE_CE_ACTIVITIY)).isEqualTo(1);
- underTest.execute();
-
- List<Map<String, Object>> maps = selectAllWebhookDeliveries();
- assertThat(maps).hasSize(1);
- assertThat(maps.get(0)).containsExactly(
- entry("ANALYSIS_UUID", analysisUuid), entry("UUID", webhookDeliveryUuid), entry("CE_TASK_UUID", ceTaskUuid));
- }
-
- @Test
- public void migration_should_be_reentrant() throws SQLException {
- for (int i = 0; i < 10; i++) {
- insertWebhookDelivery(randomAlphanumeric(40),null, randomAlphanumeric(40));
- insertCeActivity(randomAlphanumeric(40), randomAlphanumeric(40));
- }
-
- underTest.execute();
- List<Map<String, Object>> firstExecutionResult = selectAllWebhookDeliveries();
- underTest.execute();
- assertThat(selectAllWebhookDeliveries()).isEqualTo(firstExecutionResult);
- }
-
- private List<Map<String, Object>> selectAllWebhookDeliveries() {
- return db.select("select uuid, ce_task_uuid, analysis_uuid from webhook_deliveries");
- }
-
- private void insertCeActivity(String uuid, String analysisUuid) {
- db.executeInsert(TABLE_CE_ACTIVITIY,
- "UUID", uuid,
- "TASK_TYPE", randomAlphanumeric(5),
- "ANALYSIS_UUID", analysisUuid,
- "STATUS", randomAlphanumeric(5),
- "IS_LAST", RandomUtils.nextBoolean(),
- "IS_LAST_KEY", randomAlphanumeric(50),
- "EXECUTION_COUNT", RandomUtils.nextInt(10),
- "SUBMITTED_AT", RandomUtils.nextInt(),
- "CREATED_AT", RandomUtils.nextInt(),
- "UPDATED_AT", RandomUtils.nextInt()
- );
- }
-
- private void insertWebhookDelivery(String uuid, @Nullable String analysisUuid, String ceTaskUuid) {
- db.executeInsert(TABLE_WEBHOOK_DELIVERY,
- "UUID", uuid,
- "COMPONENT_UUID", randomAlphanumeric(30),
- "ANALYSIS_UUID", analysisUuid,
- "CE_TASK_UUID", ceTaskUuid,
- "NAME", randomAlphanumeric(15),
- "URL", randomAlphanumeric(15),
- "SUCCESS", RandomUtils.nextBoolean(),
- "PAYLOAD", randomAlphanumeric(200),
- "CREATED_AT", RandomUtils.nextInt()
- );
- }
-}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-package org.sonar.server.platform.db.migration.version.v66;
-
-import java.sql.SQLException;
-import java.sql.Types;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.ExpectedException;
-import org.sonar.db.CoreDbTester;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class UpdateCeTaskUuidColumnToNullableOnWebhookDeliveriesTest {
- private static final String TABLE = "webhook_deliveries";
-
- @Rule
- public final CoreDbTester db = CoreDbTester.createForSchema(UpdateCeTaskUuidColumnToNullableOnWebhookDeliveriesTest.class, "initial.sql");
- @Rule
- public ExpectedException expectedException = ExpectedException.none();
-
- private UpdateCeTaskUuidColumnToNullableOnWebhookDeliveries underTest = new UpdateCeTaskUuidColumnToNullableOnWebhookDeliveries(db.database());
-
- @Test
- public void update_column() throws SQLException {
- underTest.execute();
-
- assertThat(db.countRowsOfTable(TABLE)).isEqualTo(0);
- db.assertColumnDefinition(TABLE, "ce_task_uuid", Types.VARCHAR, 40, true);
- db.assertColumnDefinition(TABLE, "analysis_uuid", Types.VARCHAR, 40, true);
- }
-
- @Test
- public void migration_is_reentrant() throws SQLException {
- underTest.execute();
- underTest.execute();
- }
-}
@Test
public void verify_migration_count() {
- verifyMigrationCount(underTest, 4);
+ verifyMigrationCount(underTest, 6);
}
}
--- /dev/null
+package org.sonar.server.platform.db.migration.version.v67;/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import java.sql.SQLException;
+import java.util.List;
+import java.util.Map;
+import javax.annotation.Nullable;
+import org.apache.commons.lang.math.RandomUtils;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.sonar.db.CoreDbTester;
+
+import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.entry;
+
+public class PopulateAnalysisUuidColumnOnWebhookDeliveriesTest {
+ private static final String TABLE_WEBHOOK_DELIVERY = "webhook_deliveries";
+ private static final String TABLE_CE_ACTIVITIY = "ce_activity";
+
+ @Rule
+ public final CoreDbTester db = CoreDbTester.createForSchema(PopulateAnalysisUuidColumnOnWebhookDeliveriesTest.class, "initial.sql");
+ @Rule
+ public ExpectedException expectedException = ExpectedException.none();
+
+ private PopulateAnalysisUuidColumnOnWebhookDeliveries underTest = new PopulateAnalysisUuidColumnOnWebhookDeliveries(db.database());
+
+ @Test
+ public void migration_must_set_analysis_uuid() throws SQLException {
+ String ceTaskUuid = randomAlphanumeric(40);
+ String analysisUuid = randomAlphanumeric(40);
+ String webhookDeliveryUuid = randomAlphanumeric(40);
+ insertWebhookDelivery(webhookDeliveryUuid,null, ceTaskUuid);
+ insertCeActivity(ceTaskUuid, analysisUuid);
+
+ assertThat(db.countRowsOfTable(TABLE_WEBHOOK_DELIVERY)).isEqualTo(1);
+ assertThat(db.countRowsOfTable(TABLE_CE_ACTIVITIY)).isEqualTo(1);
+ underTest.execute();
+
+ List<Map<String, Object>> maps = selectAllWebhookDeliveries();
+ assertThat(maps).hasSize(1);
+ assertThat(maps.get(0)).containsExactly(
+ entry("ANALYSIS_UUID", analysisUuid), entry("UUID", webhookDeliveryUuid), entry("CE_TASK_UUID", ceTaskUuid));
+ }
+
+ @Test
+ public void migration_should_be_reentrant() throws SQLException {
+ for (int i = 0; i < 10; i++) {
+ insertWebhookDelivery(randomAlphanumeric(40),null, randomAlphanumeric(40));
+ insertCeActivity(randomAlphanumeric(40), randomAlphanumeric(40));
+ }
+
+ underTest.execute();
+ List<Map<String, Object>> firstExecutionResult = selectAllWebhookDeliveries();
+ underTest.execute();
+ assertThat(selectAllWebhookDeliveries()).isEqualTo(firstExecutionResult);
+ }
+
+ private List<Map<String, Object>> selectAllWebhookDeliveries() {
+ return db.select("select uuid, ce_task_uuid, analysis_uuid from webhook_deliveries");
+ }
+
+ private void insertCeActivity(String uuid, String analysisUuid) {
+ db.executeInsert(TABLE_CE_ACTIVITIY,
+ "UUID", uuid,
+ "TASK_TYPE", randomAlphanumeric(5),
+ "ANALYSIS_UUID", analysisUuid,
+ "STATUS", randomAlphanumeric(5),
+ "IS_LAST", RandomUtils.nextBoolean(),
+ "IS_LAST_KEY", randomAlphanumeric(50),
+ "EXECUTION_COUNT", RandomUtils.nextInt(10),
+ "SUBMITTED_AT", RandomUtils.nextInt(),
+ "CREATED_AT", RandomUtils.nextInt(),
+ "UPDATED_AT", RandomUtils.nextInt()
+ );
+ }
+
+ private void insertWebhookDelivery(String uuid, @Nullable String analysisUuid, String ceTaskUuid) {
+ db.executeInsert(TABLE_WEBHOOK_DELIVERY,
+ "UUID", uuid,
+ "COMPONENT_UUID", randomAlphanumeric(30),
+ "ANALYSIS_UUID", analysisUuid,
+ "CE_TASK_UUID", ceTaskUuid,
+ "NAME", randomAlphanumeric(15),
+ "URL", randomAlphanumeric(15),
+ "SUCCESS", RandomUtils.nextBoolean(),
+ "PAYLOAD", randomAlphanumeric(200),
+ "CREATED_AT", RandomUtils.nextInt()
+ );
+ }
+}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+package org.sonar.server.platform.db.migration.version.v67;
+
+import java.sql.SQLException;
+import java.sql.Types;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.sonar.db.CoreDbTester;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class UpdateCeTaskUuidColumnToNullableOnWebhookDeliveriesTest {
+ private static final String TABLE = "webhook_deliveries";
+
+ @Rule
+ public final CoreDbTester db = CoreDbTester.createForSchema(UpdateCeTaskUuidColumnToNullableOnWebhookDeliveriesTest.class, "initial.sql");
+ @Rule
+ public ExpectedException expectedException = ExpectedException.none();
+
+ private UpdateCeTaskUuidColumnToNullableOnWebhookDeliveries underTest = new UpdateCeTaskUuidColumnToNullableOnWebhookDeliveries(db.database());
+
+ @Test
+ public void update_column() throws SQLException {
+ underTest.execute();
+
+ assertThat(db.countRowsOfTable(TABLE)).isEqualTo(0);
+ db.assertColumnDefinition(TABLE, "ce_task_uuid", Types.VARCHAR, 40, true);
+ db.assertColumnDefinition(TABLE, "analysis_uuid", Types.VARCHAR, 40, true);
+ }
+
+ @Test
+ public void migration_is_reentrant() throws SQLException {
+ underTest.execute();
+ underTest.execute();
+ }
+}
+++ /dev/null
-CREATE TABLE "CE_ACTIVITY" (
- "ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
- "UUID" VARCHAR(40) NOT NULL,
- "TASK_TYPE" VARCHAR(15) NOT NULL,
- "COMPONENT_UUID" VARCHAR(40) NULL,
- "ANALYSIS_UUID" VARCHAR(50) NULL,
- "STATUS" VARCHAR(15) NOT NULL,
- "IS_LAST" BOOLEAN NOT NULL,
- "IS_LAST_KEY" VARCHAR(55) NOT NULL,
- "SUBMITTER_LOGIN" VARCHAR(255) NULL,
- "WORKER_UUID" VARCHAR(40) NULL,
- "EXECUTION_COUNT" INTEGER NOT NULL,
- "SUBMITTED_AT" BIGINT NOT NULL,
- "STARTED_AT" BIGINT NULL,
- "EXECUTED_AT" BIGINT NULL,
- "CREATED_AT" BIGINT NOT NULL,
- "UPDATED_AT" BIGINT NOT NULL,
- "EXECUTION_TIME_MS" BIGINT NULL,
- "ERROR_MESSAGE" VARCHAR(1000),
- "ERROR_STACKTRACE" CLOB(2147483647)
-);
-
-CREATE UNIQUE INDEX "CE_ACTIVITY_UUID" ON "CE_ACTIVITY" ("UUID");
-CREATE INDEX "CE_ACTIVITY_COMPONENT_UUID" ON "CE_ACTIVITY" ("COMPONENT_UUID");
-CREATE INDEX "CE_ACTIVITY_ISLASTKEY" ON "CE_ACTIVITY" ("IS_LAST_KEY");
-CREATE INDEX "CE_ACTIVITY_ISLAST_STATUS" ON "CE_ACTIVITY" ("IS_LAST", "STATUS");
-
-
-CREATE TABLE "WEBHOOK_DELIVERIES" (
- "UUID" VARCHAR(40) NOT NULL PRIMARY KEY,
- "COMPONENT_UUID" VARCHAR(40) NOT NULL,
- "ANALYSIS_UUID" VARCHAR(40),
- "CE_TASK_UUID" VARCHAR(40),
- "NAME" VARCHAR(100) NOT NULL,
- "URL" VARCHAR(2000) NOT NULL,
- "SUCCESS" BOOLEAN NOT NULL,
- "HTTP_STATUS" INT,
- "DURATION_MS" INT,
- "PAYLOAD" CLOB NOT NULL,
- "ERROR_STACKTRACE" CLOB,
- "CREATED_AT" BIGINT NOT NULL
-);
-CREATE UNIQUE INDEX "PK_WEBHOOK_DELIVERIES" ON "WEBHOOK_DELIVERIES" ("UUID");
-CREATE INDEX "COMPONENT_UUID" ON "WEBHOOK_DELIVERIES" ("COMPONENT_UUID");
-CREATE INDEX "CE_TASK_UUID" ON "WEBHOOK_DELIVERIES" ("CE_TASK_UUID");
-CREATE INDEX "ANALYSES_UUID" ON "WEBHOOK_DELIVERIES" ("ANALYSIS_UUID");
+++ /dev/null
-CREATE TABLE "WEBHOOK_DELIVERIES" (
- "UUID" VARCHAR(40) NOT NULL PRIMARY KEY,
- "COMPONENT_UUID" VARCHAR(40) NOT NULL,
- "ANALYSIS_UUID" VARCHAR(40) NULL,
- "CE_TASK_UUID" VARCHAR(40) NOT NULL,
- "NAME" VARCHAR(100) NOT NULL,
- "URL" VARCHAR(2000) NOT NULL,
- "SUCCESS" BOOLEAN NOT NULL,
- "HTTP_STATUS" INT,
- "DURATION_MS" INT,
- "PAYLOAD" CLOB NOT NULL,
- "ERROR_STACKTRACE" CLOB,
- "CREATED_AT" BIGINT NOT NULL
-);
-CREATE UNIQUE INDEX "PK_WEBHOOK_DELIVERIES" ON "WEBHOOK_DELIVERIES" ("UUID");
-CREATE INDEX "COMPONENT_UUID" ON "WEBHOOK_DELIVERIES" ("COMPONENT_UUID");
-CREATE INDEX "CE_TASK_UUID" ON "WEBHOOK_DELIVERIES" ("CE_TASK_UUID");
--- /dev/null
+CREATE TABLE "CE_ACTIVITY" (
+ "ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
+ "UUID" VARCHAR(40) NOT NULL,
+ "TASK_TYPE" VARCHAR(15) NOT NULL,
+ "COMPONENT_UUID" VARCHAR(40) NULL,
+ "ANALYSIS_UUID" VARCHAR(50) NULL,
+ "STATUS" VARCHAR(15) NOT NULL,
+ "IS_LAST" BOOLEAN NOT NULL,
+ "IS_LAST_KEY" VARCHAR(55) NOT NULL,
+ "SUBMITTER_LOGIN" VARCHAR(255) NULL,
+ "WORKER_UUID" VARCHAR(40) NULL,
+ "EXECUTION_COUNT" INTEGER NOT NULL,
+ "SUBMITTED_AT" BIGINT NOT NULL,
+ "STARTED_AT" BIGINT NULL,
+ "EXECUTED_AT" BIGINT NULL,
+ "CREATED_AT" BIGINT NOT NULL,
+ "UPDATED_AT" BIGINT NOT NULL,
+ "EXECUTION_TIME_MS" BIGINT NULL,
+ "ERROR_MESSAGE" VARCHAR(1000),
+ "ERROR_STACKTRACE" CLOB(2147483647)
+);
+
+CREATE UNIQUE INDEX "CE_ACTIVITY_UUID" ON "CE_ACTIVITY" ("UUID");
+CREATE INDEX "CE_ACTIVITY_COMPONENT_UUID" ON "CE_ACTIVITY" ("COMPONENT_UUID");
+CREATE INDEX "CE_ACTIVITY_ISLASTKEY" ON "CE_ACTIVITY" ("IS_LAST_KEY");
+CREATE INDEX "CE_ACTIVITY_ISLAST_STATUS" ON "CE_ACTIVITY" ("IS_LAST", "STATUS");
+
+
+CREATE TABLE "WEBHOOK_DELIVERIES" (
+ "UUID" VARCHAR(40) NOT NULL PRIMARY KEY,
+ "COMPONENT_UUID" VARCHAR(40) NOT NULL,
+ "ANALYSIS_UUID" VARCHAR(40),
+ "CE_TASK_UUID" VARCHAR(40),
+ "NAME" VARCHAR(100) NOT NULL,
+ "URL" VARCHAR(2000) NOT NULL,
+ "SUCCESS" BOOLEAN NOT NULL,
+ "HTTP_STATUS" INT,
+ "DURATION_MS" INT,
+ "PAYLOAD" CLOB NOT NULL,
+ "ERROR_STACKTRACE" CLOB,
+ "CREATED_AT" BIGINT NOT NULL
+);
+CREATE UNIQUE INDEX "PK_WEBHOOK_DELIVERIES" ON "WEBHOOK_DELIVERIES" ("UUID");
+CREATE INDEX "COMPONENT_UUID" ON "WEBHOOK_DELIVERIES" ("COMPONENT_UUID");
+CREATE INDEX "CE_TASK_UUID" ON "WEBHOOK_DELIVERIES" ("CE_TASK_UUID");
+CREATE INDEX "ANALYSES_UUID" ON "WEBHOOK_DELIVERIES" ("ANALYSIS_UUID");
--- /dev/null
+CREATE TABLE "WEBHOOK_DELIVERIES" (
+ "UUID" VARCHAR(40) NOT NULL PRIMARY KEY,
+ "COMPONENT_UUID" VARCHAR(40) NOT NULL,
+ "ANALYSIS_UUID" VARCHAR(40) NULL,
+ "CE_TASK_UUID" VARCHAR(40) NOT NULL,
+ "NAME" VARCHAR(100) NOT NULL,
+ "URL" VARCHAR(2000) NOT NULL,
+ "SUCCESS" BOOLEAN NOT NULL,
+ "HTTP_STATUS" INT,
+ "DURATION_MS" INT,
+ "PAYLOAD" CLOB NOT NULL,
+ "ERROR_STACKTRACE" CLOB,
+ "CREATED_AT" BIGINT NOT NULL
+);
+CREATE UNIQUE INDEX "PK_WEBHOOK_DELIVERIES" ON "WEBHOOK_DELIVERIES" ("UUID");
+CREATE INDEX "COMPONENT_UUID" ON "WEBHOOK_DELIVERIES" ("COMPONENT_UUID");
+CREATE INDEX "CE_TASK_UUID" ON "WEBHOOK_DELIVERIES" ("CE_TASK_UUID");