Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-cost
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
project-open
intranet-cost
Commits
79be0773
Commit
79be0773
authored
May 05, 2020
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Added upgrade script
parent
e685a906
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
upgrade-5.0.3.0.1-5.0.3.0.2.sql
sql/postgresql/upgrade/upgrade-5.0.3.0.1-5.0.3.0.2.sql
+41
-0
No files found.
sql/postgresql/upgrade/upgrade-5.0.3.0.1-5.0.3.0.2.sql
0 → 100644
View file @
79be0773
-- 5.0.2.3.5-5.0.2.3.6.sql
SELECT
acs_log__debug
(
'/packages/intranet-cost/sql/postgresql/upgrade/upgrade-5.0.2.3.5-5.0.2.3.6.sql'
,
''
);
-- Delete a single cost (if we know its ID...)
create
or
replace
function
im_cost__delete
(
integer
)
returns
integer
as
$$
DECLARE
p_cost_id
alias
for
$
1
;
begin
-- Update im_hours relationship
update
im_hours
set
cost_id
=
null
where
cost_id
=
p_cost_id
;
-- Erase payments related to this cost item
delete
from
im_payments
where
cost_id
=
p_cost_id
;
-- Erase the im_cost
delete
from
im_costs
where
cost_id
=
p_cost_id
;
-- Erase the im_cost
delete
from
im_biz_objects
where
object_id
=
p_cost_id
;
-- Erase the acs_rels entries pointing to this cost item
delete
from
acs_rels
where
object_id_two
=
p_cost_id
;
delete
from
acs_rels
where
object_id_one
=
p_cost_id
;
delete
from
acs_permissions
where
object_id
=
p_cost_id
;
-- Erase the object
PERFORM
acs_object__delete
(
p_cost_id
);
return
0
;
end
;
$$
language
'plpgsql'
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment