Ir para conteúdo

[TUTORIAL] Resolvendo qualquer erro na data base


Posts Recomendados

Opa, galerinha do XTibia, resolvi trazer a solução de uns problemas que vejo que ocorrem com uma certa frequência: Os erros da data base.

Neste tutorial vou ensinar a resolver os erros do tipo No such table, Insert into, No such column, ... has no column named... etc.

1°) NO SUCH TABLE

Bom, para o erro No such table, basta vc visualizar qual table está faltando. Para isso basta ler o erro na distro:
ggyQEm0.png

No caso da imagem, está faltando a table: player_statements
Para resolver este e qualquer outro problema deste tipo, caso sua data base seja sqlite,
basta abrir sua data base pelo Sqlite Studio(download: http://sqlitestudio.pl/?act=download) e clicar em Open SQL query editor:


ep8IwcQ.png



Mas caso sua data base seja Mysql abra pelo phpMyadmin, ou por outro editor de sua preferencia.

1.1°) EXECUTANDO OS COMANDOS PARA RESOLVER O PROBLEMA
Bom, dependendo da table que estiver faltando, vc irá colocar seu respectivo comando, segue abaixo TODOS os comandos básicos necessários para que sua data base fique Ok! : (VC VAI PEGAR O COMANDO REFERENTE À TABLE QUE VC QUER!!!)


account_viplist


Mysql

DROP TABLE IF EXISTS `account_viplist`;
CREATE TABLE `account_viplist`
(
	`account_id` INT NOT NULL,
	`world_id` TINYINT(4) UNSIGNED NOT NULL DEFAULT 0,
	`player_id` INT NOT NULL,
	`description` VARCHAR( 128 ) NOT NULL,
	`icon` INT( 11 ) UNSIGNED NOT NULL,
	`notify` BOOLEAN NOT NULL,
	KEY (`account_id`), KEY (`player_id`), KEY (`world_id`), UNIQUE (`account_id`, `player_id`),
	FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`) ON DELETE CASCADE,
	FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE
) ENGINE = InnoDB;

 

 

 

Sqlite

 

DROP TABLE IF EXISTS account_viplist;
CREATE TABLE account_viplist ( 
    account_id  INTEGER         NOT NULL,
    world_id    INTEGER         NOT NULL
                                DEFAULT '0',
    player_id   INTEGER         NOT NULL,
    description VARCHAR( 128 )  NOT NULL
                                DEFAULT '''',
    icon        INTEGER         NOT NULL
                                DEFAULT '0',
    notify      BOOLEAN         NOT NULL
                                DEFAULT '''',
    UNIQUE ( account_id, player_id ),
    FOREIGN KEY ( account_id ) REFERENCES accounts ( id ),
    FOREIGN KEY ( player_id ) REFERENCES players ( id ) 
);

 




accounts


Mysql

DROP TABLE IF EXISTS `accounts`;
CREATE TABLE `accounts`
(
	`id` INT NOT NULL AUTO_INCREMENT,
	`name` VARCHAR(32) NOT NULL DEFAULT '',
	`password` VARCHAR(255) NOT NULL/* VARCHAR(32) NOT NULL COMMENT 'MD5'*//* VARCHAR(40) NOT NULL COMMENT 'SHA1'*/,
	`salt` VARCHAR(40) NOT NULL DEFAULT '',
	`premdays` INT NOT NULL DEFAULT 5,
	`lastday` INT UNSIGNED NOT NULL DEFAULT 0,
	`email` VARCHAR(255) NOT NULL DEFAULT '',
	`key` VARCHAR(32) NOT NULL DEFAULT '0',
	`blocked` TINYINT(1) NOT NULL DEFAULT FALSE COMMENT 'internal usage',
	`warnings` INT NOT NULL DEFAULT 0,
	`group_id` INT NOT NULL DEFAULT 1,
        `viptime` INT( 11 ) NOT NULL DEFAULT '0',
	PRIMARY KEY (`id`), UNIQUE (`name`)
) ENGINE = InnoDB;

INSERT INTO `accounts` VALUES (1, '1', '1', '', 65535, 0, '', '0', 0, 0, 1, 65535);

 



Sqlite

 

DROP TABLE IF EXISTS accounts;
CREATE TABLE accounts ( 
    id       INTEGER         PRIMARY KEY
                             NOT NULL,
    name     VARCHAR( 255 )  NOT NULL,
    password VARCHAR( 255 )  NOT NULL,
    salt     VARCHAR( 40 )   NOT NULL
                             DEFAULT '''',
    premdays INTEGER         NOT NULL
                             DEFAULT '0',
    lastday  INTEGER         NOT NULL
                             DEFAULT '0',
    email    VARCHAR( 255 )  NOT NULL
                             DEFAULT '''',
    [key]    VARCHAR( 32 )   NOT NULL
                             DEFAULT '0',
    blocked  BOOLEAN         NOT NULL
                             DEFAULT 'FALSE',
    warnings INTEGER         NOT NULL
                             DEFAULT '0',
    group_id INTEGER         NOT NULL
                             DEFAULT '1',
    viptime  INTEGER         NOT NULL
                             DEFAULT '0',
    UNIQUE ( name ) 
);
INSERT INTO `accounts` VALUES (1, '1', '1', '', 65535, 0, '', '0', 0, 0, 1, 65535);

 




bans


Mysql

DROP TABLE IF EXISTS `bans`;
CREATE TABLE `bans` (
  `id` int(11) NOT NULL,
  `type` int(11) NOT NULL,
  `value` int(11) NOT NULL,
  `param` int(11) NOT NULL,
  `active` tinyint(1) NOT NULL DEFAULT '1',
  `expires` int(11) NOT NULL,
  `added` int(11) NOT NULL,
  `admin_id` int(11) NOT NULL,
  `comment` text NOT NULL,
  `reason` int(11) NOT NULL,
  `action` int(11) NOT NULL,
  `statement` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

 

Sqlite

 

DROP TABLE IF EXISTS bans;
CREATE TABLE bans (
    id          INTEGER         PRIMARY KEY
                                NOT NULL,
    type        INTEGER         NOT NULL,
    value       INTEGER         NOT NULL,
    param       INTEGER         NOT NULL
                                DEFAULT '11',
    active      BOOLEAN         NOT NULL
                                DEFAULT '1',
    expires     INTEGER         NOT NULL,
    added       INTEGER         NOT NULL,
    admin_id    INTEGER         NOT NULL
                                DEFAULT '0',
    comment     TEXT            NOT NULL,
    reason      INTEGER         NOT NULL
                                DEFAULT '0',
    action    INTEGER         NOT NULL
                                DEFAULT '0',
    statement VARCHAR( 255 )  NOT NULL
                                DEFAULT ''''
);

 




environment_killers


Mysql

DROP TABLE IF EXISTS `environment_killers`;
CREATE TABLE `environment_killers`
(
	`kill_id` INT NOT NULL,
	`name` VARCHAR(255) NOT NULL,
	FOREIGN KEY (`kill_id`) REFERENCES `killers`(`id`) ON DELETE CASCADE
) ENGINE = InnoDB;

 



Sqlite

 

DROP TABLE IF EXISTS `environment_killers`;
CREATE TABLE environment_killers ( 
    kill_id INTEGER         NOT NULL,
    name    VARCHAR( 255 )  NOT NULL,
    FOREIGN KEY ( kill_id ) REFERENCES killers ( id ) 
);

 




global_storage


Mysql

DROP TABLE IF EXISTS `global_storage`;
CREATE TABLE `global_storage`
(
	`key` VARCHAR(32) NOT NULL,
	`world_id` TINYINT(4) UNSIGNED NOT NULL DEFAULT 0,
	`value` TEXT NOT NULL,
	UNIQUE  (`key`, `world_id`)
) ENGINE = InnoDB;

 

Sqlite

 

DROP TABLE IF EXISTS global_storage;
CREATE TABLE global_storage ( 
    [key]    VARCHAR( 32 )   NOT NULL,
    world_id INTEGER         NOT NULL
                             DEFAULT '0',
    value    VARCHAR( 255 )  NOT NULL
                             DEFAULT '0',
    UNIQUE ( [key], world_id ) 
);

 




guild_invites


Mysql

DROP TABLE IF EXISTS `guild_invites`;
CREATE TABLE `guild_invites`
(
	`player_id` INT NOT NULL DEFAULT 0,
	`guild_id` INT NOT NULL DEFAULT 0,
	UNIQUE (`player_id`, `guild_id`),
	FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE,
	FOREIGN KEY (`guild_id`) REFERENCES `guilds`(`id`) ON DELETE CASCADE
) ENGINE = InnoDB;

 

Sqlite

 

DROP TABLE IF EXISTS guild_invites;
CREATE TABLE guild_invites ( 
    player_id INTEGER NOT NULL,
    guild_id  INTEGER NOT NULL,
    UNIQUE ( player_id, guild_id ),
    FOREIGN KEY ( player_id ) REFERENCES players ( id ),
    FOREIGN KEY ( guild_id ) REFERENCES guilds ( id ) 
);

 




guild_kills


Mysql

DROP TABLE IF EXISTS `guild_kills`;
CREATE TABLE `guild_kills`
(
	`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
	`guild_id` INT NOT NULL,
	`war_id` INT NOT NULL,
	`death_id` INT NOT NULL,
	FOREIGN KEY (`guild_id`) REFERENCES `guilds`(`id`) ON DELETE CASCADE,
	FOREIGN KEY (`war_id`) REFERENCES `guild_wars`(`id`) ON DELETE CASCADE,
	FOREIGN KEY (`death_id`) REFERENCES `player_deaths`(`id`) ON DELETE CASCADE
) ENGINE = InnoDB;

 



Sqlite

 

DROP TABLE IF EXISTS guild_kills;
CREATE TABLE guild_kills ( 
    id       INT PRIMARY KEY
                 NOT NULL,
    guild_id INT NOT NULL,
    war_id   INT NOT NULL,
    death_id INT NOT NULL 
);

 




guild_ranks


Mysql

DROP TABLE IF EXISTS `guild_ranks`;
CREATE TABLE `guild_ranks`
(
	`id` INT NOT NULL AUTO_INCREMENT,
	`guild_id` INT NOT NULL,
	`name` VARCHAR(255) NOT NULL,
	`level` INT NOT NULL COMMENT '1 - leader, 2 - vice leader, 3 - member',
	PRIMARY KEY (`id`),
	FOREIGN KEY (`guild_id`) REFERENCES `guilds`(`id`) ON DELETE CASCADE
) ENGINE = InnoDB;

 

Sqlite

 

DROP TABLE IF EXISTS guild_ranks;
CREATE TABLE guild_ranks ( 
    id       INTEGER         PRIMARY KEY,
    guild_id INTEGER         NOT NULL,
    name     VARCHAR( 255 )  NOT NULL,
    level    INTEGER         NOT NULL,
    FOREIGN KEY ( guild_id ) REFERENCES guilds ( id ) 
);

 




guild_wars


Mysql

DROP TABLE IF EXISTS `guild_wars`;
CREATE TABLE `guild_wars`
(
	`id` INT NOT NULL AUTO_INCREMENT,
	`guild_id` INT NOT NULL,
	`enemy_id` INT NOT NULL,
	`begin` BIGINT NOT NULL DEFAULT 0,
	`end` BIGINT NOT NULL DEFAULT 0,
	`frags` INT UNSIGNED NOT NULL DEFAULT 0,
	`payment` BIGINT UNSIGNED NOT NULL DEFAULT 0,
	`guild_kills` INT UNSIGNED NOT NULL DEFAULT 0,
	`enemy_kills` INT UNSIGNED NOT NULL DEFAULT 0,
	`status` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
	PRIMARY KEY (`id`), KEY `status` (`status`),
	KEY `guild_id` (`guild_id`), KEY `enemy_id` (`enemy_id`),
	FOREIGN KEY (`guild_id`) REFERENCES `guilds`(`id`) ON DELETE CASCADE,
	FOREIGN KEY (`enemy_id`) REFERENCES `guilds`(`id`) ON DELETE CASCADE
) ENGINE=InnoDB;

 

Sqlite

 

DROP TABLE IF EXISTS guild_wars;
CREATE TABLE guild_wars ( 
    id          INTEGER       NOT NULL,
    guild_id    INT           NOT NULL,
    enemy_id    INT           NOT NULL,
    begin       BIGINT        NOT NULL
                              DEFAULT '0',
    end         BIGINT        NOT NULL
                              DEFAULT '0',
    frags       INT           NOT NULL
                              DEFAULT '0',
    payment     BIGINT        NOT NULL
                              DEFAULT '0',
    guild_kills INT           NOT NULL
                              DEFAULT '0',
    enemy_kills INT           NOT NULL
                              DEFAULT '0',
    status      TINYINT( 1 )  NOT NULL
                              DEFAULT '0',
    PRIMARY KEY ( id ),
    FOREIGN KEY ( guild_id ) REFERENCES guilds ( id ),
    FOREIGN KEY ( enemy_id ) REFERENCES guilds ( id ) 
);

 




guilds


Mysql

DROP TABLE IF EXISTS `guilds`;
CREATE TABLE `guilds`
(
	`id` INT NOT NULL AUTO_INCREMENT,
	`world_id` TINYINT(4) UNSIGNED NOT NULL DEFAULT 0,
	`name` VARCHAR(255) NOT NULL,
	`ownerid` INT NOT NULL,
	`creationdata` INT NOT NULL,
	`checkdata` INT NOT NULL,
	`motd` VARCHAR(255) NOT NULL,
	`balance` BIGINT UNSIGNED NOT NULL DEFAULT 0,
	PRIMARY KEY (`id`),
	UNIQUE (`name`, `world_id`)
) ENGINE = InnoDB;

 



Sqlite

 

DROP TABLE IF EXISTS guilds;
CREATE TABLE guilds ( 
    id           INTEGER         PRIMARY KEY,
    world_id     INTEGER         NOT NULL
                                 DEFAULT '0',
    name         VARCHAR( 255 )  NOT NULL,
    ownerid      INTEGER         NOT NULL,
    creationdata INTEGER         NOT NULL,
    checkdata    INTEGER         NOT NULL,
    motd         VARCHAR( 255 )  NOT NULL
                                 DEFAULT '''',
    balance      BIGINT          NOT NULL
                                 DEFAULT '0',
    UNIQUE ( name, world_id ),
    FOREIGN KEY ( ownerid ) REFERENCES players ( id ) 
);

 




house_auctions


Mysql

DROP TABLE IF EXISTS `house_auctions`;
CREATE TABLE `house_auctions`
(
	`house_id` INT UNSIGNED NOT NULL,
	`world_id` TINYINT(4) UNSIGNED NOT NULL DEFAULT 0,
	`player_id` INT NOT NULL,
	`bid` INT UNSIGNED NOT NULL DEFAULT 0,
	`limit` INT UNSIGNED NOT NULL DEFAULT 0,
	`endtime` BIGINT UNSIGNED NOT NULL DEFAULT 0,
	UNIQUE (`house_id`, `world_id`),
	FOREIGN KEY (`house_id`, `world_id`) REFERENCES `houses`(`id`, `world_id`) ON DELETE CASCADE,
	FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) ON DELETE CASCADE
) ENGINE = InnoDB;

 



Sqlite

 

DROP TABLE IF EXISTS house_auctions;
CREATE TABLE house_auctions ( 
    house_id  INTEGER NOT NULL,
    world_id  INTEGER NOT NULL
                      DEFAULT '0',
    player_id INTEGER NOT NULL,
    bid       INTEGER NOT NULL
                      DEFAULT '0',
    [limit]   INTEGER NOT NULL
                      DEFAULT '0',
    endtime   INTEGER NOT NULL
                      DEFAULT '0',
    UNIQUE ( house_id, world_id ),
    FOREIGN KEY ( house_id, world_id ) REFERENCES houses ( id, world_id ),
    FOREIGN KEY ( player_id ) REFERENCES players ( id ) 
);

 




house_data


Mysql

DROP TABLE IF EXISTS `house_data`;
CREATE TABLE `house_data`
(
	`house_id` INT UNSIGNED NOT NULL,
	`world_id` TINYINT(4) UNSIGNED NOT NULL DEFAULT 0,
	`data` LONGBLOB NOT NULL,
	UNIQUE (`house_id`, `world_id`),
	FOREIGN KEY (`house_id`, `world_id`) REFERENCES `houses`(`id`, `world_id`) ON DELETE CASCADE
) ENGINE = InnoDB;

 

Sqlite

 

DROP TABLE IF EXISTS house_data;
CREATE TABLE house_data ( 
    house_id INTEGER  NOT NULL,
    world_id INTEGER  NOT NULL
                      DEFAULT '0',
    data     LONGBLOB NOT NULL,
    UNIQUE ( house_id, world_id ),
    FOREIGN KEY ( house_id, world_id ) REFERENCES houses ( id, world_id ) 
);

 




house_lists


Mysql

DROP TABLE IF EXISTS `house_lists`;
CREATE TABLE `house_lists`
(
	`house_id` INT UNSIGNED NOT NULL,
	`world_id` TINYINT(4) UNSIGNED NOT NULL DEFAULT 0,
	`listid` INT NOT NULL,
	`list` TEXT NOT NULL,
	UNIQUE (`house_id`, `world_id`, `listid`),
	FOREIGN KEY (`house_id`, `world_id`) REFERENCES `houses`(`id`, `world_id`) ON DELETE CASCADE
) ENGINE = InnoDB;

 

Sqlite

 

DROP TABLE IF EXISTS house_lists;
CREATE TABLE house_lists ( 
    house_id INTEGER NOT NULL,
    world_id INTEGER NOT NULL
                     DEFAULT '0',
    listid   INTEGER NOT NULL,
    list     TEXT    NOT NULL,
    UNIQUE ( house_id, world_id, listid ),
    FOREIGN KEY ( house_id, world_id ) REFERENCES houses ( id, world_id ) 
);

 




houses


Mysql

DROP TABLE IF EXISTS `houses`;
CREATE TABLE `houses`
(
	`id` INT UNSIGNED NOT NULL,
	`world_id` TINYINT(4) UNSIGNED NOT NULL DEFAULT 0,
	`owner` INT NOT NULL,
	`paid` INT UNSIGNED NOT NULL DEFAULT 0,
	`warnings` INT NOT NULL DEFAULT 0,
	`lastwarning` INT UNSIGNED NOT NULL DEFAULT 0,
	`name` VARCHAR(255) NOT NULL,
	`town` INT UNSIGNED NOT NULL DEFAULT 0,
	`size` INT UNSIGNED NOT NULL DEFAULT 0,
	`price` INT UNSIGNED NOT NULL DEFAULT 0,
	`rent` INT UNSIGNED NOT NULL DEFAULT 0,
	`doors` INT UNSIGNED NOT NULL DEFAULT 0,
	`beds` INT UNSIGNED NOT NULL DEFAULT 0,
	`tiles` INT UNSIGNED NOT NULL DEFAULT 0,
	`guild` TINYINT(1) UNSIGNED NOT NULL DEFAULT FALSE,
	`clear` TINYINT(1) UNSIGNED NOT NULL DEFAULT FALSE,
	UNIQUE (`id`, `world_id`)
) ENGINE = InnoDB;

 

Sqlite

 

DROP TABLE IF EXISTS houses;
CREATE TABLE houses ( 
    id          INTEGER         NOT NULL,
    world_id    INTEGER         NOT NULL
                                DEFAULT '0',
    owner       INTEGER         NOT NULL,
    paid        INTEGER         NOT NULL
                                DEFAULT '0',
    warnings    INTEGER         NOT NULL
                                DEFAULT '0',
    lastwarning INTEGER         NOT NULL
                                DEFAULT '0',
    name        VARCHAR( 255 )  NOT NULL,
    town        INTEGER         NOT NULL
                                DEFAULT '0',
    size        INTEGER         NOT NULL
                                DEFAULT '0',
    price       INTEGER         NOT NULL
                                DEFAULT '0',
    rent        INTEGER         NOT NULL
                                DEFAULT '0',
    doors       INTEGER         NOT NULL
                                DEFAULT '0',
    beds        INTEGER         NOT NULL
                                DEFAULT '0',
    tiles       INTEGER         NOT NULL
                                DEFAULT '0',
    guild       BOOLEAN         NOT NULL
                                DEFAULT 'FALSE',
    clear       BOOLEAN         NOT NULL
                                DEFAULT 'FALSE',
    UNIQUE ( id, world_id ) 
);

 




killers


Mysql

DROP TABLE IF EXISTS `killers`;
CREATE TABLE `killers`
(
	`id` INT NOT NULL AUTO_INCREMENT,
	`death_id` INT NOT NULL,
	`final_hit` TINYINT(1) UNSIGNED NOT NULL DEFAULT FALSE,
	`unjustified` TINYINT(1) UNSIGNED NOT NULL DEFAULT FALSE,
	`war` INT NOT NULL DEFAULT 0,
	PRIMARY KEY (`id`),
	FOREIGN KEY (`death_id`) REFERENCES `player_deaths`(`id`) ON DELETE CASCADE
) ENGINE = InnoDB;

 

Sqlite

 

DROP TABLE IF EXISTS killers;
CREATE TABLE killers ( 
    id          INTEGER PRIMARY KEY,
    death_id    INTEGER NOT NULL,
    final_hit   BOOLEAN NOT NULL
                        DEFAULT 'FALSE',
    unjustified BOOLEAN NOT NULL
                        DEFAULT 'FALSE',
    war         BIGINT  NOT NULL
                        DEFAULT '0',
    FOREIGN KEY ( death_id ) REFERENCES player_deaths ( id ) 
);

 




market_history


Mysql

DROP TABLE IF EXISTS `market_history`;
CREATE TABLE `market_history` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `world_id` tinyint(4) unsigned NOT NULL DEFAULT '0',
  `player_id` int(11) NOT NULL,
  `sale` tinyint(1) NOT NULL DEFAULT '0',
  `itemtype` int(10) unsigned NOT NULL,
  `amount` smallint(5) unsigned NOT NULL,
  `price` int(10) unsigned NOT NULL DEFAULT '0',
  `expires_at` bigint(20) unsigned NOT NULL,
  `inserted` bigint(20) unsigned NOT NULL,
  `state` tinyint(1) unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `player_id` (`player_id`,`sale`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

 



Sqlite

 

DROP TABLE IF EXISTS market_history;
CREATE TABLE market_history ( 
    id         INTEGER          PRIMARY KEY
                                NOT NULL,
    player_id  INTEGER          NOT NULL,
    sale       BOOLEAN          NOT NULL
                                DEFAULT '0',
    itemtype   UNSIGNED INTEGER NOT NULL,
    amount     UNSIGNED INTEGER NOT NULL,
    price      UNSIGNED INTEGER NOT NULL
                                DEFAULT '0',
    expires_at UNSIGNED INTEGER NOT NULL,
    inserted   UNSIGNED INTEGER NOT NULL,
    state      UNSIGNED INTEGER NOT NULL,
    world_id   TINYINT( 4 )     NOT NULL
                                DEFAULT ( 0 ),
    FOREIGN KEY ( player_id ) REFERENCES players ( id ) ON DELETE CASCADE 
);

 




market_offers


Mysql

DROP TABLE IF EXISTS `market_offers`;
CREATE TABLE `market_offers` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `world_id` tinyint(4) unsigned NOT NULL DEFAULT '0',
  `player_id` int(11) NOT NULL,
  `sale` tinyint(1) NOT NULL DEFAULT '0',
  `itemtype` int(10) unsigned NOT NULL,
  `amount` smallint(5) unsigned NOT NULL,
  `created` bigint(20) unsigned NOT NULL,
  `anonymous` tinyint(1) NOT NULL DEFAULT '0',
  `price` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `sale` (`sale`,`itemtype`),
  KEY `created` (`created`),
  KEY `market_offers_ibfk_1` (`player_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

 

Sqlite

 

DROP TABLE IF EXISTS market_offers;
CREATE TABLE market_offers ( 
    id        INTEGER          PRIMARY KEY
                               NOT NULL,
    player_id INTEGER          NOT NULL,
    sale      BOOLEAN          NOT NULL
                               DEFAULT '0',
    itemtype  UNSIGNED INTEGER NOT NULL,
    amount    UNSIGNED INTEGER NOT NULL,
    created   UNSIGNED INTEGER NOT NULL,
    anonymous BOOLEAN          NOT NULL
                               DEFAULT '0',
    price     UNSIGNED INTEGER NOT NULL
                               DEFAULT '0',
    world_id  TINYINT( 4 )     NOT NULL
                               DEFAULT ( 0 ),
    FOREIGN KEY ( player_id ) REFERENCES players ( id ) ON DELETE CASCADE 
);

 




player_deaths


Mysql

DROP TABLE IF EXISTS `player_deaths`;
CREATE TABLE `player_deaths` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `player_id` int(11) NOT NULL,
  `date` bigint(20) unsigned NOT NULL,
  `level` int(10) unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `date` (`date`),
  KEY `player_deaths_ibfk_1` (`player_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=42 ;

 

Sqlite

 

DROP TABLE IF EXISTS player_deaths;
CREATE TABLE player_deaths ( 
    id        INTEGER PRIMARY KEY,
    player_id INTEGER NOT NULL,
    date      INTEGER NOT NULL,
    level     INTEGER NOT NULL,
    FOREIGN KEY ( player_id ) REFERENCES players ( id ) 
);

 




player_depotitems


Mysql

DROP TABLE IF EXISTS `player_depotitems`;
CREATE TABLE `player_depotitems`
(
	`player_id` INT NOT NULL,
	`sid` INT NOT NULL COMMENT 'any given range, eg. 0-100 is reserved for depot lockers and all above 100 will be normal items inside depots',
	`pid` INT NOT NULL DEFAULT 0,
	`itemtype` INT NOT NULL,
	`count` INT NOT NULL DEFAULT 0,
	`attributes` BLOB NOT NULL,
	KEY (`player_id`), UNIQUE (`player_id`, `sid`),
	FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE
) ENGINE = InnoDB;

 



Sqlite

 

DROP TABLE IF EXISTS player_depotitems;
CREATE TABLE player_depotitems ( 
    player_id  INTEGER NOT NULL,
    sid        INTEGER NOT NULL,
    pid        INTEGER NOT NULL
                       DEFAULT '0',
    itemtype   INTEGER NOT NULL,
    count      INTEGER NOT NULL
                       DEFAULT '0',
    attributes BLOB    NOT NULL,
    UNIQUE ( player_id, sid ),
    FOREIGN KEY ( player_id ) REFERENCES players ( id ) 
);

 




player_inboxitems


Mysql

DROP TABLE IF EXISTS `player_inboxitems`;
CREATE TABLE IF NOT EXISTS `player_inboxitems` (
  `player_id` int(11) NOT NULL,
  `sid` int(11) NOT NULL,
  `pid` int(11) NOT NULL DEFAULT '0',
  `itemtype` smallint(6) NOT NULL,
  `count` smallint(5) NOT NULL DEFAULT '0',
  `attributes` blob NOT NULL,
  UNIQUE KEY `player_id_2` (`player_id`,`sid`),
  KEY `player_id` (`player_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

 

Sqlite

 

DROP TABLE IF EXISTS player_inboxitems;
CREATE TABLE player_inboxitems ( 
    player_id  INT( 11 )      NOT NULL,
    sid        INT( 11 )      NOT NULL,
    pid        INT( 11 )      NOT NULL
                              DEFAULT ( 0 ),
    itemtype   SMALLINT( 6 )  NOT NULL,
    count      SMALLINT( 5 )  NOT NULL
                              DEFAULT ( 0 ),
    attributes BLOB           NOT NULL 
);

 




player_items


Mysql

DROP TABLE IF EXISTS `player_items`;
CREATE TABLE `player_items`
(
	`player_id` INT NOT NULL,
	`pid` INT NOT NULL DEFAULT 0,
	`sid` INT NOT NULL DEFAULT 0,
	`itemtype` INT NOT NULL DEFAULT 0,
	`count` INT NOT NULL DEFAULT 0,
	`attributes` BLOB NOT NULL,
	KEY (`player_id`), UNIQUE (`player_id`, `sid`),
	FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE
) ENGINE = InnoDB;

 

Sqlite

 

DROP TABLE IF EXISTS player_items;
CREATE TABLE player_items ( 
    player_id  INT  NOT NULL,
    sid        INT  NOT NULL,
    pid        INT  NOT NULL
                    DEFAULT '0',
    itemtype   INT  NOT NULL,
    count      INT  NOT NULL
                    DEFAULT '0',
    attributes BLOB NOT NULL,
    UNIQUE ( player_id, sid ),
    FOREIGN KEY ( player_id ) REFERENCES players ( id ) 
);

 




player_killers


Mysql

DROP TABLE IF EXISTS `player_killers`;
CREATE TABLE `player_killers`
(
	`kill_id` INT NOT NULL,
	`player_id` INT NOT NULL,
	FOREIGN KEY (`kill_id`) REFERENCES `killers`(`id`) ON DELETE CASCADE,
	FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE
) ENGINE = InnoDB;

 

Sqlite

 

DROP TABLE IF EXISTS player_killers;
CREATE TABLE player_killers ( 
    kill_id   INTEGER NOT NULL,
    player_id INTEGER NOT NULL,
    FOREIGN KEY ( kill_id ) REFERENCES killers ( id ),
    FOREIGN KEY ( player_id ) REFERENCES players ( id ) 
);

 




player_namelocks


Mysql

DROP TABLE IF EXISTS `player_namelocks`;
CREATE TABLE `player_namelocks`
(
	`player_id` INT NOT NULL,
	`name` VARCHAR(255) NOT NULL,
	`new_name` VARCHAR(255) NOT NULL,
	`date` BIGINT NOT NULL DEFAULT 0,
	KEY (`player_id`),
	FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE
) ENGINE = InnoDB;

 

Sqlite

 

DROP TABLE IF EXISTS player_namelocks;
CREATE TABLE player_namelocks ( 
    player_id INTEGER         NOT NULL,
    name      VARCHAR( 255 )  NOT NULL,
    new_name  VARCHAR( 255 )  NOT NULL,
    date      INTEGER         NOT NULL
                              DEFAULT '0',
    FOREIGN KEY ( player_id ) REFERENCES players ( id ) 
);

 




player_skills


Mysql

DROP TABLE IF EXISTS `player_skills`;
CREATE TABLE `player_skills`
(
	`player_id` INT NOT NULL,
	`skillid` TINYINT(2) NOT NULL DEFAULT 0,
	`value` INT UNSIGNED NOT NULL DEFAULT 0,
	`count` INT UNSIGNED NOT NULL DEFAULT 0,
	KEY (`player_id`), UNIQUE (`player_id`, `skillid`),
	FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE
) ENGINE = InnoDB;

 

Sqlite

 

DROP TABLE IF EXISTS player_skills;
CREATE TABLE player_skills ( 
    player_id INTEGER NOT NULL,
    skillid   INTEGER NOT NULL,
    value     INTEGER NOT NULL
                      DEFAULT '0',
    count     INTEGER NOT NULL
                      DEFAULT '0',
    UNIQUE ( player_id, skillid ),
    FOREIGN KEY ( player_id ) REFERENCES players ( id ) 
);

 




player_spells


Mysql

DROP TABLE IF EXISTS `player_spells`;
CREATE TABLE `player_spells`
(
	`player_id` INT NOT NULL,
	`name` VARCHAR(255) NOT NULL,
	KEY (`player_id`), UNIQUE (`player_id`, `name`),
	FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE
) ENGINE = InnoDB;

 

Sqlite

 

DROP TABLE IF EXISTS player_spells;
CREATE TABLE player_spells ( 
    player_id INTEGER         NOT NULL,
    name      VARCHAR( 255 )  NOT NULL,
    UNIQUE ( player_id, name ),
    FOREIGN KEY ( player_id ) REFERENCES players ( id ) 
);

 




player_statements


Mysql

DROP TABLE IF EXISTS `player_statements`;
CREATE TABLE `player_statements`
(
	`id` INT NOT NULL AUTO_INCREMENT,
	`player_id` INT NOT NULL,
	`channel_id` INT NOT NULL DEFAULT 0,
	`text` VARCHAR (255) NOT NULL,
	`date` BIGINT NOT NULL DEFAULT 0,
	PRIMARY KEY (`id`), KEY (`player_id`), KEY (`channel_id`),
	FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE
) ENGINE = InnoDB;

 

Sqlite

 

DROP TABLE IF EXISTS player_statements;
CREATE TABLE player_statements ( 
    id         INTEGER         PRIMARY KEY,
    player_id  INTEGER         NOT NULL,
    channel_id INTEGER         NOT NULL
                               DEFAULT '0',
    text       VARCHAR( 255 )  NOT NULL,
    date       INTEGER         NOT NULL
                               DEFAULT '0',
    FOREIGN KEY ( player_id ) REFERENCES players ( id ) 
);

 




player_storage


Mysql

DROP TABLE IF EXISTS `player_storage`;
CREATE TABLE `player_storage`
(
	`player_id` INT NOT NULL,
	`key` VARCHAR(32) NOT NULL DEFAULT '0',
	`value` TEXT NOT NULL,
	KEY (`player_id`), UNIQUE (`player_id`, `key`),
	FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE
) ENGINE = InnoDB;

 

Sqlite

 

DROP TABLE IF EXISTS player_storage;
CREATE TABLE player_storage ( 
    player_id INTEGER         NOT NULL,
    [key]     VARCHAR( 32 )   NOT NULL,
    value     VARCHAR( 255 )  NOT NULL
                              DEFAULT '0',
    UNIQUE ( player_id, [key] ),
    FOREIGN KEY ( player_id ) REFERENCES players ( id ) 
);

 




player_viplist


Mysql

DROP TABLE IF EXISTS `player_viplist`;
CREATE TABLE `player_viplist`
(
	`player_id` INT NOT NULL,
	`vip_id` INT NOT NULL,
	`description` VARCHAR( 128 ) NOT NULL,
	`icon` INT( 11 ) UNSIGNED NOT NULL,
	`notify` BOOLEAN NOT NULL,
	KEY (`player_id`), KEY (`vip_id`), UNIQUE (`player_id`, `vip_id`),
	FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE,
	FOREIGN KEY (`vip_id`) REFERENCES `players`(`id`) ON DELETE CASCADE
) ENGINE = InnoDB;

 

Sqlite

 

DROP TABLE IF EXISTS player_viplist;
CREATE TABLE player_viplist ( 
    player_id   INTEGER         NOT NULL,
    vip_id      INTEGER         NOT NULL,
    description VARCHAR( 128 )  NOT NULL
                                DEFAULT '''',
    icon        INTEGER         NOT NULL
                                DEFAULT '0',
    notify      BOOLEAN         NOT NULL
                                DEFAULT '''',
    UNIQUE ( player_id, vip_id ),
    FOREIGN KEY ( player_id ) REFERENCES players ( id ),
    FOREIGN KEY ( vip_id ) REFERENCES players ( id ) 
);

 




players


Mysql

DROP TABLE IF EXISTS `players`;
CREATE TABLE `players` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `world_id` tinyint(4) unsigned NOT NULL DEFAULT '0',
  `group_id` int(11) NOT NULL DEFAULT '1',
  `account_id` int(11) NOT NULL DEFAULT '0',
  `level` int(11) NOT NULL DEFAULT '10',
  `vocation` int(11) NOT NULL DEFAULT '0',
  `health` int(11) NOT NULL DEFAULT '150',
  `healthmax` int(11) NOT NULL DEFAULT '150',
  `experience` bigint(20) unsigned NOT NULL DEFAULT '0',
  `lookbody` int(11) NOT NULL DEFAULT '0',
  `lookfeet` int(11) NOT NULL DEFAULT '0',
  `lookhead` int(11) NOT NULL DEFAULT '0',
  `looklegs` int(11) NOT NULL DEFAULT '0',
  `looktype` int(11) NOT NULL DEFAULT '136',
  `lookaddons` int(11) NOT NULL DEFAULT '0',
  `lookmount` int(11) NOT NULL DEFAULT '0',
  `maglevel` int(11) NOT NULL DEFAULT '0',
  `mana` int(11) NOT NULL DEFAULT '0',
  `manamax` int(11) NOT NULL DEFAULT '0',
  `manaspent` bigint(20) unsigned NOT NULL DEFAULT '0',
  `soul` int(10) unsigned NOT NULL DEFAULT '0',
  `town_id` int(11) NOT NULL DEFAULT '2',
  `posx` int(11) NOT NULL DEFAULT '32369',
  `posy` int(11) NOT NULL DEFAULT '32241',
  `posz` int(11) NOT NULL DEFAULT '7',
  `conditions` blob NOT NULL,
  `cap` int(11) NOT NULL DEFAULT '0',
  `sex` int(11) NOT NULL DEFAULT '0',
  `lastlogin` bigint(20) unsigned NOT NULL DEFAULT '0',
  `lastip` int(10) unsigned NOT NULL DEFAULT '0',
  `save` tinyint(1) NOT NULL DEFAULT '1',
  `skull` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `skulltime` int(11) NOT NULL DEFAULT '0',
  `rank_id` int(11) NOT NULL DEFAULT '0',
  `guildnick` varchar(255) NOT NULL DEFAULT '',
  `lastlogout` bigint(20) unsigned NOT NULL DEFAULT '0',
  `blessings` tinyint(2) NOT NULL DEFAULT '0',
  `pvp_blessing` tinyint(1) NOT NULL DEFAULT '0',
  `balance` bigint(20) unsigned NOT NULL DEFAULT '0',
  `stamina` bigint(20) unsigned NOT NULL DEFAULT '151200000' COMMENT 'stored in miliseconds',
  `direction` int(11) NOT NULL DEFAULT '2',
  `loss_experience` int(11) NOT NULL DEFAULT '100',
  `loss_mana` int(11) NOT NULL DEFAULT '100',
  `loss_skills` int(11) NOT NULL DEFAULT '100',
  `loss_containers` int(11) NOT NULL DEFAULT '100',
  `loss_items` int(11) NOT NULL DEFAULT '100',
  `premend` int(11) NOT NULL DEFAULT '0' COMMENT 'NOT IN USE BY THE SERVER',
  `online` tinyint(1) NOT NULL DEFAULT '0',
  `marriage` int(10) unsigned NOT NULL DEFAULT '0',
  `promotion` int(11) NOT NULL DEFAULT '0',
  `deleted` int(11) NOT NULL DEFAULT '0',
  `description` varchar(255) NOT NULL DEFAULT '',
  `comment` text NOT NULL,
  `create_ip` int(11) NOT NULL DEFAULT '0',
  `create_date` int(11) NOT NULL DEFAULT '0',
  `hide_char` int(11) NOT NULL DEFAULT '0',
  `signature` text NOT NULL,
  `offlinetraining_time` smallint(5) unsigned NOT NULL DEFAULT '43200',
  `offlinetraining_skill` int(11) NOT NULL DEFAULT '-1',
  `cast` tinyint(4) NOT NULL DEFAULT '0',
  `castViewers` int(11) NOT NULL DEFAULT '0',
  `castDescription` varchar(255) NOT NULL,
  `created` int(11) NOT NULL DEFAULT '0',
  `nick_verify` int(11) NOT NULL DEFAULT '0',
  `old_name` varchar(255) NOT NULL DEFAULT '',
  `worldtransfer` int(11) NOT NULL DEFAULT '0',
  `show_outfit` tinyint(4) NOT NULL DEFAULT '1',
  `show_eq` tinyint(4) NOT NULL DEFAULT '1',
  `show_bars` tinyint(4) NOT NULL DEFAULT '1',
  `show_skills` tinyint(4) NOT NULL DEFAULT '1',
  `show_quests` tinyint(4) NOT NULL DEFAULT '1',
  `stars` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`,`deleted`),
  KEY `account_id` (`account_id`),
  KEY `group_id` (`group_id`),
  KEY `online` (`online`),
  KEY `deleted` (`deleted`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=21 ;

INSERT INTO `players` VALUES (1, 'Account Manager', 0, 1, 1, 8, 0, 180, 180, 4200, 0, 0, 0, 0, 110, 0, 0, 0, 35, 35, 0, 0, 2, 32369, 32241, 7, '', 400, 0, 1400804121, 202641162, 0, 0, 0, 0, '', 0, 0, 0, 0, 201660000, 0, 100, 100, 100, 100, 100, 0, 0, 0, 0, 0, '', '', 0, 0, 0, '', 43200, -1, 0, 0, '', 0, 0, '', 0, 1, 1, 1, 1, 1, 0);

 

Sqlite

 

DROP TABLE IF EXISTS players;
CREATE TABLE players (
    id                    INTEGER           PRIMARY KEY
                                            NOT NULL,
    name                  VARCHAR( 255 )    NOT NULL,
    world_id              INTEGER           NOT NULL
                                            DEFAULT '0',
    group_id              INTEGER           NOT NULL
                                            DEFAULT '1',
    account_id            INTEGER           NOT NULL,
    level                 INTEGER           NOT NULL
                                            DEFAULT '1',
    vocation              INTEGER           NOT NULL
                                            DEFAULT '0',
    health                INTEGER           NOT NULL
                                            DEFAULT '100',
    healthmax             INTEGER           NOT NULL
                                            DEFAULT '100',
    experience            INTEGER           NOT NULL
                                            DEFAULT '0',
    lookbody              INTEGER           NOT NULL
                                            DEFAULT '10',
    lookfeet              INTEGER           NOT NULL
                                            DEFAULT '10',
    lookhead              INTEGER           NOT NULL
                                            DEFAULT '10',
    looklegs              INTEGER           NOT NULL
                                            DEFAULT '10',
    looktype              INTEGER           NOT NULL
                                            DEFAULT '136',
    lookaddons            INTEGER           NOT NULL
                                            DEFAULT '0',
    lookmount             INTEGER           NOT NULL
                                            DEFAULT '0',
    maglevel              INTEGER           NOT NULL
                                            DEFAULT '0',
    mana                  INTEGER           NOT NULL
                                            DEFAULT '100',
    manamax               INTEGER           NOT NULL
                                            DEFAULT '100',
    manaspent             INTEGER           NOT NULL
                                            DEFAULT '0',
    soul                  INTEGER           NOT NULL
                                            DEFAULT '0',
    town_id               INTEGER           NOT NULL,
    posx                  INTEGER           NOT NULL
                                            DEFAULT '32369',
    posy                  INTEGER           NOT NULL
                                            DEFAULT '32241',
    posz                  INTEGER           NOT NULL
                                            DEFAULT '7',
    conditions            BLOB              NOT NULL,
    cap                   INTEGER           NOT NULL
                                            DEFAULT '0',
    sex                   INTEGER           NOT NULL
                                            DEFAULT '0',
    lastlogin             INTEGER           NOT NULL
                                            DEFAULT '0',
    lastip                INTEGER           NOT NULL
                                            DEFAULT '0',
    save                  BOOLEAN           NOT NULL
                                            DEFAULT 'TRUE',
    skull                 INTEGER           NOT NULL
                                            DEFAULT '0',
    skulltime             INTEGER           NOT NULL
                                            DEFAULT '0',
    rank_id               INTEGER           NOT NULL,
    guildnick             VARCHAR( 255 )    NOT NULL
                                            DEFAULT '''',
    lastlogout            INTEGER           NOT NULL
                                            DEFAULT '0',
    blessings             INTEGER           NOT NULL
                                            DEFAULT '0',
    pvp_blessing          BOOLEAN           NOT NULL
                                            DEFAULT 'FALSE',
    balance               INTEGER           NOT NULL
                                            DEFAULT '0',
    stamina               INTEGER           NOT NULL
                                            DEFAULT '151200000',
    direction             INTEGER           NOT NULL
                                            DEFAULT '2',
    loss_experience       INTEGER           NOT NULL
                                            DEFAULT '100',
    loss_mana             INTEGER           NOT NULL
                                            DEFAULT '100',
    loss_skills           INTEGER           NOT NULL
                                            DEFAULT '100',
    loss_containers       INTEGER           NOT NULL
                                            DEFAULT '100',
    loss_items            INTEGER           NOT NULL
                                            DEFAULT '100',
    premend               INTEGER           NOT NULL
                                            DEFAULT '0',
    online                INTEGER           NOT NULL
                                            DEFAULT '0',
    marriage              INTEGER           NOT NULL
                                            DEFAULT '0',
    promotion             INTEGER           NOT NULL
                                            DEFAULT '0',
    deleted               INTEGER           NOT NULL
                                            DEFAULT '0',
    description           VARCHAR( 255 )    NOT NULL
                                            DEFAULT '''',
    comment               TEXT            NOT NULL,
    create_ip             INT( 11 )       NOT NULL
                                          DEFAULT '0',
    create_date           INT( 11 )       NOT NULL
                                          DEFAULT '0',
    hide_char             INT( 11 )       NOT NULL
                                          DEFAULT '0',
    signature             TEXT            NOT NULL,
    offlinetraining_time  SMALLINT UNSIGNED NOT NULL
                                            DEFAULT '43200',
    offlinetraining_skill INT               NOT NULL
                                            DEFAULT '-1',
    cast                  TINYINT( 4 )    NOT NULL
                                          DEFAULT '0',
    castViewers           INT( 11 )       NOT NULL
                                          DEFAULT '0',
    castDescription       VARCHAR( 255 )  NOT NULL,
    created               INT( 11 )       NOT NULL
                                          DEFAULT '0',
    nick_verify           INT( 11 )       NOT NULL
                                          DEFAULT '0',
    old_name              VARCHAR( 255 )  NOT NULL
                                          DEFAULT '',
    worldtransfer         INT( 11 )       NOT NULL
                                          DEFAULT '0',
    show_outfit           TINYINT( 4 )    NOT NULL
                                          DEFAULT '1',
    show_eq               TINYINT( 4 )    NOT NULL
                                          DEFAULT '1',
    show_bars             TINYINT( 4 )    NOT NULL
                                          DEFAULT '1',
    show_skills           TINYINT( 4 )    NOT NULL
                                          DEFAULT '1',
    show_quests           TINYINT( 4 )    NOT NULL
                                          DEFAULT '1',
    stars                 INT( 10 )       NOT NULL
                                          DEFAULT '0',
    ip                    VARCHAR( 17 )     NOT NULL
                                            DEFAULT '0',
    UNIQUE ( name, deleted ),
    FOREIGN KEY ( account_id ) REFERENCES accounts ( id )
);
INSERT INTO `players` VALUES (1, 'Account Manager', 0, 1, 1, 8, 0, 180, 180, 4200, 0, 0, 0, 0, 110, 0, 0, 0, 35, 35, 0, 0, 2, 32369, 32241, 7, '', 400, 0, 1400804121, 202641162, 0, 0, 0, 0, '', 0, 0, 0, 0, 201660000, 0, 100, 100, 100, 100, 100, 0, 0, 0, 0, 0, '', '', 0, 0, 0, '', 43200, -1, 0, 0, '', 0, 0, '', 0, 1, 1, 1, 1, 1, 0, 0);

 




server_config


Mysql

DROP TABLE IF EXISTS `server_config`;
CREATE TABLE `server_config`
(
	`config` VARCHAR(35) NOT NULL DEFAULT '',
	`value` VARCHAR(255) NOT NULL DEFAULT '',
	UNIQUE (`config`)
) ENGINE = InnoDB;

INSERT INTO `server_config` VALUES ('db_version', 31);

 

Sqlite

 

DROP TABLE IF EXISTS server_config;
CREATE TABLE server_config ( 
    config VARCHAR( 35 )   NOT NULL
                           DEFAULT '''',
    value  VARCHAR( 255 )  NOT NULL
                           DEFAULT '''',
    UNIQUE ( config ) 
);
INSERT INTO `server_config` VALUES ('db_version', 31);

 




server_motd


Mysql

DROP TABLE IF EXISTS `server_motd`;
CREATE TABLE `server_motd`
(
	`id` INT UNSIGNED NOT NULL,
	`world_id` TINYINT(4) UNSIGNED NOT NULL DEFAULT 0,
	`text` TEXT NOT NULL,
	UNIQUE (`id`, `world_id`)
) ENGINE = InnoDB;

INSERT INTO `server_motd` VALUES (1, 0, 'Welcome to The Forgotten Server!');

 



Sqlite

 

DROP TABLE IF EXISTS server_motd;
CREATE TABLE server_motd ( 
    id       INTEGER NOT NULL,
    world_id INTEGER NOT NULL
                     DEFAULT '0',
    text     TEXT    NOT NULL
                     DEFAULT '''',
    UNIQUE ( id, world_id ) 
);
INSERT INTO `server_motd` VALUES (1, 0, 'Welcome to The Forgotten Server!');

 




server_record


Mysql

DROP TABLE IF EXISTS `server_record`;
CREATE TABLE `server_record`
(
	`record` INT NOT NULL,
	`world_id` TINYINT(4) UNSIGNED NOT NULL DEFAULT 0,
	`timestamp` BIGINT NOT NULL,
	UNIQUE (`record`, `world_id`, `timestamp`)
) ENGINE = InnoDB;

INSERT INTO `server_record` VALUES (0, 0, 0);

 



Sqlite

 

DROP TABLE IF EXISTS server_record;
CREATE TABLE server_record ( 
    record    INTEGER NOT NULL,
    world_id  INTEGER NOT NULL
                      DEFAULT '0',
    timestamp INTEGER NOT NULL,
    UNIQUE ( record, world_id, timestamp ) 
);
INSERT INTO `server_record` VALUES (0, 0, 0);

 




server_reports


Mysql

DROP TABLE IF EXISTS `server_reports`;
CREATE TABLE `server_reports`
(
	`id` INT NOT NULL AUTO_INCREMENT,
	`world_id` TINYINT(4) UNSIGNED NOT NULL DEFAULT 0,
	`player_id` INT NOT NULL DEFAULT 1,
	`posx` INT NOT NULL DEFAULT 32369,
	`posy` INT NOT NULL DEFAULT 32241,
	`posz` INT NOT NULL DEFAULT 7,
	`timestamp` BIGINT NOT NULL DEFAULT 0,
	`report` TEXT NOT NULL,
	`reads` INT NOT NULL DEFAULT 0,
	PRIMARY KEY (`id`),
	KEY (`world_id`), KEY (`reads`),
	FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE
) ENGINE = InnoDB;

 

Sqlite

 

DROP TABLE IF EXISTS server_reports;
CREATE TABLE server_reports ( 
    id        INTEGER PRIMARY KEY,
    world_id  INTEGER NOT NULL
                      DEFAULT '0',
    player_id INTEGER NOT NULL
                      DEFAULT '0',
    posx      INTEGER NOT NULL
                      DEFAULT '0',
    posy      INTEGER NOT NULL
                      DEFAULT '0',
    posz      INTEGER NOT NULL
                      DEFAULT '0',
    timestamp INTEGER NOT NULL
                      DEFAULT '0',
    report    TEXT    NOT NULL
                      DEFAULT '''',
    reads     INTEGER NOT NULL
                      DEFAULT '0' 
);

 




tile_items


Mysql

DROP TABLE IF EXISTS `tile_items`;
CREATE TABLE `tile_items`
(
	`tile_id` INT UNSIGNED NOT NULL,
	`world_id` TINYINT(4) UNSIGNED NOT NULL DEFAULT 0,
	`sid` INT NOT NULL,
	`pid` INT NOT NULL DEFAULT 0,
	`itemtype` INT NOT NULL,
	`count` INT NOT NULL DEFAULT 0,
	`attributes` BLOB NOT NULL,
	UNIQUE (`tile_id`, `world_id`, `sid`), KEY (`sid`),
	FOREIGN KEY (`tile_id`) REFERENCES `tiles`(`id`) ON DELETE CASCADE
) ENGINE = InnoDB;

 

Sqlite

 

DROP TABLE IF EXISTS tile_items;
CREATE TABLE tile_items ( 
    tile_id    INTEGER NOT NULL,
    world_id   INTEGER NOT NULL
                       DEFAULT '0',
    sid        INTEGER NOT NULL,
    pid        INTEGER NOT NULL
                       DEFAULT '0',
    itemtype   INTEGER NOT NULL,
    count      INTEGER NOT NULL
                       DEFAULT '0',
    attributes BLOB    NOT NULL,
    UNIQUE ( tile_id, world_id, sid ),
    FOREIGN KEY ( tile_id ) REFERENCES tiles ( id ) 
);

 




tile_store


Mysql

DROP TABLE IF EXISTS `tile_store`;
CREATE TABLE `tile_store`
(
	`house_id` INT UNSIGNED NOT NULL,
	`world_id` TINYINT(4) UNSIGNED NOT NULL DEFAULT 0,
	`data` LONGBLOB NOT NULL,
	FOREIGN KEY (`house_id`) REFERENCES `houses` (`id`) ON DELETE CASCADE
) ENGINE = InnoDB;

 



Sqlite

 

DROP TABLE IF EXISTS tile_store;
CREATE TABLE tile_store ( 
    house_id INTEGER  NOT NULL,
    world_id INTEGER  NOT NULL
                      DEFAULT '0',
    data     LONGBLOB NOT NULL,
    FOREIGN KEY ( house_id ) REFERENCES houses ( id ) 
);

 




tiles


Mysql

DROP TABLE IF EXISTS `tiles`;
CREATE TABLE `tiles`
(
	`id` INT UNSIGNED NOT NULL,
	`world_id` TINYINT(4) UNSIGNED NOT NULL DEFAULT 0,
	`house_id` INT UNSIGNED NOT NULL,
	`x` INT(5) UNSIGNED NOT NULL,
	`y` INT(5) UNSIGNED NOT NULL,
	`z` TINYINT(2) UNSIGNED NOT NULL,
	UNIQUE (`id`, `world_id`),
	KEY (`x`, `y`, `z`),
	FOREIGN KEY (`house_id`, `world_id`) REFERENCES `houses`(`id`, `world_id`) ON DELETE CASCADE
) ENGINE = InnoDB;

 



Sqlite

DROP TABLE IF EXISTS tiles;
CREATE TABLE tiles ( 
    id       INTEGER NOT NULL,
    world_id INTEGER NOT NULL
                     DEFAULT '0',
    house_id INTEGER NOT NULL,
    x        INTEGER NOT NULL,
    y        INTEGER NOT NULL,
    z        INTEGER NOT NULL,
    UNIQUE ( id, world_id ),
    FOREIGN KEY ( house_id, world_id ) REFERENCES houses ( id, world_id ) 
);

 


 

 

announcements


Mysql

DROP TABLE IF EXISTS `announcements`;
CREATE TABLE IF NOT EXISTS `announcements` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `title` varchar(50) NOT NULL,
  `text` varchar(255) NOT NULL,
  `date` varchar(20) NOT NULL,
  `author` varchar(50) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

 



Sqlite

DROP TABLE IF EXISTS announcements;
CREATE TABLE announcements ( 
    id     INT( 10 )       NOT NULL,
    title  VARCHAR( 50 )   NOT NULL,
    text   VARCHAR( 255 )  NOT NULL,
    date   VARCHAR( 20 )   NOT NULL,
    author VARCHAR( 50 )   NOT NULL,
    PRIMARY KEY ( id ) 
);

 


 

 

pagsegurotransacoes


Mysql

 

DROP TABLE IF EXISTS `pagsegurotransacoes`;
CREATE TABLE IF NOT EXISTS `pagsegurotransacoes` (
  `TransacaoID` varchar(36) NOT NULL,
  `VendedorEmail` varchar(200) NOT NULL,
  `Referencia` varchar(200) DEFAULT NULL,
  `TipoFrete` char(2) DEFAULT NULL,
  `ValorFrete` decimal(10,2) DEFAULT NULL,
  `Extras` decimal(10,2) DEFAULT NULL,
  `Anotacao` text,
  `TipoPagamento` varchar(50) NOT NULL,
  `StatusTransacao` varchar(50) NOT NULL,
  `CliNome` varchar(200) NOT NULL,
  `CliEmail` varchar(200) NOT NULL,
  `CliEndereco` varchar(200) NOT NULL,
  `CliNumero` varchar(10) DEFAULT NULL,
  `CliComplemento` varchar(100) DEFAULT NULL,
  `CliBairro` varchar(100) NOT NULL,
  `CliCidade` varchar(100) NOT NULL,
  `CliEstado` char(2) NOT NULL,
  `CliCEP` varchar(9) NOT NULL,
  `CliTelefone` varchar(14) DEFAULT NULL,
  `NumItens` int(11) NOT NULL,
  `Data` datetime NOT NULL,
  `ProdQuantidade_x` int(5) NOT NULL,
  `status` tinyint(1) unsigned NOT NULL DEFAULT '0',
  UNIQUE KEY `TransacaoID` (`TransacaoID`,`StatusTransacao`),
  KEY `Referencia` (`Referencia`),
  KEY `status` (`status`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

 



Sqlite

DROP TABLE IF EXISTS pagsegurotransacoes;
CREATE TABLE pagsegurotransacoes ( 
    TransacaoID      VARCHAR( 36 )     NOT NULL,
    VendedorEmail    VARCHAR( 200 )    NOT NULL,
    Referencia       VARCHAR( 200 )    DEFAULT 'NULL'
                                       COLLATE 'SQLITESTUDIO_DICTIONARY',
    TipoFrete        CHAR( 2 )         DEFAULT 'NULL',
    ValorFrete       DECIMAL( 10, 2 )  DEFAULT 'NULL',
    Extras           DECIMAL( 10, 2 )  DEFAULT 'NULL',
    Anotacao         TEXT,
    TipoPagamento    VARCHAR( 50 )     NOT NULL,
    StatusTransacao  VARCHAR( 50 )     NOT NULL,
    CliNome          VARCHAR( 200 )    NOT NULL,
    CliEmail         VARCHAR( 200 )    NOT NULL,
    CliEndereco      VARCHAR( 200 )    NOT NULL,
    CliNumero        VARCHAR( 10 )     DEFAULT 'NULL',
    CliComplemento   VARCHAR( 100 )    DEFAULT 'NULL',
    CliBairro        VARCHAR( 100 )    NOT NULL,
    CliCidade        VARCHAR( 100 )    NOT NULL,
    CliEstado        CHAR( 2 )         NOT NULL,
    CliCEP           VARCHAR( 9 )      NOT NULL,
    CliTelefone      VARCHAR( 14 )     DEFAULT 'NULL',
    NumItens         INT( 11 )         NOT NULL,
    Data             DATETIME          NOT NULL,
    ProdQuantidade_x INT( 5 )          NOT NULL,
    status           TINYINT( 1 )      NOT NULL
                                       DEFAULT '0',
    UNIQUE ( TransacaoID, StatusTransacao ) 
);

 




player_advances


Mysql

 

DROP TABLE IF EXISTS `player_advances`;
CREATE TABLE IF NOT EXISTS `player_advances` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `cid` int(11) DEFAULT NULL,
  `skill` int(11) DEFAULT NULL,
  `oldlevel` int(11) DEFAULT NULL,
  `newlevel` int(11) DEFAULT NULL,
  `time` int(11) DEFAULT NULL,
  UNIQUE KEY `id` (`id`),
  KEY `cid` (`cid`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3337 ;

 



Sqlite

DROP TABLE IF EXISTS player_advances;
CREATE TABLE player_advances ( 
    id       INT( 11 )  NOT NULL,
    cid      INT( 11 )  DEFAULT NULL,
    skill    INT( 11 )  DEFAULT NULL,
    oldlevel INT( 11 )  DEFAULT NULL,
    newlevel INT( 11 )  DEFAULT NULL,
    time     INT( 11 )  DEFAULT NULL,
    UNIQUE ( id ) 
);

 




reports


Mysql

DROP TABLE IF EXISTS `reports`;
CREATE TABLE IF NOT EXISTS `reports` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `world_id` tinyint(4) unsigned NOT NULL DEFAULT '0',
  `player_id` int(11) NOT NULL DEFAULT '1',
  `posx` int(11) NOT NULL DEFAULT '32369',
  `posy` int(11) NOT NULL DEFAULT '32241',
  `posz` int(11) NOT NULL DEFAULT '7',
  `timestamp` bigint(20) NOT NULL DEFAULT '0',
  `report` text NOT NULL,
  `reads` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `world_id` (`world_id`),
  KEY `reads` (`reads`),
  KEY `player_id` (`player_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

 



Sqlite

DROP TABLE IF EXISTS reports;
CREATE TABLE reports ( 
    id        INT( 11 )     NOT NULL,
    world_id  TINYINT( 4 )  NOT NULL
                            DEFAULT '0',
    player_id INT( 11 )     NOT NULL
                            DEFAULT '1',
    posx      INT( 11 )     NOT NULL
                            DEFAULT '32369',
    posy      INT( 11 )     NOT NULL
                            DEFAULT '32241',
    posz      INT( 11 )     NOT NULL
                            DEFAULT '7',
    timestamp BIGINT( 20 )  NOT NULL
                            DEFAULT '0',
    report    TEXT          NOT NULL,
    reads     INT( 11 )     NOT NULL
                            DEFAULT '0',
    PRIMARY KEY ( id ) 
);

 

 

 


thanks


Mysql

 

DROP TABLE IF EXISTS `thanks`;
CREATE TABLE IF NOT EXISTS `thanks` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `account_id` varchar(30) NOT NULL,
  `forum_id` text NOT NULL,
  `player_name` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

 



Sqlite

DROP TABLE IF EXISTS thanks;
CREATE TABLE thanks ( 
    id          INT( 10 )      NOT NULL,
    account_id  VARCHAR( 30 )  NOT NULL,
    forum_id    TEXT           NOT NULL,
    player_name TEXT           NOT NULL,
    PRIMARY KEY ( id ) 
);

 

 

 


z_bug_logs


Mysql

DROP TABLE IF EXISTS `z_bug_logs`;
CREATE TABLE IF NOT EXISTS `z_bug_logs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `account_id` int(11) NOT NULL,
  `status` tinyint(1) NOT NULL DEFAULT '0',
  `description` text NOT NULL,
  `time` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

 



Sqlite

DROP TABLE IF EXISTS z_bug_logs;
CREATE TABLE z_bug_logs ( 
    id          INT( 11 )     NOT NULL,
    account_id  INT( 11 )     NOT NULL,
    status      TINYINT( 1 )  NOT NULL
                              DEFAULT '0',
    description TEXT          NOT NULL,
    time        INT( 11 )     NOT NULL,
    PRIMARY KEY ( id ) 
);

 

 

 


z_featured_article


Mysql

DROP TABLE IF EXISTS `z_featured_article`;
CREATE TABLE IF NOT EXISTS `z_featured_article` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(50) NOT NULL,
  `text` varchar(255) NOT NULL,
  `date` varchar(30) NOT NULL,
  `author` varchar(50) NOT NULL,
  `read_more` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

 



Sqlite

DROP TABLE IF EXISTS `z_featured_article`;
CREATE TABLE z_featured_article ( 
    id        INT( 11 )       NOT NULL,
    title     VARCHAR( 50 )   NOT NULL,
    text      VARCHAR( 255 )  NOT NULL,
    date      VARCHAR( 30 )   NOT NULL,
    author    VARCHAR( 50 )   NOT NULL,
    read_more VARCHAR( 100 )  NOT NULL,
    PRIMARY KEY ( id ) 
);

 

 

 


z_forum


Mysql

DROP TABLE IF EXISTS `z_forum`;
CREATE TABLE IF NOT EXISTS `z_forum` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `sticky` tinyint(1) NOT NULL DEFAULT '0',
  `closed` tinyint(1) NOT NULL DEFAULT '0',
  `first_post` int(11) NOT NULL DEFAULT '0',
  `last_post` int(11) NOT NULL DEFAULT '0',
  `section` int(3) NOT NULL DEFAULT '0',
  `replies` int(20) NOT NULL DEFAULT '0',
  `views` int(20) NOT NULL DEFAULT '0',
  `author_aid` int(20) NOT NULL DEFAULT '0',
  `author_guid` int(20) NOT NULL DEFAULT '0',
  `post_text` text NOT NULL,
  `post_topic` varchar(255) NOT NULL,
  `post_smile` tinyint(1) NOT NULL DEFAULT '0',
  `post_date` int(20) NOT NULL DEFAULT '0',
  `last_edit_aid` int(20) NOT NULL DEFAULT '0',
  `edit_date` int(20) NOT NULL DEFAULT '0',
  `post_ip` varchar(15) NOT NULL DEFAULT '0.0.0.0',
  `icon_id` tinyint(4) NOT NULL DEFAULT '1',
  `post_icon_id` tinyint(10) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `section` (`section`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;

 



Sqlite

DROP TABLE IF EXISTS z_forum;
CREATE TABLE z_forum ( 
    id            INT( 11 )       NOT NULL,
    sticky        TINYINT( 1 )    NOT NULL
                                  DEFAULT '0',
    closed        TINYINT( 1 )    NOT NULL
                                  DEFAULT '0',
    first_post    INT( 11 )       NOT NULL
                                  DEFAULT '0',
    last_post     INT( 11 )       NOT NULL
                                  DEFAULT '0',
    section       INT( 3 )        NOT NULL
                                  DEFAULT '0',
    replies       INT( 20 )       NOT NULL
                                  DEFAULT '0',
    views         INT( 20 )       NOT NULL
                                  DEFAULT '0',
    author_aid    INT( 20 )       NOT NULL
                                  DEFAULT '0',
    author_guid   INT( 20 )       NOT NULL
                                  DEFAULT '0',
    post_text     TEXT            NOT NULL,
    post_topic    VARCHAR( 255 )  NOT NULL,
    post_smile    TINYINT( 1 )    NOT NULL
                                  DEFAULT '0',
    post_date     INT( 20 )       NOT NULL
                                  DEFAULT '0',
    last_edit_aid INT( 20 )       NOT NULL
                                  DEFAULT '0',
    edit_date     INT( 20 )       NOT NULL
                                  DEFAULT '0',
    post_ip       VARCHAR( 15 )   NOT NULL
                                  DEFAULT '0.0.0.0',
    icon_id       TINYINT( 4 )    NOT NULL
                                  DEFAULT '1',
    post_icon_id  TINYINT( 10 )   NOT NULL,
    PRIMARY KEY ( id ) 
);

 

 

 


z_helpdesk


Mysql

DROP TABLE IF EXISTS `z_helpdesk`;
CREATE TABLE IF NOT EXISTS `z_helpdesk` (
  `account` varchar(255) NOT NULL,
  `type` int(11) NOT NULL,
  `status` int(11) NOT NULL,
  `text` text NOT NULL,
  `id` int(11) NOT NULL,
  `subject` varchar(255) NOT NULL,
  `priority` int(11) NOT NULL,
  `reply` int(11) NOT NULL,
  `who` int(11) NOT NULL,
  `uid` int(11) NOT NULL AUTO_INCREMENT,
  `tag` int(11) NOT NULL,
  `registered` int(11) NOT NULL,
  PRIMARY KEY (`uid`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=26 ;

 



Sqlite

DROP TABLE IF EXISTS z_helpdesk;
CREATE TABLE z_helpdesk ( 
    account    VARCHAR( 255 )  NOT NULL,
    type       INT( 11 )       NOT NULL,
    status     INT( 11 )       NOT NULL,
    text       TEXT            NOT NULL,
    id         INT( 11 )       NOT NULL,
    subject    VARCHAR( 255 )  NOT NULL,
    priority   INT( 11 )       NOT NULL,
    reply      INT( 11 )       NOT NULL,
    who        INT( 11 )       NOT NULL,
    uid        INT( 11 )       NOT NULL,
    tag        INT( 11 )       NOT NULL,
    registered INT( 11 )       NOT NULL,
    PRIMARY KEY ( uid ) 
);

 

 

 


z_monsters


Mysql

DROP TABLE IF EXISTS `z_monsters`;
CREATE TABLE IF NOT EXISTS `z_monsters` (
  `hide_creature` tinyint(1) NOT NULL DEFAULT '0',
  `name` varchar(255) NOT NULL,
  `mana` int(11) NOT NULL,
  `exp` int(11) NOT NULL,
  `health` int(11) NOT NULL,
  `speed_lvl` int(11) NOT NULL DEFAULT '1',
  `use_haste` tinyint(1) NOT NULL,
  `voices` text NOT NULL,
  `immunities` varchar(255) NOT NULL,
  `summonable` tinyint(1) NOT NULL,
  `convinceable` tinyint(1) NOT NULL,
  `race` varchar(255) NOT NULL,
  `loot` text NOT NULL,
  `gfx_name` varchar(255) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

 



Sqlite

DROP TABLE IF EXISTS `z_monsters`;
CREATE TABLE z_monsters ( 
    hide_creature TINYINT( 1 )    NOT NULL
                                  DEFAULT '0',
    name          VARCHAR( 255 )  NOT NULL,
    mana          INT( 11 )       NOT NULL,
    exp           INT( 11 )       NOT NULL,
    health        INT( 11 )       NOT NULL,
    speed_lvl     INT( 11 )       NOT NULL
                                  DEFAULT '1',
    use_haste     TINYINT( 1 )    NOT NULL,
    voices        TEXT            NOT NULL,
    immunities    VARCHAR( 255 )  NOT NULL,
    summonable    TINYINT( 1 )    NOT NULL,
    convinceable  TINYINT( 1 )    NOT NULL,
    race          VARCHAR( 255 )  NOT NULL,
    loot          TEXT            NOT NULL,
    gfx_name      VARCHAR( 255 )  NOT NULL 
);

 

 

 


z_network_box


Mysql


DROP TABLE IF EXISTS `z_network_box`;
CREATE TABLE IF NOT EXISTS `z_network_box` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `network_name` varchar(10) NOT NULL,
  `network_link` varchar(50) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

 



Sqlite

DROP TABLE IF EXISTS z_network_box;
CREATE TABLE z_network_box ( 
    id           INT( 11 )      NOT NULL,
    network_name VARCHAR( 10 )  NOT NULL,
    network_link VARCHAR( 50 )  NOT NULL,
    PRIMARY KEY ( id ) 
);

 

 

 


z_news_tickers


Mysql


DROP TABLE IF EXISTS `z_news_tickers`;
CREATE TABLE IF NOT EXISTS `z_news_tickers` (
  `date` int(11) NOT NULL DEFAULT '1',
  `author` int(11) NOT NULL,
  `image_id` int(3) NOT NULL DEFAULT '0',
  `text` text NOT NULL,
  `hide_ticker` tinyint(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

 



Sqlite

 

DROP TABLE IF EXISTS z_news_tickers;
CREATE TABLE z_news_tickers ( 
    date        INT( 11 )     NOT NULL
                              DEFAULT '1',
    author      INT( 11 )     NOT NULL,
    image_id    INT( 3 )      NOT NULL
                              DEFAULT '0',
    text        TEXT          NOT NULL,
    hide_ticker TINYINT( 1 )  NOT NULL 
);

 




z_ots_comunication


Mysql

DROP TABLE IF EXISTS `z_ots_comunication`;
CREATE TABLE IF NOT EXISTS `z_ots_comunication` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `type` varchar(255) NOT NULL,
  `action` varchar(255) NOT NULL,
  `param1` varchar(255) NOT NULL,
  `param2` varchar(255) NOT NULL,
  `param3` varchar(255) NOT NULL,
  `param4` varchar(255) NOT NULL,
  `param5` varchar(255) NOT NULL,
  `param6` varchar(255) NOT NULL,
  `param7` varchar(255) NOT NULL,
  `delete_it` int(2) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

 



Sqlite

DROP TABLE IF EXISTS z_ots_comunication;
CREATE TABLE z_ots_comunication ( 
    id        INT( 11 )       NOT NULL,
    name      VARCHAR( 255 )  NOT NULL,
    type      VARCHAR( 255 )  NOT NULL,
    [action]  VARCHAR( 255 )  NOT NULL,
    param1    VARCHAR( 255 )  NOT NULL,
    param2    VARCHAR( 255 )  NOT NULL,
    param3    VARCHAR( 255 )  NOT NULL,
    param4    VARCHAR( 255 )  NOT NULL,
    param5    VARCHAR( 255 )  NOT NULL,
    param6    VARCHAR( 255 )  NOT NULL,
    param7    VARCHAR( 255 )  NOT NULL,
    delete_it INT( 2 )        NOT NULL
                              DEFAULT '1',
    PRIMARY KEY ( id ) 
);

 

 

 


z_polls


Mysql


DROP TABLE IF EXISTS `z_polls`;
CREATE TABLE IF NOT EXISTS `z_polls` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `question` varchar(255) NOT NULL,
  `end` int(11) NOT NULL,
  `start` int(11) NOT NULL,
  `answers` int(11) NOT NULL,
  `votes_all` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

 



Sqlite

 

DROP TABLE IF EXISTS z_polls;
CREATE TABLE z_polls ( 
    id        INT( 11 )       NOT NULL,
    question  VARCHAR( 255 )  NOT NULL,
    [end]     INT( 11 )       NOT NULL,
    start     INT( 11 )       NOT NULL,
    answers   INT( 11 )       NOT NULL,
    votes_all INT( 11 )       NOT NULL,
    PRIMARY KEY ( id ) 
);

 




z_polls_answers


Mysql

DROP TABLE IF EXISTS `z_polls_answers`;
CREATE TABLE IF NOT EXISTS `z_polls_answers` (
  `poll_id` int(11) NOT NULL,
  `answer_id` int(11) NOT NULL,
  `answer` varchar(255) NOT NULL,
  `votes` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

 



Sqlite

DROP TABLE IF EXISTS z_polls_answers;
CREATE TABLE z_polls_answers ( 
    poll_id   INT( 11 )       NOT NULL,
    answer_id INT( 11 )       NOT NULL,
    answer    VARCHAR( 255 )  NOT NULL,
    votes     INT( 11 )       NOT NULL 
);

 


z_poll_votes


Mysql


DROP TABLE IF EXISTS `z_poll_votes`;
CREATE TABLE IF NOT EXISTS `z_poll_votes` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`answer_id` int(11) ,
`poll_id` int(11) ,
`account_id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

 



Sqlite

DROP TABLE IF EXISTS z_poll_votes;
CREATE TABLE z_poll_votes (
    id         INT( 11 )  NOT NULL,
    answer_id  INT( 11 ),
    poll_id    INT( 11 ),
    account_id INT( 11 )  NOT NULL,
    PRIMARY KEY ( id )
);

 

 

 

 

 

z_shop_history_item


Mysql

DROP TABLE IF EXISTS `z_shop_history_item`;
CREATE TABLE IF NOT EXISTS `z_shop_history_item` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `to_name` varchar(255) NOT NULL DEFAULT '0',
  `to_account` int(11) NOT NULL DEFAULT '0',
  `from_nick` varchar(255) NOT NULL,
  `from_account` int(11) NOT NULL DEFAULT '0',
  `price` int(11) NOT NULL DEFAULT '0',
  `offer_id` varchar(255) NOT NULL DEFAULT '',
  `trans_state` varchar(255) NOT NULL,
  `trans_start` int(11) NOT NULL DEFAULT '0',
  `trans_real` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

 



Sqlite

DROP TABLE IF EXISTS z_shop_history_item;
CREATE TABLE z_shop_history_item ( 
    id           INT( 11 )       NOT NULL,
    to_name      VARCHAR( 255 )  NOT NULL
                                 DEFAULT '0',
    to_account   INT( 11 )       NOT NULL
                                 DEFAULT '0',
    from_nick    VARCHAR( 255 )  NOT NULL,
    from_account INT( 11 )       NOT NULL
                                 DEFAULT '0',
    price        INT( 11 )       NOT NULL
                                 DEFAULT '0',
    offer_id     VARCHAR( 255 )  NOT NULL
                                 DEFAULT '',
    trans_state  VARCHAR( 255 )  NOT NULL,
    trans_start  INT( 11 )       NOT NULL
                                 DEFAULT '0',
    trans_real   INT( 11 )       NOT NULL
                                 DEFAULT '0',
    PRIMARY KEY ( id ) 
);

 

 

 


z_shop_history_pacc


Mysql

DROP TABLE IF EXISTS `z_shop_history_pacc`;
CREATE TABLE IF NOT EXISTS `z_shop_history_pacc` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `to_name` varchar(255) NOT NULL DEFAULT '0',
  `to_account` int(11) NOT NULL DEFAULT '0',
  `from_nick` varchar(255) NOT NULL,
  `from_account` int(11) NOT NULL DEFAULT '0',
  `price` int(11) NOT NULL DEFAULT '0',
  `pacc_days` int(11) NOT NULL DEFAULT '0',
  `trans_state` varchar(255) NOT NULL,
  `trans_start` int(11) NOT NULL DEFAULT '0',
  `trans_real` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

 



Sqlite

DROP TABLE IF EXISTS z_shop_history_pacc;
CREATE TABLE z_shop_history_pacc ( 
    id           INT( 11 )       NOT NULL,
    to_name      VARCHAR( 255 )  NOT NULL
                                 DEFAULT '0',
    to_account   INT( 11 )       NOT NULL
                                 DEFAULT '0',
    from_nick    VARCHAR( 255 )  NOT NULL,
    from_account INT( 11 )       NOT NULL
                                 DEFAULT '0',
    price        INT( 11 )       NOT NULL
                                 DEFAULT '0',
    pacc_days    INT( 11 )       NOT NULL
                                 DEFAULT '0',
    trans_state  VARCHAR( 255 )  NOT NULL,
    trans_start  INT( 11 )       NOT NULL
                                 DEFAULT '0',
    trans_real   INT( 11 )       NOT NULL
                                 DEFAULT '0',
    PRIMARY KEY ( id ) 
);

 

 

 


z_shop_offer


Mysql

DROP TABLE IF EXISTS `z_shop_offer`;
CREATE TABLE IF NOT EXISTS `z_shop_offer` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `points` int(11) NOT NULL DEFAULT '0',
  `itemid1` int(11) NOT NULL DEFAULT '0',
  `count1` int(11) NOT NULL DEFAULT '0',
  `itemid2` int(11) NOT NULL DEFAULT '0',
  `count2` int(11) NOT NULL DEFAULT '0',
  `offer_type` varchar(255) DEFAULT NULL,
  `offer_description` text NOT NULL,
  `offer_name` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

 



Sqlite

DROP TABLE IF EXISTS z_shop_offer;
CREATE TABLE z_shop_offer ( 
    id                INT( 11 )       NOT NULL,
    points            INT( 11 )       NOT NULL
                                      DEFAULT '0',
    itemid1           INT( 11 )       NOT NULL
                                      DEFAULT '0',
    count1            INT( 11 )       NOT NULL
                                      DEFAULT '0',
    itemid2           INT( 11 )       NOT NULL
                                      DEFAULT '0',
    count2            INT( 11 )       NOT NULL
                                      DEFAULT '0',
    offer_type        VARCHAR( 255 )  DEFAULT NULL,
    offer_description TEXT            NOT NULL,
    offer_name        VARCHAR( 255 )  NOT NULL,
    PRIMARY KEY ( id ) 
);

 

 

 


z_spells


Mysql

DROP TABLE IF EXISTS `z_spells`;
CREATE TABLE IF NOT EXISTS `z_spells` (
  `name` varchar(255) NOT NULL,
  `spell` varchar(255) NOT NULL,
  `spell_type` varchar(255) NOT NULL,
  `mana` int(11) NOT NULL DEFAULT '0',
  `lvl` int(11) NOT NULL DEFAULT '0',
  `mlvl` int(11) NOT NULL DEFAULT '0',
  `soul` int(11) NOT NULL DEFAULT '0',
  `pacc` varchar(255) NOT NULL,
  `vocations` varchar(255) NOT NULL,
  `conj_count` int(11) NOT NULL DEFAULT '0',
  `hide_spell` int(11) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

 



Sqlite

DROP TABLE IF EXISTS z_spells;
CREATE TABLE z_spells ( 
    name       VARCHAR( 255 )  NOT NULL,
    spell      VARCHAR( 255 )  NOT NULL,
    spell_type VARCHAR( 255 )  NOT NULL,
    mana       INT( 11 )       NOT NULL
                               DEFAULT '0',
    lvl        INT( 11 )       NOT NULL
                               DEFAULT '0',
    mlvl       INT( 11 )       NOT NULL
                               DEFAULT '0',
    soul       INT( 11 )       NOT NULL
                               DEFAULT '0',
    pacc       VARCHAR( 255 )  NOT NULL,
    vocations  VARCHAR( 255 )  NOT NULL,
    conj_count INT( 11 )       NOT NULL
                               DEFAULT '0',
    hide_spell INT( 11 )       NOT NULL
                               DEFAULT '0' 
);

 

 

 


z_news_big


Mysql

DROP TABLE IF EXISTS `z_news_big`;
CREATE TABLE IF NOT EXISTS `z_news_big` 
(
`hide_news` tinyint(1) NOT NULL DEFAULT '0',
`date` int(11) NOT NULL DEFAULT '0',
`author` varchar(255) NOT NULL,
`author_id` int(11) NOT NULL,
`image_id` int(3) NOT NULL DEFAULT '0',
`topic` varchar(255) NOT NULL,
`text` text NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

 



Sqlite

DROP TABLE IF EXISTS z_news_big;
CREATE TABLE z_news_big ( 
    hide_news TINYINT( 1 )    NOT NULL
                              DEFAULT '0',
    date      INT( 11 )       NOT NULL
                              DEFAULT '0',
    author    VARCHAR( 255 )  NOT NULL,
    author_id INT( 11 )       NOT NULL,
    image_id  INT( 3 )        NOT NULL
                              DEFAULT '0',
    topic     VARCHAR( 255 )  NOT NULL,
    text      TEXT            NOT NULL 
);

 

 

 



2°) No such column / "NOME DA TABLE" has no column named "NOME DA COLUMN QUE FALTA" / Insert into
Bom, para resolver esse problema vc deve identificar em qual TABLE está essa coluna que falta. Para isso, basta ler o erro como na imagem:
A6vmUAz.png

No caso da imagem, está faltando a column WORLD_ID dentro da table MARKET_OFFERS. Para resolver, vc deve executar excluir a sua table MARKET_OFFERS existante em sua data base, e em seguida, executar o domando da da market_offers, encontrado acima, logicamente isso só se aplica ao caso da imagem, depende do seu caso, vc deve excutar o comando da table que estiver sendo referida no erro. Mas antes de executá-lo vc deve excluir a sua table EXISTENTE, para então executar o comando.

ESTA FORMA DE RESOLUÇÃO SE APLICA AOS TRÊS CASOS: NO SUCH COLUMN, ...HAS NO COLUMN NAMED... e INSERT INTO.



Bom galera, é isso.

SE ENCONTRAREM, OU SE DEPARAREM COM ALGUM ERRO, BASTA ME PEDIR AJUDA QUE EU DAREI TOTAL SUPORTE PARA VOCÊS!

SE ESTIVER FALTANDO MAIS ALGUMA TABLE QUE EU NÃO COLOQUEI AQUI, PF ME INFORMEM E EU ATUALIZAREI O TÓPICO!!!


Lembrem-se, se eu te ajudei, por favor, deem REP++ pois foi meio trabalhoso fazer este tutorial todo... ^^

ESTOU A DISPOSIÇÃO DE TODOS!


Espero ter ajudado!!

E isso é tudo, pessoal! ^^

Créditos

Eu (@Danihcv)


Abraços.

Editado por Danihcv
Link para o comentário
Compartilhar em outros sites

Que chato ficar abrindo spoiler, é só colar o código todo e executar como query, assim o que estiver faltando vai ser adicionado no seu devido lugar

Link para o comentário
Compartilhar em outros sites

@Beeki, e se a pessoa não quiser perder a data base por completo? Exatamente por isso que é necessário colocar do jeito que eu pus. E assim como o Daniel disse, basta a pessoa se direcionar à table que está com problema e mexer apenas nela.

Link para o comentário
Compartilhar em outros sites

executando a query como eu disse não irá afetar os dados já registrados o.O

 

@daniel

 

minha opinião rs

Editado por Beeki
Link para o comentário
Compartilhar em outros sites

executando a query como eu disse não irá afetar os dados já registrados o.O

 

@daniel

 

minha opinião rs

Na verdade vai sim aheueahu

DROP TABLE IF EXISTS `account_viplist`;

O que aconteceria se eu executasse a query da tabela accounts e depois tentasse logar no otserv?

Editado por fireelement
Link para o comentário
Compartilhar em outros sites

  • 4 weeks later...

Estou com 1 problema gente!

Quando o player morre da esse erro :

[Error - mysql_real_query] Query: INSET INTO 'player_deaths' <player_id', 'time', 'level', 'killer_by', 'is_player', 'mostdamage_by', 'mostdamage_is_player', 'unjustified', 'mostdamage_unjustified'> VALUES <1716, 1431731462, 202, 'Marcello', 1, 'Marcello', 1, 1, 0>
Message: Unknow column 'time' in 'field list'

Por favor ajuda se possivel!

Agradeço des de jah!

Link para o comentário
Compartilhar em outros sites

Obrigado!

Mais deu outro erro depois...

[Error - mysql_real_query] Query: INSET INTO 'player_deaths' <player_id', 'time', 'level', 'killer_by', 'is_player', 'mostdamage_by', 'mostdamage_is_player', 'unjustified', 'mostdamage_unjustified'> VALUES <1716, 1431731462, 202, 'Marcello', 1, 'Marcello', 1, 1, 0>
Message: Unknow column 'level' in 'field list'

Eu fiz um backup da minha database para fazer um teste!

Executei essa query :

ALTER TABLE `player_deaths` ADD `time` int(11) DEFAULT NULL;

Agora deu outro erro :

[Error - mysql_real_query] Query: INSET INTO 'player_deaths' <'player', 'time', 'level', 'killed_by', 'is_player', 'mostdamage_by', 'mostdamage_is_player', 'unjustified', 'mostdamage_unjustified',> VALUES <1716, 1431818464, 198, 'Marcello', 1, 'Marcello', 1, 1, 0>
Message: Unknown column 'killed_by' in 'field list'

Se não for para executar a query ou ela esta errada :

ALTER TABLE `player_deaths` ADD `time` int(11) DEFAULT NULL;

Me fale eu uso a do backup!

Obrigado des de ja!

Link para o comentário
Compartilhar em outros sites

  • 2 years later...

o meu erro é o z_ots_comunication, dae quando eu vou adicionar, eu vou la em Open SQL query editor, dae eu adiciono a table e depois eu faço oque? salvo? onde? nao manjo muito nisso, alguem pode me explicar melhor por favor?

 

Link para o comentário
Compartilhar em outros sites

38 minutos atrás, Emanueldk disse:

o meu erro é o z_ots_comunication, dae quando eu vou adicionar, eu vou la em Open SQL query editor, dae eu adiciono a table e depois eu faço oque? salvo? onde? nao manjo muito nisso, alguem pode me explicar melhor por favor?

 

sqlite?

Link para o comentário
Compartilhar em outros sites

5 horas atrás, Qwizer disse:

graças ao Qwizer, poderia fazer meu ot sem problemas, obrigado mano te amo <3

Editado por Emanueldk
so atualizando
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...