Skip to content
Browse files

Issue #2363: add SQL instruction to create the MigrationEventLog tabl…

…e and the corresponding migration schema
  • Loading branch information...
1 parent 22ffb23 commit 21e1722eb7a148bbfe6d750b1d97546f615c333b @fanf fanf committed Mar 9, 2012
View
49 rudder-core/src/main/resources/Migration/dbMigration-2.3-2.4-add-MigrationEventLog-table.sql
@@ -0,0 +1,49 @@
+/*
+*************************************************************************************
+* Copyright 2012 Normation SAS
+*************************************************************************************
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Affero General Public License as
+* published by the Free Software Foundation, either version 3 of the
+* License, or (at your option) any later version.
+*
+* In accordance with the terms of section 7 (7. Additional Terms.) of
+* the GNU Affero GPL v3, the copyright holders add the following
+* Additional permissions:
+* Notwithstanding to the terms of section 5 (5. Conveying Modified Source
+* Versions) and 6 (6. Conveying Non-Source Forms.) of the GNU Affero GPL v3
+* licence, when you create a Related Module, this Related Module is
+* not considered as a part of the work and may be distributed under the
+* license agreement of your choice.
+* A "Related Module" means a set of sources files including their
+* documentation that, without modification of the Source Code, enables
+* supplementary functions or services in addition to those offered by
+* the Software.
+*
+* 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 Affero General Public License for more details.
+*
+* You should have received a copy of the GNU Affero General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/agpl.html>.
+*
+*************************************************************************************
+*/
+
+-- Migration script of the databases from Rudder 2.3 to 2.4
+-- Add datatable MigrationEventLog (and sequence MigrationEventLogId)
+-- so that we can trave EventLog migration status
+
+create sequence MigrationEventLogId start 1;
+
+CREATE TABLE MigrationEventLog(
+ id integer PRIMARY KEY default(nextval('MigrationEventLogId'))
+, detectionTime timestamp with time zone NOT NULL
+, detectedFileFormat integer
+, migrationStartTime timestamp with time zone
+, migrationEndTime timestamp with time zone
+, migrationFileFormat integer
+, description text
+);
View
12 rudder-core/src/main/resources/reportsSchema.sql
@@ -224,4 +224,14 @@ endTime timestamp with time zone
create index nodes_id_start on Nodes (nodeId, startTime);
create index nodes_end on Nodes (endTime);
-
+create sequence MigrationEventLogId start 1;
+
+CREATE TABLE MigrationEventLog(
+ id integer PRIMARY KEY default(nextval('MigrationEventLogId'))
+, detectionTime timestamp with time zone NOT NULL
+, detectedFileFormat integer
+, migrationStartTime timestamp with time zone
+, migrationEndTime timestamp with time zone
+, migrationFileFormat integer
+, description text
+);

0 comments on commit 21e1722

Please sign in to comment.
Something went wrong with that request. Please try again.