From 9eeb927b991aef81bdc954be92cd061a835516e2 Mon Sep 17 00:00:00 2001
From: Thorbjørn Lindeijer <bjorn@lindeijer.nl>
Date: Sat, 24 Oct 2009 20:54:43 +0200
Subject: Rebranding tmwserv to manaserv

Includes a database update. Use update_6_to_7.sql to update existing
sqlite databases.
---
 src/sql/postgresql/createTables.sql | 64 ++++++++++++++++++-------------------
 1 file changed, 32 insertions(+), 32 deletions(-)

(limited to 'src/sql/postgresql/createTables.sql')

diff --git a/src/sql/postgresql/createTables.sql b/src/sql/postgresql/createTables.sql
index 0d95f38..6767fff 100644
--- a/src/sql/postgresql/createTables.sql
+++ b/src/sql/postgresql/createTables.sql
@@ -1,19 +1,19 @@
-CREATE TABLE tmw_accounts 
-( 
-   id           SERIAL      PRIMARY KEY, 
-   username     TEXT        NOT NULL UNIQUE, 
-   password     TEXT        NOT NULL, 
-   email        TEXT        NOT NULL, 
-   level        SMALLINT    NOT NULL, 
-   banned       SMALLINT    NOT NULL, 
-   registration INTEGER     NOT NULL, 
-   lastlogin    INTEGER     NOT NULL  
+CREATE TABLE mana_accounts
+(
+   id           SERIAL      PRIMARY KEY,
+   username     TEXT        NOT NULL UNIQUE,
+   password     TEXT        NOT NULL,
+   email        TEXT        NOT NULL,
+   level        SMALLINT    NOT NULL,
+   banned       SMALLINT    NOT NULL,
+   registration INTEGER     NOT NULL,
+   lastlogin    INTEGER     NOT NULL
 );
 
-CREATE INDEX tmw_accounts_username ON tmw_accounts ( username );
+CREATE INDEX mana_accounts_username ON mana_accounts ( username );
 
 
-CREATE TABLE tmw_characters 
+CREATE TABLE mana_characters
 (
    id           SERIAL      PRIMARY KEY,
    user_id      INTEGER     NOT NULL,
@@ -46,10 +46,10 @@ CREATE TABLE tmw_characters
    axe_exp      INTEGER     NOT NULL,
    thrown_exp   INTEGER     NOT NULL,
    --
-   FOREIGN KEY (user_id) REFERENCES tmw_accounts(id)
+   FOREIGN KEY (user_id) REFERENCES mana_accounts(id)
 );
 
-CREATE TABLE tmw_inventories 
+CREATE TABLE mana_inventories
 (
    id           SERIAL      PRIMARY KEY,
    owner_id     INTEGER     NOT NULL,
@@ -57,46 +57,46 @@ CREATE TABLE tmw_inventories
    class_id     INTEGER     NOT NULL,
    amount       SMALLINT    NOT NULL,
    --
-   FOREIGN KEY (owner_id) REFERENCES tmw_characters(id)
+   FOREIGN KEY (owner_id) REFERENCES mana_characters(id)
 );
 
-CREATE TABLE tmw_guilds 
+CREATE TABLE mana_guilds
 (
    id           SERIAL      PRIMARY KEY,
-   name 		TEXT        NOT NULL UNIQUE
+   name         TEXT        NOT NULL UNIQUE
 );
 
-CREATE TABLE tmw_guild_members 
+CREATE TABLE mana_guild_members
 (
    guild_id     INTEGER     NOT NULL,
    member_id    INTEGER     NOT NULL,
    rights       INTEGER     NOT NULL,
    --
-   FOREIGN KEY (guild_id)  REFERENCES tmw_guilds(id),
-   FOREIGN KEY (member_id) REFERENCES tmw_characters(id)
+   FOREIGN KEY (guild_id)  REFERENCES mana_guilds(id),
+   FOREIGN KEY (member_id) REFERENCES mana_characters(id)
 );
 
-CREATE INDEX tmw_guild_members_g ON tmw_guild_members ( guild_id );
-CREATE INDEX tmw_guild_members_m ON tmw_guild_members ( member_id );
+CREATE INDEX mana_guild_members_g ON mana_guild_members ( guild_id );
+CREATE INDEX mana_guild_members_m ON mana_guild_members ( member_id );
 
-CREATE TABLE tmw_quests 
+CREATE TABLE mana_quests
 (
    owner_id     INTEGER     NOT NULL,
    name         TEXT        NOT NULL,
    value        TEXT        NOT NULL,
    --
-   FOREIGN KEY (owner_id) REFERENCES tmw_characters(id)
+   FOREIGN KEY (owner_id) REFERENCES mana_characters(id)
 );
 
-CREATE TABLE tmw_world_states 
-( 
-   state_name   TEXT        PRIMARY KEY, 
-   map_id       INTEGER     NULL, 
-   value        TEXT        NULL, 
-   moddate      INTEGER     NOT NULL 
+CREATE TABLE mana_world_states
+(
+   state_name   TEXT        PRIMARY KEY,
+   map_id       INTEGER     NULL,
+   value        TEXT        NULL,
+   moddate      INTEGER     NOT NULL
 );
 
-INSERT INTO "tmw_world_states" VALUES('accountserver_startup',NULL,NULL,1221633910);
-INSERT INTO "tmw_world_states" VALUES('accountserver_version',NULL,NULL,1221633910);
+INSERT INTO "mana_world_states" VALUES('accountserver_startup',NULL,NULL,1221633910);
+INSERT INTO "mana_world_states" VALUES('accountserver_version',NULL,NULL,1221633910);
 
 
-- 
cgit 

