Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
9d342113
Commit
9d342113
authored
9 years ago
by
Ruud Overeem
Browse files
Options
Downloads
Patches
Plain Diff
Task #8531: Added upgrade script to upgrade existing databases to the new format.
parent
b340fac5
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitattributes
+1
-0
1 addition, 0 deletions
.gitattributes
SAS/OTDB/sql/README!
+3
-0
3 additions, 0 deletions
SAS/OTDB/sql/README!
SAS/OTDB/sql/upgradeOTDB.sql
+4
-36
4 additions, 36 deletions
SAS/OTDB/sql/upgradeOTDB.sql
with
8 additions
and
36 deletions
.gitattributes
+
1
−
0
View file @
9d342113
...
...
@@ -4794,6 +4794,7 @@ SAS/OTDB/bin/momIDs -text
SAS/OTDB/bin/repairTree.py -text
SAS/OTDB/bin/revertDefaultTemplates.py -text
SAS/OTDB/include/OTDB/DefaultTemplate.h -text
SAS/OTDB/sql/README! -text
SAS/OTDB/sql/assignProcessType_func.sql -text
SAS/OTDB/sql/campaignAPI.sql -text
SAS/OTDB/sql/create_rules.sql -text
...
...
This diff is collapsed.
Click to expand it.
SAS/OTDB/sql/README!
0 → 100644
+
3
−
0
View file @
9d342113
This version needs a modification on the statehistory table.
please execute (with \i) the upgrade_OTDB.sql script to upgrade an existing database to the new format.
This diff is collapsed.
Click to expand it.
SAS/OTDB/sql/upgradeOTDB.sql
+
4
−
36
View file @
9d342113
-- add new columns to the tree metadata table
ALTER
TABLE
OTDBtree
ADD
COLUMN
modific
ation
Date
timestamp
(
0
)
DEFAULT
now
();
ALTER
TABLE
statehistory
ADD
COLUMN
cre
ation
timestamp
(
6
)
DEFAULT
now
();
-- Change treeInfo structure by adding 5 fields
DROP
TYPE
IF
EXISTS
treeInfo
CASCADE
;
CREATE
TYPE
treeInfo
AS
(
treeID
INT4
,
-- OTDBtree.treeID%TYPE,
momID
INT4
,
groupID
INT4
,
classification
INT2
,
-- classification.ID%TYPE,
creator
VARCHAR
(
20
),
-- OTDBuser.username%TYPE,
creationDate
timestamp
(
0
),
modificationDate
timestamp
(
0
),
type
INT2
,
-- treetype.ID%TYPE,
state
INT2
,
-- treestate.ID%TYPE,
originalTree
INT4
,
-- OTDBtree.treeID%TYPE,
campaign
VARCHAR
(
30
),
-- campaign.name%TYPE,
starttime
timestamp
(
0
),
stoptime
timestamp
(
0
),
processType
VARCHAR
(
20
),
processSubtype
VARCHAR
(
50
),
strategy
VARCHAR
(
30
),
description
TEXT
);
-- Reload the functions that where dropped.
\
i
getBrokenHardware_func
.
sql
\
i
getDefaultTemplates_func
.
sql
-- Reload modified functions
\
i
getTreeGroup_func
.
sql
\
i
getTreesInPeriod_func
.
sql
\
i
getTreeList_func
.
sql
\
i
getTreeInfo_func
.
sql
\
i
getExecutableTrees_func
.
sql
CREATE
INDEX
statehist_creation_idx
ON
statehistory
(
creation
);
-- Load new functions
\
i
create_rules
.
sql
\
i
getModifiedTrees_func
.
sql
\
i
getStateChanges
.
sql
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment