• TibiaFace

    Tibiaface | Una comunidad Open Tibia donde encontras : mapas, scripts, Otserver, npc y amigos etc ...

    .
    demo menumenu

    Afiliados



    Votar:

    solucion a problemas de tablas mysql y sqlite

    Compartir:

    Ver el tema anterior Ver el tema siguiente Ir abajo  Mensaje (Página 1 de 1.)

    1default solucion a problemas de tablas mysql y sqlite el Jue Ene 26, 2017 12:22 am

    [Admin] God Maya

    avatar
    Administrador
    Administrador
    solucion a problemas de tablas mysql y sqlite




    account_viplist
    Spoiler:
    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
    Spoiler:

    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
    Spoiler:

    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
    Spoiler:

    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
    Spoiler:
    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
    Spoiler:

    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
    Spoiler:

    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
    Spoiler:

    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
    Spoiler:

    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
    Spoiler:

    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
    Spoiler:

    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
    Spoiler:
    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
    Spoiler:
    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
    Spoiler:
    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
    Spoiler:
    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
    Spoiler:
    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
    Spoiler:
    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
    Spoiler:
    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
    Spoiler:
    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
    Spoiler:
    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
    Spoiler:
    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
    Spoiler:
    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
    Spoiler:
    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
    Spoiler:
    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
    Spoiler:
    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
    Spoiler:
    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
    Spoiler:
    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
    Spoiler:
    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
    Spoiler:
    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
    Spoiler:
    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
    Spoiler:
    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
    Spoiler:
    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
    Spoiler:
    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 )
    );



    Ver perfil de usuario http://www.tibiaface.com

    gabopoleo

    avatar
    Miembro
    Miembro
    maya una pregunta donde coloco la tabla bans? podrias ayudarme please x.x @UP

    Ver perfil de usuario

    [Admin] God Maya

    avatar
    Administrador
    Administrador
    [Tienes que estar registrado y conectado para ver este vínculo] escribió:maya una pregunta donde coloco la tabla bans? podrias ayudarme please x.x @UP

    si usas mysql en tu phpadmin y busca tu base de datos y la ejecuta en sql


    si usas sqlite en tu base de datos sdb3 la abres con sqlitestudio y la ejecuta ahi



    Ver perfil de usuario http://www.tibiaface.com

    gabopoleo

    avatar
    Miembro
    Miembro
    y donde pondria lo que colocaste adentro de la tabla bans? lo que pasa es que mi ot me deja usar el rule violation y todo poner el comentario etc. pero al final dice this account all ready banned y no me deja banear Sad no se si puedas ayudarme con eso

    Ver perfil de usuario

    [Admin] God Maya

    avatar
    Administrador
    Administrador
    busca en el menu de sqlitestudio el boton que tiene un rayito y cuando le pones el mous ensima dice ejecutar



    Ver perfil de usuario http://www.tibiaface.com

    gabopoleo

    avatar
    Miembro
    Miembro
    gracias papu

    Ver perfil de usuario

    Contenido patrocinado


    Ver el tema anterior Ver el tema siguiente Volver arriba  Mensaje (Página 1 de 1.)

    Permisos de este foro:
    No puedes responder a temas en este foro.

     

    BienvenidosTibiaFace es una comunidad de Open Tibia. Para participar debes estar registrado (click para Regístrate).