Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
f56f0c2e
Commit
f56f0c2e
authored
14 years ago
by
tpylak
Browse files
Options
Downloads
Patches
Plain Diff
add feature vector migration (I need it for my test db)
SVN: 16554
parent
eadda6a8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
screening/source/sql/postgresql/migration/migration-001-002.sql
+40
-0
40 additions, 0 deletions
...ing/source/sql/postgresql/migration/migration-001-002.sql
with
40 additions
and
0 deletions
screening/source/sql/postgresql/migration/migration-001-002.sql
+
40
−
0
View file @
f56f0c2e
...
...
@@ -7,3 +7,43 @@ update images as img set path = (select images_directory
||
'/'
||
path
where
path
not
like
'%:%'
;
alter
table
data_sets
drop
column
images_directory
;
/* ---------------------------------------------------------------------- */
/* FEATURE VECTORS */
/* ---------------------------------------------------------------------- */
CREATE
TABLE
FEATURE_DEFS
(
ID
BIGSERIAL
NOT
NULL
,
NAME
NAME
NOT
NULL
,
DESCRIPTION
DESCRIPTION
,
DS_ID
TECH_ID
NOT
NULL
,
PRIMARY
KEY
(
ID
),
CONSTRAINT
FK_FEATURE_DEFS_1
FOREIGN
KEY
(
DS_ID
)
REFERENCES
DATA_SETS
(
ID
)
ON
DELETE
CASCADE
ON
UPDATE
CASCADE
,
CONSTRAINT
FEATURE_DEFS_UK_1
UNIQUE
(
NAME
,
DS_ID
)
);
CREATE
INDEX
FEATURE_DEFS_DS_IDX
ON
FEATURE_DEFS
(
DS_ID
);
CREATE
TABLE
FEATURE_VALUES
(
ID
BIGSERIAL
NOT
NULL
,
-- we use the fixed dimension meters here
Z_in_M
REAL
,
-- we use the fixed dimension seconds here
T_in_SEC
REAL
,
-- serialized 2D matrix with values for each spot
VALUES
BYTEA
NOT
NULL
,
FD_ID
TECH_ID
NOT
NULL
,
PRIMARY
KEY
(
ID
),
CONSTRAINT
FK_FEATURE_VALUES_1
FOREIGN
KEY
(
FD_ID
)
REFERENCES
FEATURE_DEFS
(
ID
)
ON
DELETE
CASCADE
ON
UPDATE
CASCADE
-- This constaint does not make any sense. Leave it out for now.
-- CONSTRAINT FEATURE_VALUES_UK_1 UNIQUE(Z_in_M, T_in_SEC)
);
CREATE
INDEX
FEATURE_VALUES_FD_IDX
ON
FEATURE_VALUES
(
FD_ID
);
CREATE
INDEX
FEATURE_VALUES_Z_AND_T_IDX
ON
FEATURE_VALUES
(
Z_in_M
,
T_in_SEC
);
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