Skip to content

Instantly share code, notes, and snippets.

@avdg
Forked from Ttech/database.sql
Created April 8, 2011 19:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avdg/910587 to your computer and use it in GitHub Desktop.
Save avdg/910587 to your computer and use it in GitHub Desktop.
create table general {
id INTEGER UNIQUE PRIMARY KEY,
userhash BLOB UNIQUE,
userid INTEGER,
ship TEXT,
time INT,
version TEXT,
fate TEXT,
player TEXT,
score INT,
credits INT,
respawns INT
systems INT,
}
create table users {
id INTEGER PRIMARY KEY,
userhash BLOB,
options BLOB
}
create table enemy_stations_destroyed {
id INTEGER PRIMARY KEY,
userhash BLOB UNIQUE,
userid INTEGER,
station TEXT,
count INTEGER,
}
create table enemy_ships_destroyed {
id INTEGER PRIMARY KEY,
userhash BLOB UNIQUE,
userid INTEGER,
ship TEXT,
count INTEGER,
}
create table friendly_stations_destroyed {
id INTEGER PRIMARY KEY,
userhash BLOB UNIQUE,
userid INTEGER,
station TEXT,
count INTEGER,
}
create table friendly_ships_destroyed {
id INTEGER PRIMARY KEY,
userhash BLOB UNIQUE,
userid INTEGER,
ship TEXT,
count INTEGER,
}
create table commerce {
id INTEGER PRIMARY KEY,
userhash BLOB UNIQUE,
arms INTEGER,
luxury_goods INTEGER,
goods_and_materials INTEGER,
ships_equipment INTEGER,
medical_supplies INTEGER
}
create table weapons_fired {
id INTEGER PRIMARY KEY,
userhash BLOB UNIQUE,
userid INTEGER,
weapon TEXT,
count INTEGER,
}
create table content {
id INTEGER UNIQUE PRIMARY KEY,
item text
}
select * from general, users join on general.userid = users.id
{
"CONDUCTS": {
"Game resurrections": 8,
"Never invoked powers of Domina": "",
"Never destroyed friendly stations": ""
},
"ACHIEVEMENTS & REGRETS": [
"Rescued Mr. Katami from the Black Market",
"Became Legendary Hero of the Arena"
],
"MISSIONS & ACTIVITIES": {
"Mining colony missions": 1,
"Psionics offered to Domina": 1000,
"Money earned on missions": 200
},
"EXPLORATION": {
"Never reached Point Juno": "",
"Never reached the Galactic Core": "",
"Never reached Jiang's Star": "",
"Never reached Heretic": "",
"Systems visited": 9
},
"EXTENSIONS": [
"Extension dada1000",
"Extension deed5000"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment