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
11e5e2fd
Commit
11e5e2fd
authored
16 years ago
by
tpylak
Browse files
Options
Downloads
Patches
Plain Diff
LMS-586 add second "if exists" check to fix bub in db migration to v023
SVN: 8316
parent
0bf326d7
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
openbis/source/sql/postgresql/migration/migration-025-026.sql
+13
-1
13 additions, 1 deletion
...bis/source/sql/postgresql/migration/migration-025-026.sql
with
13 additions
and
1 deletion
openbis/source/sql/postgresql/migration/migration-025-026.sql
+
13
−
1
View file @
11e5e2fd
...
@@ -19,7 +19,19 @@ ALTER TABLE SAMPLE_INPUTS ADD CONSTRAINT SAIN_PK PRIMARY KEY(SAMP_ID,PROC_ID);
...
@@ -19,7 +19,19 @@ ALTER TABLE SAMPLE_INPUTS ADD CONSTRAINT SAIN_PK PRIMARY KEY(SAMP_ID,PROC_ID);
-- Remove ID column from SAMPLE_MATERIAL_BATCHES table
-- Remove ID column from SAMPLE_MATERIAL_BATCHES table
DROP
SEQUENCE
SAMPLE_MATERIAL_BATCH_ID_SEQ
;
DROP
SEQUENCE
SAMPLE_MATERIAL_BATCH_ID_SEQ
;
ALTER
TABLE
SAMPLE_MATERIAL_BATCHES
DROP
CONSTRAINT
SAMB_PK
;
-- There was a bug in migration to db 23 - the constraint was not created. So we drop it only if it exists.
create
function
remove_samb_pk_constraint
()
returns
void
AS
$$
begin
perform
*
FROM
information_schema
.
table_constraints
WHERE
constraint_name
=
'SAMB_PK'
;
if
found
then
end
if
;
end
;
$$
language
'plpgsql'
;
select
remove_samb_pk_constraint
();
drop
function
remove_samb_pk_constraint
();
ALTER
TABLE
SAMPLE_MATERIAL_BATCHES
DROP
COLUMN
ID
;
ALTER
TABLE
SAMPLE_MATERIAL_BATCHES
DROP
COLUMN
ID
;
ALTER
TABLE
SAMPLE_MATERIAL_BATCHES
ADD
CONSTRAINT
SAMB_PK
PRIMARY
KEY
(
SAMP_ID
,
MABA_ID
);
ALTER
TABLE
SAMPLE_MATERIAL_BATCHES
ADD
CONSTRAINT
SAMB_PK
PRIMARY
KEY
(
SAMP_ID
,
MABA_ID
);
...
...
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