Created world-dropping SQL code.

Signed-off by: Gergely POLONKAI <polesz@w00d5t0ck.info>
This commit is contained in:
Polonkai Gergely 2012-03-27 17:45:18 +00:00
parent c6e7d2737e
commit 91a0a44e90
6 changed files with 30 additions and 0 deletions

8
create-world.sh Executable file
View File

@ -0,0 +1,8 @@
#! /bin/bash
sqlite3 iminiru.db < sql/planes.sql
sqlite3 iminiru.db < sql/planets.sql
sqlite3 iminiru.db < sql/rooms.sql
sqlite3 iminiru.db < iminiru/data.sql

3
drop-world.sh Executable file
View File

@ -0,0 +1,3 @@
#! /bin/bash
sqlite3 iminiru.db < sql/drop-world.sql

10
sql/drop-world.sql Normal file
View File

@ -0,0 +1,10 @@
-- This SQL script drops all world related tables.
-- Please never drop non-world tables, like players from here!
DROP TABLE planet_planes;
DROP TABLE planets;
DROP TABLE planes;
DROP TABLE room_exits;
DROP TABLE rooms;
DROP TABLE areas;
DROP TABLE directions;

View File

@ -1,3 +1,6 @@
-- Okay, so you update this file. But if you create a table, don't forget to
-- update drop.sql, either!
CREATE TABLE planes ( CREATE TABLE planes (
id integer primary key, id integer primary key,
name varchar(40) not null unique name varchar(40) not null unique

View File

@ -1,3 +1,6 @@
-- Okay, so you update this file. But if you create a table, don't forget to
-- update drop.sql, either!
CREATE TABLE planets ( CREATE TABLE planets (
id integer NOT NULL PRIMARY KEY, id integer NOT NULL PRIMARY KEY,
name varchar(40) NOT NULL UNIQUE name varchar(40) NOT NULL UNIQUE

View File

@ -1,3 +1,6 @@
-- Okay, so you update this file. But if you create a table, don't forget to
-- update drop.sql, either!
CREATE TABLE directions ( CREATE TABLE directions (
id integer NOT NULL PRIMARY KEY, id integer NOT NULL PRIMARY KEY,
short_name varchar(2) NOT NULL UNIQUE, short_name varchar(2) NOT NULL UNIQUE,