Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe
Commits:
-
5a81d27c
by tchemit at 2019-09-12T10:27:45Z
9 changed files:
- + persistence/src/main/java/fr/ird/observe/persistence/migration/DataSourceMigrationForVersion_7_2.java
- + persistence/src/main/resources/db/migration/7.2/01_fix_trip_longline_comment-H2.sql
- + persistence/src/main/resources/db/migration/7.2/01_fix_trip_longline_comment-PG.sql
- pom.xml
- + test/src/main/resources/db/7.2/dataForTestLongline.sql.gz
- + test/src/main/resources/db/7.2/dataForTestSeine.sql.gz
- + test/src/main/resources/db/7.2/empty_h2.sql.gz
- + test/src/main/resources/db/7.2/empty_pg.sql.gz
- + test/src/main/resources/db/7.2/referentiel.sql.gz
Changes:
| 1 |
+package fr.ird.observe.persistence.migration;
|
|
| 2 |
+ |
|
| 3 |
+/*-
|
|
| 4 |
+ * #%L
|
|
| 5 |
+ * ObServe :: Persistence
|
|
| 6 |
+ * %%
|
|
| 7 |
+ * Copyright (C) 2008 - 2019 IRD, Code Lutin, Ultreia.io
|
|
| 8 |
+ * %%
|
|
| 9 |
+ * This program is free software: you can redistribute it and/or modify
|
|
| 10 |
+ * it under the terms of the GNU General Public License as
|
|
| 11 |
+ * published by the Free Software Foundation, either version 3 of the
|
|
| 12 |
+ * License, or (at your option) any later version.
|
|
| 13 |
+ *
|
|
| 14 |
+ * This program is distributed in the hope that it will be useful,
|
|
| 15 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 16 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 17 |
+ * GNU General Public License for more details.
|
|
| 18 |
+ *
|
|
| 19 |
+ * You should have received a copy of the GNU General Public
|
|
| 20 |
+ * License along with this program. If not, see
|
|
| 21 |
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 22 |
+ * #L%
|
|
| 23 |
+ */
|
|
| 24 |
+ |
|
| 25 |
+import com.google.auto.service.AutoService;
|
|
| 26 |
+import org.nuiton.topia.service.migration.resources.MigrationVersionResource;
|
|
| 27 |
+import org.nuiton.topia.service.migration.resources.MigrationVersionResourceExecutor;
|
|
| 28 |
+import org.nuiton.version.Versions;
|
|
| 29 |
+ |
|
| 30 |
+@AutoService(MigrationVersionResource.class)
|
|
| 31 |
+public class DataSourceMigrationForVersion_7_2 extends MigrationVersionResource {
|
|
| 32 |
+ |
|
| 33 |
+ public DataSourceMigrationForVersion_7_2() {
|
|
| 34 |
+ super(Versions.valueOf("7.2"));
|
|
| 35 |
+ }
|
|
| 36 |
+ |
|
| 37 |
+ @Override
|
|
| 38 |
+ public void generateSqlScript(MigrationVersionResourceExecutor executor) {
|
|
| 39 |
+ executor.addScript("01", "fix_trip_longline_comment");
|
|
| 40 |
+ }
|
|
| 41 |
+ |
|
| 42 |
+}
|
|
| 43 |
+ |
| 1 |
+---
|
|
| 2 |
+-- #%L
|
|
| 3 |
+-- ObServe :: Persistence
|
|
| 4 |
+-- %%
|
|
| 5 |
+-- Copyright (C) 2008 - 2019 IRD, Code Lutin, Ultreia.io
|
|
| 6 |
+-- %%
|
|
| 7 |
+-- This program is free software: you can redistribute it and/or modify
|
|
| 8 |
+-- it under the terms of the GNU General Public License as
|
|
| 9 |
+-- published by the Free Software Foundation, either version 3 of the
|
|
| 10 |
+-- License, or (at your option) any later version.
|
|
| 11 |
+--
|
|
| 12 |
+-- This program is distributed in the hope that it will be useful,
|
|
| 13 |
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 14 |
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 15 |
+-- GNU General Public License for more details.
|
|
| 16 |
+--
|
|
| 17 |
+-- You should have received a copy of the GNU General Public
|
|
| 18 |
+-- License along with this program. If not, see
|
|
| 19 |
+-- <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 20 |
+-- #L%
|
|
| 21 |
+---
|
|
| 22 |
+ALTER TABLE observe_longline.trip ADD COLUMN comment2 VARCHAR(1025);
|
|
| 23 |
+UPDATE observe_longline.trip set comment2 = comment;
|
|
| 24 |
+ALTER TABLE observe_longline.trip DROP COLUMN comment;
|
|
| 25 |
+ALTER TABLE observe_longline.trip comment2 RENAME TO comment;
|
| 1 |
+---
|
|
| 2 |
+-- #%L
|
|
| 3 |
+-- ObServe :: Persistence
|
|
| 4 |
+-- %%
|
|
| 5 |
+-- Copyright (C) 2008 - 2019 IRD, Code Lutin, Ultreia.io
|
|
| 6 |
+-- %%
|
|
| 7 |
+-- This program is free software: you can redistribute it and/or modify
|
|
| 8 |
+-- it under the terms of the GNU General Public License as
|
|
| 9 |
+-- published by the Free Software Foundation, either version 3 of the
|
|
| 10 |
+-- License, or (at your option) any later version.
|
|
| 11 |
+--
|
|
| 12 |
+-- This program is distributed in the hope that it will be useful,
|
|
| 13 |
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
| 14 |
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
| 15 |
+-- GNU General Public License for more details.
|
|
| 16 |
+--
|
|
| 17 |
+-- You should have received a copy of the GNU General Public
|
|
| 18 |
+-- License along with this program. If not, see
|
|
| 19 |
+-- <http://www.gnu.org/licenses/gpl-3.0.html>.
|
|
| 20 |
+-- #L%
|
|
| 21 |
+---
|
|
| 22 |
+ALTER TABLE observe_longline.trip ADD COLUMN comment2 VARCHAR(1025);
|
|
| 23 |
+UPDATE observe_longline.trip set comment2 = comment;
|
|
| 24 |
+ALTER TABLE observe_longline.trip DROP COLUMN comment CASCADE;
|
|
| 25 |
+ALTER TABLE observe_longline.trip RENAME comment2 TO comment;
|
| ... | ... | @@ -149,7 +149,7 @@ |
| 149 | 149 |
<devMode>true</devMode>
|
| 150 | 150 |
|
| 151 | 151 |
<!--persistence model version-->
|
| 152 |
- <observe.model.version>7.1</observe.model.version>
|
|
| 152 |
+ <observe.model.version>7.2</observe.model.version>
|
|
| 153 | 153 |
|
| 154 | 154 |
<!-- build timestamp configuration -->
|
| 155 | 155 |
<maven.build.timestamp.format>dd/MM/yyyy HH:mm z</maven.build.timestamp.format>
|
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type