Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-timesheet2
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
1
Merge Requests
1
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-timesheet2
Commits
e13f5066
Commit
e13f5066
authored
Jan 17, 2007
by
Christof Damian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- remove timesheet1 when timesheet2 is installed
- don't try to recreate timesheet1 data
parent
6d78028e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
1 deletion
+77
-1
intranet-timesheet2-create.sql
sql/postgresql/intranet-timesheet2-create.sql
+77
-1
No files found.
sql/postgresql/intranet-timesheet2-create.sql
View file @
e13f5066
...
...
@@ -16,12 +16,66 @@
-- @author unknown@arsdigita.com
-- @author frank.bergmann@project-open.com
------------------------------------------------------------
-- delete timesheet1 instances
--
create
or
replace
function
inline_0
(
varchar
)
returns
integer
as
'
DECLARE
p_name alias for $1;
package apm_packages%ROWTYPE;
version apm_package_versions%ROWTYPE;
node site_nodes%ROWTYPE;
BEGIN
perform im_menu__del_module(p_name);
perform im_component_plugin__del_module(p_name);
FOR package IN
SELECT package_id FROM apm_packages WHERE package_key= p_name
LOOP
PERFORM apm_package__delete(package.package_id);
END LOOP;
FOR node IN
SELECT site_nodes.node_id
FROM apm_packages, site_nodes
WHERE apm_packages.package_id = site_nodes.object_id
AND apm_packages.package_key = p_name
LOOP
update site_nodes set object_id = null where node_id = node;
END LOOP;
DELETE from lang_message_keys where package_key = p_name;
PERFORM apm_package_type__drop_type( p_name,
''
t
''
);
RETURN 0;
END;
'
language
'plpgsql'
;
select
inline_0
(
'intranet-timesheet'
);
drop
function
inline_0
(
varchar
);
------------------------------------------------------------
-- Hours
--
-- We record logged hours of both project and client related work
--
create
or
replace
function
inline_0
()
returns
integer
as
'
declare
v_count integer;
begin
select count(*)
into v_count
from user_tab_columns
where table_name =
''
IM_HOURS
''
;
if v_count > 0 then
return 0;
end if;
create table im_hours (
user_id integer
constraint im_hours_user_id_nn
...
...
@@ -48,14 +102,36 @@ create index im_hours_project_id_idx on im_hours(project_id);
create index im_hours_user_id_idx on im_hours(user_id);
create index im_hours_day_idx on im_hours(day);
return 0;
end;'
language
'plpgsql'
;
select
inline_0
();
drop
function
inline_0
();
-- Add the sum of timesheet hours cached here for reporting
-- to the im_projects table
--
alter
table
im_projects
add
reported_hours_cache
float
;
create
or
replace
function
inline_0
()
returns
integer
as
'
declare
v_count integer;
begin
select count(*)
into v_count
from user_tab_columns
where table_name =
''
IM_PROJECTS
''
and column_name =
''
REPORTED_HOURS_CACHE
''
;
if v_count > 0 then
return 0;
end if;
alter table im_projects add reported_hours_cache float;
return 0;
end;'
language
'plpgsql'
;
select
inline_0
();
drop
function
inline_0
();
------------------------------------------------------
-- Permissions and Privileges
...
...
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