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,