/* ..::LvL CMS script v0.1 - edit to taste - tigger@ebom.org */


if exists (select * from sysobjects where id = object_id(N'[dbo].[beta_comments]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[beta_comments]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[beta_hits]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[beta_hits]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[beta_levels]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[beta_levels]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[beta_mappers]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[beta_mappers]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[beta_news]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[beta_news]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[forum_msg]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[forum_msg]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[forum_user]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[forum_user]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[lvl_banned]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[lvl_banned]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[lvl_comments]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[lvl_comments]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[lvl_levels]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[lvl_levels]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[lvl_news]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[lvl_news]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[mailout]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[mailout]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[maps]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[maps]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[mods_comments]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[mods_comments]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[mods_list]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[mods_list]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[mods_login]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[mods_login]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[mods_news]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[mods_news]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[news]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[news]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[q3a_banned]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[q3a_banned]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[q3a_bug_fix]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[q3a_bug_fix]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[q3a_comments]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[q3a_comments]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[q3a_download]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[q3a_download]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[q3a_hits]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[q3a_hits]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[q3a_levels]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[q3a_levels]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[q3a_news]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[q3a_news]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[q3a_voters]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[q3a_voters]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[server_comments]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[server_comments]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[server_info]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[server_info]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[server_news]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[server_news]
GO

if exists (select * from sysobjects where id = object_id(N'[dbo].[server_sysadmin]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[server_sysadmin]
GO

CREATE TABLE [dbo].[beta_comments] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[level_id] [int] NULL ,
	[bit_dont_show] [bit] NOT NULL ,
	[str_posters_ip] [varchar] (24) NULL ,
	[str_posters_name] [varchar] (48) NULL ,
	[datestamp] [datetime] NULL ,
	[txt_comment] [text] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[beta_hits] (
	[hits] [int] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[beta_levels] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[author] [int] NOT NULL ,
	[title] [varchar] (64) NULL ,
	[download] [varchar] (160) NULL ,
	[info] [text] NULL ,
	[moreinfo] [varchar] (160) NULL ,
	[active] [bit] NOT NULL ,
	[datestamp] [datetime] NULL ,
	[nmb_comments] [int] NULL ,
	[str_type] [varchar] (32) NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[beta_mappers] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[login] [varchar] (32) NOT NULL ,
	[pass] [varchar] (32) NOT NULL ,
	[name] [varchar] (64) NULL ,
	[homepage] [varchar] (128) NULL ,
	[email] [varchar] (64) NULL ,
	[active] [bit] NOT NULL ,
	[unlock_key] [int] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[beta_news] (
	[news] [text] NOT NULL ,
	[datestamp] [datetime] NOT NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[forum_msg] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[id_parent] [int] NULL ,
	[is_category] [bit] NOT NULL ,
	[is_topic] [bit] NOT NULL ,
	[msg_title] [varchar] (128) NULL ,
	[datestamp] [datetime] NULL ,
	[id_user] [int] NULL ,
	[ip_user] [varchar] (16) NULL ,
	[who_posted] [varchar] (96) NULL ,
	[msg_body] [varchar] (5000) NULL ,
	[started_date] [datetime] NULL ,
	[censored] [bit] NOT NULL ,
	[show_sig] [bit] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[forum_user] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[login] [varchar] (32) NULL ,
	[pass] [varchar] (32) NULL ,
	[user_name] [varchar] (64) NULL ,
	[email] [varchar] (128) NULL ,
	[signup_date] [datetime] NULL ,
	[last_login_date] [datetime] NULL ,
	[active] [bit] NOT NULL ,
	[reg_tag] [varchar] (64) NULL ,
	[sig_file] [varchar] (256) NULL ,
	[unlock_key] [int] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[lvl_banned] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[bit_active] [bit] NOT NULL ,
	[datestamp] [datetime] NULL ,
	[str_banned_ip] [varchar] (24) NULL ,
	[str_reason] [varchar] (255) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[lvl_comments] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[level_id] [int] NULL ,
	[bit_dont_show] [bit] NOT NULL ,
	[str_posters_ip] [varchar] (24) NULL ,
	[str_posters_name] [varchar] (48) NULL ,
	[datestamp] [datetime] NULL ,
	[txt_comment] [text] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[lvl_levels] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[bit_archived] [bit] NOT NULL ,
	[str_title] [varchar] (48) NULL ,
	[str_filename] [varchar] (32) NULL ,
	[str_type] [varchar] (48) NULL ,
	[str_game] [varchar] (32) NULL ,
	[str_author] [varchar] (48) NULL ,
	[str_author_email] [varchar] (64) NULL ,
	[datestamp] [datetime] NULL ,
	[nmb_comments] [numeric](18, 0) NULL ,
	[txt_review] [text] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[lvl_news] (
	[datestamp] [datetime] NULL ,
	[news] [text] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[mailout] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[emailaddy] [varchar] (96) NULL ,
	[datestamp] [datetime] NULL ,
	[active] [bit] NOT NULL ,
	[checknum] [varchar] (8) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[maps] (
	[mapid] [int] IDENTITY (1, 1) NOT NULL ,
	[levelname] [varchar] (100) NULL ,
	[filename] [varchar] (50) NULL ,
	[filesize] [varchar] (32) NULL ,
	[leveltype] [varchar] (50) NULL ,
	[gametype] [varchar] (50) NULL ,
	[images] [int] NULL ,
	[alttag] [varchar] (60) NULL ,
	[released] [datetime] NULL ,
	[textfile] [bit] NOT NULL ,
	[topthree] [bit] NOT NULL ,
	[oldstuff] [bit] NOT NULL ,
	[archived] [bit] NOT NULL ,
	[description] [text] NULL ,
	[artistname] [varchar] (50) NULL ,
	[artistemail] [varchar] (50) NULL ,
	[artisturl] [varchar] (150) NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[mods_comments] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[id_mod] [int] NULL ,
	[dont_show] [bit] NOT NULL ,
	[posters_ip] [varchar] (24) NULL ,
	[posters_name] [varchar] (64) NULL ,
	[datestamp] [datetime] NULL ,
	[comment] [text] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[mods_list] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[name] [varchar] (128) NULL ,
	[website] [varchar] (128) NULL ,
	[active] [bit] NOT NULL ,
	[datestamp] [datetime] NULL ,
	[game_type] [varchar] (96) NULL ,
	[nmb_comments] [int] NULL ,
	[info] [text] NULL ,
	[id_login] [int] NULL ,
	[show_from] [datetime] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[mods_login] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[login] [varchar] (32) NULL ,
	[pass] [varchar] (32) NULL ,
	[name] [varchar] (64) NULL ,
	[email] [varchar] (64) NULL ,
	[active] [bit] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[mods_news] (
	[datestamp] [datetime] NULL ,
	[news] [text] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[news] (
	[newsid] [int] IDENTITY (1, 1) NOT NULL ,
	[betapage] [bit] NOT NULL ,
	[archived] [bit] NOT NULL ,
	[dateadded] [datetime] NULL ,
	[bywho] [varchar] (32) NULL ,
	[thenews] [text] NULL ,
	[gametype] [varchar] (32) NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[q3a_banned] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[bit_active] [bit] NOT NULL ,
	[datestamp] [datetime] NULL ,
	[str_banned_ip] [varchar] (24) NULL ,
	[str_reason] [varchar] (255) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[q3a_bug_fix] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[old_pk3] [varchar] (50) NULL ,
	[new_pk3] [varchar] (50) NULL ,
	[date_added] [datetime] NULL ,
	[bugfix] [varchar] (512) NULL ,
	[download] [varchar] (512) NULL ,
	[added_by] [int] NULL ,
	[hide_it] [bit] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[q3a_comments] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[level_id] [int] NULL ,
	[bit_dont_show] [bit] NOT NULL ,
	[str_posters_ip] [varchar] (24) NULL ,
	[str_posters_name] [varchar] (48) NULL ,
	[datestamp] [datetime] NULL ,
	[txt_comment] [text] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[q3a_download] (
	[level_id] [int] NOT NULL ,
	[num_dload] [int] NOT NULL ,
	[datestamp] [datetime] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[q3a_hits] (
	[hits] [int] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[q3a_levels] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[bit_archived] [bit] NOT NULL ,
	[str_title] [varchar] (48) NULL ,
	[str_filename] [varchar] (32) NULL ,
	[str_type] [varchar] (48) NULL ,
	[str_game] [varchar] (32) NULL ,
	[str_author] [varchar] (48) NULL ,
	[str_author_email] [varchar] (64) NULL ,
	[datestamp] [datetime] NULL ,
	[nmb_comments] [numeric](18, 0) NULL ,
	[txt_review] [text] NULL ,
	[votes] [numeric](18, 0) NULL ,
	[ranking] [numeric](18, 0) NULL ,
	[wwwsite] [varchar] (128) NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[q3a_news] (
	[datestamp] [datetime] NULL ,
	[news] [text] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[q3a_voters] (
	[ID] [int] IDENTITY (1, 1) NOT NULL ,
	[level_id] [int] NULL ,
	[voters_ip] [varchar] (16) NULL ,
	[datestamp] [datetime] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[server_comments] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[server_id] [int] NULL ,
	[bit_dont_show] [bit] NOT NULL ,
	[str_posters_ip] [varchar] (24) NULL ,
	[str_posters_name] [varchar] (48) NULL ,
	[datestamp] [datetime] NULL ,
	[txt_comment] [text] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[server_info] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[sysadmin_id] [int] NULL ,
	[info] [text] NULL ,
	[moreinfo] [text] NULL ,
	[website] [varchar] (160) NULL ,
	[ip] [varchar] (160) NULL ,
	[specs] [varchar] (190) NULL ,
	[openhours] [varchar] (160) NULL ,
	[location] [varchar] (190) NULL ,
	[maps] [text] NULL ,
	[datestamp] [datetime] NULL ,
	[shown] [bit] NOT NULL ,
	[server_name] [varchar] (160) NULL ,
	[comments] [numeric](18, 0) NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[server_news] (
	[news] [text] NULL ,
	[datestamp] [datetime] NOT NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[server_sysadmin] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[sysadmin] [varchar] (64) NULL ,
	[email] [varchar] (64) NULL ,
	[login] [varchar] (48) NULL ,
	[password] [varchar] (48) NULL ,
	[datestamp] [datetime] NULL ,
	[active] [bit] NOT NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[al_download] WITH NOCHECK ADD 
	CONSTRAINT [DF_al_download_datestamp] DEFAULT (getdate()) FOR [datestamp],
	CONSTRAINT [PK_al_download] PRIMARY KEY  NONCLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[al_hits] WITH NOCHECK ADD 
	CONSTRAINT [DF_al_hits_hits] DEFAULT (1) FOR [hits]
GO

ALTER TABLE [dbo].[beta_comments] WITH NOCHECK ADD 
	CONSTRAINT [PK_beta_comments] PRIMARY KEY  NONCLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[beta_hits] WITH NOCHECK ADD 
	CONSTRAINT [DF_beta_hits_hits] DEFAULT (1) FOR [hits]
GO

ALTER TABLE [dbo].[beta_levels] WITH NOCHECK ADD 
	CONSTRAINT [DF_beta_levels_active] DEFAULT (1) FOR [active],
	CONSTRAINT [PK_beta_levels] PRIMARY KEY  NONCLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[beta_mappers] WITH NOCHECK ADD 
	CONSTRAINT [DF_beta_mappers_unlock_key] DEFAULT (0) FOR [unlock_key],
	CONSTRAINT [PK_beta_mappers] PRIMARY KEY  NONCLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[beta_news] WITH NOCHECK ADD 
	CONSTRAINT [DF_beta_news_datestamp] DEFAULT (getdate()) FOR [datestamp]
GO

ALTER TABLE [dbo].[forum_msg] WITH NOCHECK ADD 
	CONSTRAINT [DF_forum_msg_id_parent] DEFAULT (0) FOR [id_parent],
	CONSTRAINT [DF_forum_msg_is_category] DEFAULT (0) FOR [is_category],
	CONSTRAINT [DF_forum_msg_is_topic] DEFAULT (0) FOR [is_topic],
	CONSTRAINT [DF_forum_msg_msg_title] DEFAULT ('untitled') FOR [msg_title],
	CONSTRAINT [DF_forum_msg_datestamp] DEFAULT (getdate()) FOR [datestamp],
	CONSTRAINT [DF_forum_msg_id_user] DEFAULT (0) FOR [id_user],
	CONSTRAINT [DF_forum_msg_who_posted] DEFAULT ('anon') FOR [who_posted],
	CONSTRAINT [DF_forum_msg_started_date] DEFAULT (getdate()) FOR [started_date],
	CONSTRAINT [DF_forum_msg_censored] DEFAULT (0) FOR [censored],
	CONSTRAINT [DF_forum_msg_show_sig] DEFAULT (0) FOR [show_sig],
	CONSTRAINT [PK_forum_msg] PRIMARY KEY  NONCLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[forum_user] WITH NOCHECK ADD 
	CONSTRAINT [DF_forum_user_signup_date] DEFAULT (getdate()) FOR [signup_date],
	CONSTRAINT [DF_forum_user_last_login_date] DEFAULT (getdate()) FOR [last_login_date],
	CONSTRAINT [DF_forum_user_active] DEFAULT (0) FOR [active],
	CONSTRAINT [PK_forum_user] PRIMARY KEY  NONCLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[lvl_banned] WITH NOCHECK ADD 
	CONSTRAINT [PK_lvl_banned] PRIMARY KEY  NONCLUSTERED 
	(
		[id]
	) WITH  FILLFACTOR = 90  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[lvl_comments] WITH NOCHECK ADD 
	CONSTRAINT [PK_lvl_comments] PRIMARY KEY  NONCLUSTERED 
	(
		[id]
	) WITH  FILLFACTOR = 90  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[lvl_levels] WITH NOCHECK ADD 
	CONSTRAINT [PK_lvl_levels] PRIMARY KEY  NONCLUSTERED 
	(
		[id]
	) WITH  FILLFACTOR = 90  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[mailout] WITH NOCHECK ADD 
	CONSTRAINT [DF_mailout_datestamp] DEFAULT (getdate()) FOR [datestamp],
	CONSTRAINT [DF_mailout_active] DEFAULT (0) FOR [active],
	CONSTRAINT [PK_mailout] PRIMARY KEY  NONCLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[maps] WITH NOCHECK ADD 
	CONSTRAINT [PK_maps] PRIMARY KEY  NONCLUSTERED 
	(
		[mapid]
	) WITH  FILLFACTOR = 90  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[mods_comments] WITH NOCHECK ADD 
	CONSTRAINT [PK_mods_comments] PRIMARY KEY  NONCLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[mods_list] WITH NOCHECK ADD 
	CONSTRAINT [DF_mods_list_active] DEFAULT (0) FOR [active],
	CONSTRAINT [DF_mods_list_datestamp] DEFAULT (getdate()) FOR [datestamp],
	CONSTRAINT [DF_mods_list_nmb_comments] DEFAULT (0) FOR [nmb_comments],
	CONSTRAINT [DF_mods_list_show_from] DEFAULT (getdate()) FOR [show_from],
	CONSTRAINT [PK_mods_list] PRIMARY KEY  NONCLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[mods_login] WITH NOCHECK ADD 
	CONSTRAINT [DF_mods_login_active] DEFAULT (0) FOR [active],
	CONSTRAINT [PK_mods_login] PRIMARY KEY  NONCLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[mods_news] WITH NOCHECK ADD 
	CONSTRAINT [DF_mods_news_datestamp] DEFAULT (getdate()) FOR [datestamp]
GO

ALTER TABLE [dbo].[news] WITH NOCHECK ADD 
	CONSTRAINT [PK_news] PRIMARY KEY  NONCLUSTERED 
	(
		[newsid]
	) WITH  FILLFACTOR = 90  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[q3a_banned] WITH NOCHECK ADD 
	CONSTRAINT [PK_q3a_banned] PRIMARY KEY  NONCLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[q3a_bug_fix] WITH NOCHECK ADD 
	CONSTRAINT [DF_q3a_bug_fix_date_added] DEFAULT (getdate()) FOR [date_added],
	CONSTRAINT [DF_q3a_bug_fix_hide_it] DEFAULT (0) FOR [hide_it],
	CONSTRAINT [PK_q3a_bug_fix] PRIMARY KEY  NONCLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[q3a_comments] WITH NOCHECK ADD 
	CONSTRAINT [PK_q3a_comments] PRIMARY KEY  NONCLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[q3a_download] WITH NOCHECK ADD 
	CONSTRAINT [DF_q3a_download_num_dload] DEFAULT (0) FOR [num_dload],
	CONSTRAINT [DF_q3a_download_datestamp] DEFAULT (getdate()) FOR [datestamp]
GO

ALTER TABLE [dbo].[q3a_levels] WITH NOCHECK ADD 
	CONSTRAINT [PK_q3a_levels] PRIMARY KEY  NONCLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[q3a_voters] WITH NOCHECK ADD 
	CONSTRAINT [DF_q3a_voters_datestamp] DEFAULT (getdate()) FOR [datestamp],
	CONSTRAINT [PK_q3a_voters] PRIMARY KEY  NONCLUSTERED 
	(
		[ID]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[server_comments] WITH NOCHECK ADD 
	CONSTRAINT [PK_server_comments] PRIMARY KEY  NONCLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[server_info] WITH NOCHECK ADD 
	CONSTRAINT [PK_server_info] PRIMARY KEY  NONCLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[server_news] WITH NOCHECK ADD 
	CONSTRAINT [DF_server_news_datestamp] DEFAULT (getdate()) FOR [datestamp]
GO

ALTER TABLE [dbo].[server_sysadmin] WITH NOCHECK ADD 
	CONSTRAINT [PK_server_sysadmin] PRIMARY KEY  NONCLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
GO

 CREATE  INDEX [IX_al_download] ON [dbo].[al_download]([filename], [num_dload]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_beta_comments] ON [dbo].[beta_comments]([level_id], [datestamp]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_beta_comments_1] ON [dbo].[beta_comments]([level_id]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_beta_levels] ON [dbo].[beta_levels]([author], [title], [download]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_beta_levels_1] ON [dbo].[beta_levels]([nmb_comments], [author]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_beta_mappers] ON [dbo].[beta_mappers]([login], [pass], [unlock_key], [email], [name]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_forum_msg] ON [dbo].[forum_msg]([id_parent], [datestamp], [id_user], [msg_title], [ip_user], [who_posted], [started_date]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_forum_user] ON [dbo].[forum_user]([login], [pass], [user_name], [email], [last_login_date], [reg_tag], [sig_file], [signup_date], [unlock_key]) ON [PRIMARY]
GO

 CREATE  INDEX [forum_user0] ON [dbo].[forum_user]([id], [user_name]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_lvl_banned] ON [dbo].[lvl_banned]([str_banned_ip]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [IX_lvl_comments] ON [dbo].[lvl_comments]([level_id], [datestamp]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [IX_lvl_levels] ON [dbo].[lvl_levels]([str_title], [str_filename], [datestamp], [nmb_comments], [str_author], [str_type]) WITH  FILLFACTOR = 90 ON [PRIMARY]
GO

 CREATE  INDEX [IX_mailout] ON [dbo].[mailout]([emailaddy], [checknum], [datestamp]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_mods_comments] ON [dbo].[mods_comments]([id_mod], [posters_ip], [posters_name], [datestamp]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_mods_list] ON [dbo].[mods_list]([name], [datestamp], [game_type], [nmb_comments], [show_from], [id_login]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_mods_login] ON [dbo].[mods_login]([login], [pass], [name], [email]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_q3a_banned] ON [dbo].[q3a_banned]([str_banned_ip]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_q3a_bug_fix] ON [dbo].[q3a_bug_fix]([date_added], [old_pk3], [new_pk3], [added_by], [bugfix]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_q3a_comments] ON [dbo].[q3a_comments]([level_id], [datestamp]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_q3a_download] ON [dbo].[q3a_download]([level_id], [num_dload]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_q3a_levels] ON [dbo].[q3a_levels]([str_title], [str_filename], [datestamp], [nmb_comments], [str_author], [str_type]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_q3a_voters] ON [dbo].[q3a_voters]([level_id], [voters_ip]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_server_comments] ON [dbo].[server_comments]([server_id], [str_posters_ip], [datestamp], [str_posters_name]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_server_info] ON [dbo].[server_info]([sysadmin_id], [datestamp]) ON [PRIMARY]
GO

 CREATE  INDEX [IX_server_sysadmin] ON [dbo].[server_sysadmin]([login], [password], [sysadmin], [email]) ON [PRIMARY]
GO

