A corporation manager and dashboard for EVE Online
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. -- Schema for Calefaction's Campaign module's internal database
  2. DROP TABLE IF EXISTS last_updated;
  3. CREATE TABLE last_updated (
  4. lu_campaign TEXT,
  5. lu_operation TEXT,
  6. lu_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  7. lu_key INTEGER DEFAULT NULL,
  8. UNIQUE (lu_campaign, lu_operation)
  9. );
  10. DROP TABLE IF EXISTS overview;
  11. CREATE TABLE overview (
  12. ov_campaign TEXT,
  13. ov_operation TEXT,
  14. ov_primary INTEGER DEFAULT 0,
  15. ov_secondary REAL DEFAULT NULL,
  16. UNIQUE (ov_campaign, ov_operation)
  17. );
  18. DROP TABLE IF EXISTS kill;
  19. CREATE TABLE kill (
  20. kill_id INTEGER PRIMARY KEY,
  21. kill_date TIMESTAMP,
  22. kill_system INTEGER,
  23. kill_victim_shipid INTEGER,
  24. kill_victim_charid INTEGER,
  25. kill_victim_corpid INTEGER,
  26. kill_victim_allianceid INTEGER,
  27. kill_victim_factionid INTEGER,
  28. kill_value REAL
  29. );
  30. DROP TABLE IF EXISTS oper_kill;
  31. CREATE TABLE oper_kill (
  32. ok_campaign TEXT,
  33. ok_operation TEXT,
  34. ok_killid INTEGER,
  35. UNIQUE (ok_campaign, ok_operation, ok_killid),
  36. FOREIGN KEY (ok_killid) REFERENCES kill (kill_id)
  37. ON DELETE CASCADE ON UPDATE CASCADE
  38. );
  39. CREATE INDEX ok_campaign_operation ON oper_kill (ok_campaign, ok_operation);
  40. CREATE INDEX ok_campaign_killid ON oper_kill (ok_campaign, ok_killid);
  41. DROP TABLE IF EXISTS oper_item;
  42. CREATE TABLE oper_item (
  43. oi_campaign TEXT,
  44. oi_operation TEXT
  45. -- ...
  46. -- UNIQUE (oi_campaign, oi_operation, ...)
  47. );