Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LHCbDIRAC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Anton Lu
LHCbDIRAC
Commits
e294a096
Commit
e294a096
authored
7 years ago
by
Zoltan Mathe
Browse files
Options
Downloads
Plain Diff
Merge branch 'devel_branch' into 'devel'
change the db schema See merge request !340
parents
3e6baa19
57848138
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
LHCbDIRAC/BookkeepingSystem/DB/oracle_schema_commands.sql
+6
-5
6 additions, 5 deletions
LHCbDIRAC/BookkeepingSystem/DB/oracle_schema_commands.sql
LHCbDIRAC/BookkeepingSystem/DB/oracle_schema_storedprocedures.sql
+6
-4
6 additions, 4 deletions
...C/BookkeepingSystem/DB/oracle_schema_storedprocedures.sql
with
12 additions
and
9 deletions
LHCbDIRAC/BookkeepingSystem/DB/oracle_schema_commands.sql
+
6
−
5
View file @
e294a096
...
...
@@ -121,21 +121,22 @@ alter table jobs ADD CONSTRAINT FK_Prodcont_prod FOREIGN KEY(production) REFEREN
ALTER
TABLE
jobs
ADD
HLT2TCK
varchar2
(
20
);
DROP
TABLE
productionoutputfiles
CASCADE
constraints
;
create
table
productionoutputfiles
(
Production
NUMBER
,
stepid
number
,
filetype
varchar2
(
256
),
eventtypeid
number
,
filetypeid
number
,
visible
char
(
1
)
default
'Y'
,
CONSTRAINT
PK_productionoutputfiles_p
PRIMARY
KEY
(
Production
,
stepid
,
filetyp
e
),
CONSTRAINT
PK_productionoutputfiles_p
PRIMARY
KEY
(
Production
,
filetypeid
,
eventtypeid
,
visibl
e
),
CONSTRAINT
FK_productionoutputfiles_steps
FOREIGN
KEY
(
stepid
)
REFERENCES
steps
(
stepid
),
CONSTRAINT
FK_productionoutputfiles_evt
FOREIGN
KEY
(
eventtypeid
)
REFERENCES
eventtypes
(
eventtypeid
),
CONSTRAINT
FK_productionoutputfiles_ft
FOREIGN
KEY
(
filetypeid
)
REFERENCES
filetypes
(
filetypeid
),
CONSTRAINT
FK_productionoutputfiles_prod
FOREIGN
KEY
(
production
)
REFERENCES
productionscontainer
(
production
)
ON
DELETE
CASCADE
ENABLE
);
grant
select
on
productionoutputfiles
to
LHCB_DIRACBOOKKEEPING_USERS
;
grant
select
,
insert
,
update
on
productionoutputfiles
to
LHCB_DIRACBOOKKEEPING_SERVER
;
CREATE
SYNONYM
productionoutputfiles
FOR
LHCB_DIRACBOOKKEEPING
.
productionoutputfiles
;
alter
table
productionoutputfiles
add
eventtypeid
number
;
alter
table
productionoutputfiles
add
constraint
fk_prodoutput_eventtypeid
FOREIGN
KEY
(
eventtypeid
)
references
eventtypes
(
eventtypeid
);
ALTER
TABLE
stepscontainer
DROP
CONSTRAINT
FK_STEPSCONTAINER_EVENTTYPEID
;
ALTER
TABLE
stepscontainer
DROP
column
eventtypeid
;
\ No newline at end of file
This diff is collapsed.
Click to expand it.
LHCbDIRAC/BookkeepingSystem/DB/oracle_schema_storedprocedures.sql
+
6
−
4
View file @
e294a096
...
...
@@ -224,7 +224,7 @@ procedure getFileDesJobId(v_Filename varchar2, a_Cursor out udt_RefCursor);
procedure
getAllMetadata
(
v_jobid
NUMBER
,
v_prod
number
,
a_Cursor
out
udt_RefCursor
);
function
getProducedEvents
(
v_prodid
number
)
return
number
;
procedure
bulkgetIdsFromFiles
(
lfns
varchararray
,
a_Cursor
out
udt_RefCursor
);
PROCEDURE
insertProdnOutputFtypes
(
v_production
number
,
v_stepid
number
,
v_filetype
varchar2
,
v_visible
char
,
v_eventtype
varchar2
);
PROCEDURE
insertProdnOutputFtypes
(
v_production
number
,
v_stepid
number
,
v_filetype
id
number
,
v_visible
char
,
v_eventtype
number
);
end
;
/
...
...
@@ -2296,13 +2296,15 @@ FOR i in lfns.FIRST .. lfns.LAST LOOP
open
a_Cursor
for
select
FILENAME
,
jobid
,
fileid
,
filetypeid
from
table
(
lfnmeta
);
END
;
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
PROCEDURE
insertProdnOutputFtypes
(
v_production
number
,
v_stepid
number
,
v_filetype
varchar2
,
v_visible
char
,
v_eventtype
varchar2
)
IS
PROCEDURE
insertProdnOutputFtypes
(
v_production
number
,
v_stepid
number
,
v_filetype
id
number
,
v_visible
char
,
v_eventtype
number
)
IS
BEGIN
INSERT
INTO
productionoutputfiles
(
production
,
stepid
,
filetype
,
visible
,
eventtypeid
)
VALUES
(
v_production
,
v_stepid
,
v_filetype
,
v_visible
,
v_eventtype
);
INSERT
INTO
productionoutputfiles
(
production
,
stepid
,
filetype
id
,
visible
,
eventtypeid
)
VALUES
(
v_production
,
v_stepid
,
v_filetype
id
,
v_visible
,
v_eventtype
);
COMMIT
;
EXCEPTION
WHEN
DUP_VAL_ON_INDEX
THEN
UPDATE
productionoutputfiles
SET
stepid
=
v_stepid
,
filetype
=
v_filetype
,
visible
=
v_visible
,
eventtypeid
=
v_eventtype
WHERE
production
=
v_production
;
DBMS_OUTPUT
.
put_line
(
'EXISTS:'
||
v_production
||
'->'
||
v_stepid
||
'->'
||
v_filetypeid
||
'->'
||
v_visible
||
'->'
||
v_eventtype
);
--NOT: If the production is already in the table, we only change the step!!!
UPDATE
productionoutputfiles
SET
stepid
=
v_stepid
WHERE
production
=
v_production
and
filetypeid
=
v_filetypeid
and
visible
=
v_visible
and
eventtypeid
=
v_eventtype
;
END
;
END
;
...
...
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