From 91a0a44e902bd92b9bb1624c9893e7cb82b27fae Mon Sep 17 00:00:00 2001 From: Polonkai Gergely Date: Tue, 27 Mar 2012 17:45:18 +0000 Subject: [PATCH] Created world-dropping SQL code. Signed-off by: Gergely POLONKAI --- create-world.sh | 8 ++++++++ drop-world.sh | 3 +++ sql/drop-world.sql | 10 ++++++++++ sql/planes.sql | 3 +++ sql/planets.sql | 3 +++ sql/rooms.sql | 3 +++ 6 files changed, 30 insertions(+) create mode 100755 create-world.sh create mode 100755 drop-world.sh create mode 100644 sql/drop-world.sql diff --git a/create-world.sh b/create-world.sh new file mode 100755 index 0000000..d8b2f00 --- /dev/null +++ b/create-world.sh @@ -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 + diff --git a/drop-world.sh b/drop-world.sh new file mode 100755 index 0000000..a42486a --- /dev/null +++ b/drop-world.sh @@ -0,0 +1,3 @@ +#! /bin/bash + +sqlite3 iminiru.db < sql/drop-world.sql diff --git a/sql/drop-world.sql b/sql/drop-world.sql new file mode 100644 index 0000000..8c6b45e --- /dev/null +++ b/sql/drop-world.sql @@ -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; diff --git a/sql/planes.sql b/sql/planes.sql index 708537c..227f8d0 100644 --- a/sql/planes.sql +++ b/sql/planes.sql @@ -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 ( id integer primary key, name varchar(40) not null unique diff --git a/sql/planets.sql b/sql/planets.sql index 9671f99..96fabe6 100644 --- a/sql/planets.sql +++ b/sql/planets.sql @@ -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 ( id integer NOT NULL PRIMARY KEY, name varchar(40) NOT NULL UNIQUE diff --git a/sql/rooms.sql b/sql/rooms.sql index 1d41d4b..3ca32af 100644 --- a/sql/rooms.sql +++ b/sql/rooms.sql @@ -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 ( id integer NOT NULL PRIMARY KEY, short_name varchar(2) NOT NULL UNIQUE,