From: Jaben C. <ja...@us...> - 2007-03-07 11:59:56
|
Update of /cvsroot/yafdotnet/yafsrc/install In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv31297/install Modified Files: procedures.sql tables.sql triggers.sql Log Message: Made yaf_registry table bigger and added support for that increase. Index: tables.sql =================================================================== RCS file: /cvsroot/yafdotnet/yafsrc/install/tables.sql,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tables.sql 21 Dec 2006 16:01:51 -0000 1.4 --- tables.sql 7 Mar 2007 11:58:59 -0000 1.5 *************** *** 361,365 **** RegistryID int IDENTITY(1, 1) NOT NULL, Name nvarchar(50) NOT NULL, ! Value nvarchar(400), BoardID int, CONSTRAINT PK_Registry PRIMARY KEY (RegistryID) --- 361,365 ---- RegistryID int IDENTITY(1, 1) NOT NULL, Name nvarchar(50) NOT NULL, ! Value ntext, BoardID int, CONSTRAINT PK_Registry PRIMARY KEY (RegistryID) *************** *** 623,626 **** --- 623,630 ---- GO + if not exists(select 1 from syscolumns where id=object_id(N'yaf_Registry') and name=N'Value' and xtype<>99) + alter table yaf_Registry alter column Value ntext null + GO + if not exists(select 1 from syscolumns where id=object_id('yaf_PMessage') and name='Flags') begin Index: triggers.sql =================================================================== RCS file: /cvsroot/yafdotnet/yafsrc/install/triggers.sql,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** triggers.sql 28 Jun 2006 11:04:03 -0000 1.1 --- triggers.sql 7 Mar 2007 11:58:59 -0000 1.2 *************** *** 9,13 **** create trigger yaf_Active_insert on dbo.yaf_Active for insert as begin ! declare @BoardID int, @count int, @max int -- Assumes only one row was inserted - shouldn't be a problem? --- 9,13 ---- create trigger yaf_Active_insert on dbo.yaf_Active for insert as begin ! declare @BoardID int, @count int, @max int, @maxStr nvarchar(255), @countStr nvarchar(255), @dtStr nvarchar(255) -- Assumes only one row was inserted - shouldn't be a problem? *************** *** 15,27 **** select @count = count(distinct IP) from yaf_Active with(nolock) where BoardID=@BoardID ! select @max = cast(Value as int) from yaf_Registry where BoardID=@BoardID and Name=N'maxusers' if @@rowcount=0 begin ! insert into yaf_Registry(BoardID,Name,Value) values(@BoardID,N'maxusers',cast(@count as nvarchar)) ! insert into yaf_Registry(BoardID,Name,Value) values(@BoardID,N'maxuserswhen',convert(nvarchar,getdate(),126)) end else if @count>@max begin ! update yaf_Registry set Value=cast(@count as nvarchar) where BoardID=@BoardID and Name=N'maxusers' ! update yaf_Registry set Value=convert(nvarchar,getdate(),126) where BoardID=@BoardID and Name=N'maxuserswhen' end end --- 15,31 ---- select @count = count(distinct IP) from yaf_Active with(nolock) where BoardID=@BoardID ! select @maxStr = cast(Value as nvarchar) from yaf_Registry where BoardID=@BoardID and Name=N'maxusers' ! select @max = cast(@maxStr as int) ! select @countStr = cast(@count as nvarchar) ! select @dtStr = convert(nvarchar,getdate(),126) ! if @@rowcount=0 begin ! insert into yaf_Registry(BoardID,Name,Value) values(@BoardID,N'maxusers',cast(@countStr as ntext)) ! insert into yaf_Registry(BoardID,Name,Value) values(@BoardID,N'maxuserswhen',cast(@dtStr as ntext)) end else if @count>@max begin ! update yaf_Registry set Value=cast(@countStr as ntext) where BoardID=@BoardID and Name=N'maxusers' ! update yaf_Registry set Value=cast(@dtStr as ntext) where BoardID=@BoardID and Name=N'maxuserswhen' end end Index: procedures.sql =================================================================== RCS file: /cvsroot/yafdotnet/yafsrc/install/procedures.sql,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** procedures.sql 4 Jan 2007 13:18:17 -0000 1.8 --- procedures.sql 7 Mar 2007 11:58:59 -0000 1.9 *************** *** 1,4 **** /* ! YAF SQL Stored Procedures File Created 10/19/06 --- 1,4 ---- /* ! YAF SQL Stored Procedures File Created 03/01/06 *************** *** 2948,2952 **** create procedure [dbo].[yaf_registry_save]( @Name nvarchar(50), ! @Value nvarchar(400) = NULL, @BoardID int = null ) AS --- 2948,2952 ---- create procedure [dbo].[yaf_registry_save]( @Name nvarchar(50), ! @Value ntext = NULL, @BoardID int = null ) AS |