/*ALLANJPA FEITO PARA AJUDAR A TODOS*/
/*SENIOR PROFISSIONAL MU ONLINE*/
/*22999518600*/
GO
ALTER TABLE MEMB_INFO ADD creditos int NOT NULL DEFAULT 0
GO
ALTER TABLE MEMB_INFO ADD vip int NOT NULL DEFAULT 0
GO
ALTER TABLE CHARACTER ADD mresets int NOT NULL DEFAULT 0
GO
ALTER TABLE Character ADD imagem nvarchar (75) NULL DEFAULT 'sem_foto.gif'
GO
ALTER TABLE CHARACTER ADD perfil int NOT NULL DEFAULT 0
GO
ALTER TABLE MEMB_INFO ADD diasban int NOT NULL DEFAULT 0
GO
ALTER TABLE CHARACTER ADD diasban int NOT NULL DEFAULT 0
GO
update character set imagem='sem_foto.gif' 

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

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

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

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

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

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

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

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

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

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

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

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

CREATE TABLE [dbo].[CT_AVISOS] (
    [id] [bigint] IDENTITY (1, 1) NOT NULL ,
    [titulo] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
    [aviso] [text] COLLATE Chinese_PRC_CI_AS NULL ,
    [autor] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [data] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[CT_NOTICIAS] (
    [id] [bigint] IDENTITY (1, 1) NOT NULL ,
    [data] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [titulo] [varchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
    [autor] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [noticia] [text] COLLATE Chinese_PRC_CI_AS NULL ,
    [status] [int] NOT NULL DEFAULT 0 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[CT_NOTICIAS_COMENTARIOS] (
    [id] [bigint] IDENTITY (1, 1) NOT NULL ,
    [personagem] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [comentario] [text] COLLATE Chinese_PRC_CI_AS NULL ,
    [noticiaid] [int] NOT NULL DEFAULT 0 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[CT_RECORDE] (
    [id] [bigint] IDENTITY (1, 1) NOT NULL ,
    [recorde] [int] NOT NULL DEFAULT 0 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[CT_SCREEN] (
    [id] [bigint] IDENTITY (1, 1) NOT NULL ,
    [screen] [nvarchar] (75) COLLATE Chinese_PRC_CI_AS NULL ,
    [autor] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [nota] [int] NOT NULL DEFAULT 0  ,
    [votos] [int] NOT NULL DEFAULT 0 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[CT_SCREEN_VOTOS] (
    [id] [bigint] IDENTITY (1, 1) NOT NULL ,
    [login] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [screenid] [int] NOT NULL DEFAULT 0  ,
    [nota] [int] NOT NULL  DEFAULT 0 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[CT_SCREEN_COMENTARIOS] (
    [id] [bigint] IDENTITY (1, 1) NOT NULL ,
    [personagem] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [comentario] [text] COLLATE Chinese_PRC_CI_AS NULL ,
    [screenid] [int] NOT NULL DEFAULT 0 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[CT_TICKETS] (
    [id] [bigint] IDENTITY (1, 1) NOT NULL ,
    [login] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
    [personagem] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
    [assunto] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
        [data] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [msg] [text] COLLATE Chinese_PRC_CI_AS NULL ,
    [status] [int] NOT NULL DEFAULT 0
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[CT_EQUIPE] (
    [id] [bigint] IDENTITY (1, 1) NOT NULL ,
    [login] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
    [cargo] [int] NOT NULL  DEFAULT 0
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[CT_TICKETS_COMENTARIOS] (
    [id] [bigint] IDENTITY (1, 1) NOT NULL ,
    [personagem] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
    [msg] [text] COLLATE Chinese_PRC_CI_AS NULL ,
    [ticketid] [int] NOT NULL DEFAULT 0
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[CT_PAGAMENTOS] (
    [id] [bigint] IDENTITY (1, 1) NOT NULL ,
    [login] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
    [personagem] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [produto] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [banco] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
    [data] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [hora] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [valor] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
    [mensagem] [text] COLLATE Chinese_PRC_CI_AS NULL ,
    [status] [int] NOT NULL  DEFAULT 0
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[CT_PAGAMENTOS_COMENTARIOS] (
    [id] [bigint] IDENTITY (1, 1) NOT NULL ,
    [personagem] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
    [comentario] [text] COLLATE Chinese_PRC_CI_AS NULL ,
    [pagamentoid] [int] NOT NULL DEFAULT 0
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

INSERT INTO CT_RECORDE (recorde) values ('0')

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

CREATE TABLE [dbo].[table_moeda] (
	[login] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[colum_login] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO

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

CREATE TABLE [dbo].[table_moeda2] (
	[login2] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[colum_login2] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[colum_moeda2] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY]
GO
  