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
0bf326d7
Commit
0bf326d7
authored
16 years ago
by
tpylak
Browse files
Options
Downloads
Patches
Plain Diff
LMS-586 add "if exists" check to fix bub in db migration to v023
SVN: 8315
parent
0873c0dc
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 @
0bf326d7
-- JAVA ch.systemsx.cisd.lims.server.dataaccess.migration.MigrationStepFrom025To026
-- Remove ID column from SAMPLE_INPUTS table
DROP
SEQUENCE
SAMPLE_INPUT_ID_SEQ
;
ALTER
TABLE
SAMPLE_INPUTS
DROP
CONSTRAINT
SAIN_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_sain_pk_constraint
()
returns
void
AS
$$
begin
perform
*
FROM
information_schema
.
table_constraints
WHERE
constraint_name
=
'sain_pk'
;
if
found
then
ALTER
TABLE
SAMPLE_INPUTS
DROP
CONSTRAINT
SAIN_PK
;
end
if
;
end
;
$$
language
'plpgsql'
;
select
remove_sain_pk_constraint
();
drop
function
remove_sain_pk_constraint
();
ALTER
TABLE
SAMPLE_INPUTS
DROP
COLUMN
ID
;
ALTER
TABLE
SAMPLE_INPUTS
ADD
CONSTRAINT
SAIN_PK
PRIMARY
KEY
(
SAMP_ID
,
PROC_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