You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

367 lines
6.7 KiB
SQL

-- https://docs.microsoft.com/en-us/previous-versions/sql/compact/sql-server-compact-3.5-sp2/ms173372(v=sql.105)?redirectedfrom=MSDN
CREATE TABLE GameData
(
Title nvarchar(250),
OpeningMessage ntext,
HideMainPicDisplay bit,
UseInlineImages bit,
HidePortrait bit,
AuthorName nvarchar(250),
GameVersion nvarchar(50),
GameInformation ntext,
bgMusic nvarchar(250),
RepeatbgMusic bit,
PasswordProtected bit,
GamePassword nvarchar(250),
ObjectVersionNumber nvarchar(250),
GameFont nvarchar(250)
);
CREATE TABLE Rooms
(
UniqueID nvarchar(250),
Description ntext,
SDesc nvarchar(250),
Name nvarchar(250),
RoomPic nvarchar(250),
EnterFirstTime bit,
LeaveFirstTime bit,
[Group] nvarchar(250),
LayeredRoomPic nvarchar(250)
);
CREATE TABLE RoomActions
(
ID int IDENTITY (1, 1) NOT NULL,
RoomID nvarchar(250),
Data ntext
);
CREATE TABLE RoomProperties
(
ID int IDENTITY (1, 1) NOT NULL,
RoomID nvarchar(250),
Name nvarchar(250),
Value ntext
);
CREATE TABLE RoomExits
(
ID int IDENTITY (1, 1) NOT NULL,
RoomID nvarchar(250),
Direction int,
Active bit,
DestinationRoom nvarchar(250),
PortalObjectName nvarchar(250)
);
CREATE TABLE Items
(
UniqueID nvarchar(250),
Name nvarchar(250),
Description ntext,
SDesc nvarchar(250),
Preposition nvarchar(250),
LocationName nvarchar(250),
LocationType int,
Carryable bit,
Wearable bit,
Openable bit,
Lockable bit,
Enterable bit,
Readable bit,
Container bit,
Weight float,
Worn bit,
[Read] bit,
Locked bit,
[Open] bit,
Entered bit,
Visible bit,
EnterFirstTime bit,
LeaveFirstTime bit
);
CREATE TABLE ItemActions
(
ID int IDENTITY (1, 1) NOT NULL,
ItemID nvarchar(250),
Data ntext
);
CREATE TABLE ItemProperties
(
ID int IDENTITY (1, 1) NOT NULL,
ItemID nvarchar(250),
Name nvarchar(250),
Value ntext
);
CREATE TABLE ItemLayeredZoneLevels
(
ID int IDENTITY (1, 1) NOT NULL,
ItemID nvarchar(250),
Data nvarchar(250)
);
CREATE TABLE Media
(
Name nvarchar(250),
BackgroundColor nvarchar(250),
TextColor nvarchar(250),
TextFont nvarchar(250),
ImageName nvarchar(250),
UseEnhancedGraphics bit,
NewImage nvarchar(250),
Data image
);
CREATE TABLE MediaLayeredImages
(
ID int IDENTITY (1, 1) NOT NULL,
MediaName nvarchar(250),
Data nvarchar(250)
);
CREATE TABLE Player
(
Name nvarchar(250),
Description ntext,
StartingRoom nvarchar(250),
CurrentRoom nvarchar(250),
PlayerLayeredImage nvarchar(250),
PlayerGender int,
PromptForName bit,
PromptForGender bit,
PlayerPortrait nvarchar(250),
EnforceWeight bit,
WeightLimit float
);
CREATE TABLE PlayerActions
(
ID int IDENTITY (1, 1) NOT NULL,
Data ntext
);
CREATE TABLE PlayerProperties
(
ID int IDENTITY (1, 1) NOT NULL,
Name nvarchar(250),
Value ntext
);
CREATE TABLE Characters
(
Charname nvarchar(250),
CharnameOverride nvarchar(250),
CharGender int,
CurrentRoom nvarchar(250),
Description ntext,
AllowInventoryInteraction bit,
EnterFirstTime bit,
LeaveFirstTime bit
);
CREATE TABLE CharacterActions
(
ID int IDENTITY (1, 1) NOT NULL,
Charname nvarchar(250),
Data ntext
);
CREATE TABLE CharacterProperties
(
ID int IDENTITY (1, 1) NOT NULL,
Charname nvarchar(250),
Name nvarchar(250),
Value ntext
);
CREATE TABLE Variables
(
VarName nvarchar(250),
String ntext,
NumType float,
Min nvarchar(50),
Max nvarchar(50),
EnforceRestrictions bit,
VarComment ntext,
dtDateTime datetime,
VarType int,
VarArray ntext
);
CREATE TABLE VariableProperties
(
ID int IDENTITY (1, 1) NOT NULL,
VarName nvarchar(250),
Name nvarchar(250),
Value ntext
);
CREATE TABLE Timer
(
Name nvarchar(250),
TType int,
Active bit,
Restart bit,
TurnNumber int,
Length int,
LiveTimer bit,
TimerSeconds int
);
CREATE TABLE TimerActions
(
ID int IDENTITY (1, 1) NOT NULL,
Name nvarchar(250),
Data ntext
);
CREATE TABLE TimerProperties
(
ID int IDENTITY (1, 1) NOT NULL,
TimerName nvarchar(250),
Name nvarchar(250),
Value ntext
);
--
SELECT COUNT(*)
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = 'MediaGroups';
CREATE TABLE MediaGroups
(
ID int IDENTITY (1, 1) NOT NULL,
Name nvarchar(255),
Parent nvarchar(255)
);
SELECT COUNT(*)
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'Items'
AND COLUMN_NAME = 'GroupName';
ALTER TABLE Items ADD COLUMN
GroupName nvarchar(255);
SELECT COUNT(*)
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'Items'
AND COLUMN_NAME = 'Important';
ALTER TABLE Items ADD COLUMN
Important bit NOT NULL DEFAULT (0);
SELECT COUNT(*)
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'GameData'
AND COLUMN_NAME = 'RoomGroups';
ALTER TABLE GameData ADD COLUMN
RoomGroups ntext;
SELECT COUNT(*)
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'GameData'
AND COLUMN_NAME = 'ClothingZoneLevels';
ALTER TABLE GameData ADD COLUMN
ClothingZoneLevels ntext;
SELECT COUNT(*)
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'GameData'
AND COLUMN_NAME = 'NotificationsOff';
ALTER TABLE GameData ADD COLUMN
NotificationsOff bit NOT NULL DEFAULT (0);
SELECT COUNT(*)
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'GameData'
AND COLUMN_NAME = 'SortOrderRoom';
ALTER TABLE GameData ADD COLUMN
SortOrderRoom int NOT NULL DEFAULT (0),
SortOrderCharacters int NOT NULL DEFAULT (0),
SortOrderInventory int NOT NULL DEFAULT (0);
SELECT COUNT(*)
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'Media'
AND COLUMN_NAME = 'GroupName';
ALTER TABLE Media ADD COLUMN
GroupName nvarchar(255);
SELECT COUNT(*)
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = 'ItemGroups';
CREATE TABLE ItemGroups
(
ID int IDENTITY (1, 1) NOT NULL,
Name nvarchar(255),
Parent nvarchar(255)
);
SELECT COUNT(*)
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = 'VariableGroups';
CREATE TABLE VariableGroups
(
ID int IDENTITY (1, 1) NOT NULL,
Name nvarchar(255),
Parent nvarchar(255)
);
SELECT COUNT(*)
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'Variables'
AND COLUMN_NAME = 'GroupName';
ALTER TABLE Variables ADD COLUMN
GroupName nvarchar(255);
SELECT COUNT(*)
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = 'StatusBarItems';
CREATE TABLE StatusBarItems
(
ID int IDENTITY (1, 1) NOT NULL,
Name nvarchar(255),
Text ntext,
Width int
);
SELECT COUNT(*)
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'StatusBarItems'
AND COLUMN_NAME = 'Visible';
ALTER TABLE StatusBarItems ADD COLUMN
Visible bit NOT NULL DEFAULT (1);
SELECT COUNT(*)
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'Characters'
AND COLUMN_NAME = 'CharPortrait';
ALTER TABLE Characters ADD COLUMN
CharPortrait nvarchar(255);
SELECT COUNT(*)
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'MediaLayeredImages'
AND COLUMN_NAME = 'Order';
ALTER TABLE MediaLayeredImages ADD COLUMN
[Order] int;