Skip to content

Commit 65650fe

Browse files
committed
Fix demo date shift
1 parent 5accf38 commit 65650fe

3 files changed

Lines changed: 46 additions & 0 deletions

File tree

4.38 KB
Binary file not shown.
2.12 KB
Binary file not shown.

Migration script/openIMIS migration v1.4.2 - 1.5.0.sql

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
--- MIGRATION Script from v1.4.2 - v1.5.0
22

3+
-- Please update the database name to be used !!!
4+
USE [openIMIS-1.5.0];
5+
GO
6+
37
-- OTC-111: Changing the logic of user Roles
48

59
IF COL_LENGTH('tblUserRole', 'Assign') IS NULL
@@ -1912,3 +1916,45 @@ BEGIN CATCH
19121916
ROLLBACK TRANSACTION;
19131917
END CATCH
19141918

1919+
IF OBJECT_ID('uspIndexRebuild', 'P') IS NOT NULL
1920+
DROP PROCEDURE uspIndexRebuild
1921+
GO
1922+
1923+
SET ANSI_NULLS ON
1924+
GO
1925+
SET QUOTED_IDENTIFIER ON
1926+
GO
1927+
-- =============================================
1928+
-- Description: Rebuilds all indexes on the openIMIS database
1929+
-- =============================================
1930+
CREATE PROCEDURE [dbo].[uspIndexRebuild]
1931+
AS
1932+
BEGIN
1933+
-- SET NOCOUNT ON added to prevent extra result sets from
1934+
-- interfering with SELECT statements.
1935+
SET NOCOUNT ON;
1936+
1937+
DECLARE @TableName VARCHAR(255)
1938+
DECLARE @sql NVARCHAR(500)
1939+
DECLARE @fillfactor INT
1940+
1941+
SET @fillfactor = 80
1942+
1943+
DECLARE TableCursor CURSOR FOR
1944+
SELECT QUOTENAME(OBJECT_SCHEMA_NAME([object_id]))+'.' + QUOTENAME(name) AS TableName
1945+
FROM sys.tables
1946+
1947+
OPEN TableCursor
1948+
FETCH NEXT FROM TableCursor INTO @TableName
1949+
WHILE @@FETCH_STATUS = 0
1950+
BEGIN
1951+
SET @sql = 'ALTER INDEX ALL ON ' + @TableName + ' REBUILD WITH (FILLFACTOR = ' + CONVERT(VARCHAR(3),@fillfactor) + ')'
1952+
EXEC (@sql)
1953+
FETCH NEXT FROM TableCursor INTO @TableName
1954+
END
1955+
CLOSE TableCursor
1956+
1957+
DEALLOCATE TableCursor
1958+
1959+
END
1960+
GO

0 commit comments

Comments
 (0)