dbicdh/SQLite/deploy/1/001-auto.sql
changeset 59 4f4f8a52a874
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dbicdh/SQLite/deploy/1/001-auto.sql	Sun Feb 08 22:36:04 2015 +0100
@@ -0,0 +1,83 @@
+-- 
+-- Created by SQL::Translator::Producer::SQLite
+-- Created on Sun Feb  1 19:58:35 2015
+-- 
+
+;
+BEGIN TRANSACTION;
+--
+-- Table: crash_users
+--
+CREATE TABLE crash_users (
+  id INTEGER PRIMARY KEY NOT NULL,
+  user_id varchar(40) NOT NULL,
+  os varchar(40),
+  cpu_arch varchar(10),
+  cpu_count int,
+  extra_info text
+);
+--
+-- Table: modules
+--
+CREATE TABLE modules (
+  id INTEGER PRIMARY KEY NOT NULL,
+  debug_id varchar(33) NOT NULL,
+  filename varchar(128) NOT NULL,
+  version varchar(64)
+);
+CREATE UNIQUE INDEX module_id ON modules (debug_id, filename);
+--
+-- Table: products
+--
+CREATE TABLE products (
+  id INTEGER PRIMARY KEY NOT NULL,
+  distributor varchar(40),
+  name varchar(40),
+  version varchar(16),
+  release_channel varchar
+);
+--
+-- Table: crash_reports
+--
+CREATE TABLE crash_reports (
+  id INTEGER PRIMARY KEY NOT NULL,
+  start_time timestamp,
+  crash_time timestamp,
+  uuid varchar(36) NOT NULL,
+  bug_reference varchar(20),
+  crash_user_id int NOT NULL,
+  product_id int NOT NULL,
+  FOREIGN KEY (crash_user_id) REFERENCES crash_users(id),
+  FOREIGN KEY (product_id) REFERENCES products(id)
+);
+CREATE INDEX crash_reports_idx_crash_user_id ON crash_reports (crash_user_id);
+CREATE INDEX crash_reports_idx_product_id ON crash_reports (product_id);
+--
+-- Table: crash_threads
+--
+CREATE TABLE crash_threads (
+  id INTEGER PRIMARY KEY NOT NULL,
+  number int NOT NULL,
+  crashed bool NOT NULL,
+  crash_report_id int NOT NULL,
+  FOREIGN KEY (crash_report_id) REFERENCES crash_reports(id)
+);
+CREATE INDEX crash_threads_idx_crash_report_id ON crash_threads (crash_report_id);
+--
+-- Table: crash_frames
+--
+CREATE TABLE crash_frames (
+  id INTEGER PRIMARY KEY NOT NULL,
+  number int NOT NULL,
+  function varchar(128),
+  source_file varchar(128),
+  source_line int,
+  stack_walk_mode varchar(10),
+  crash_thread_id int NOT NULL,
+  module_id int NOT NULL,
+  FOREIGN KEY (crash_thread_id) REFERENCES crash_threads(id),
+  FOREIGN KEY (module_id) REFERENCES modules(id)
+);
+CREATE INDEX crash_frames_idx_crash_thread_id ON crash_frames (crash_thread_id);
+CREATE INDEX crash_frames_idx_module_id ON crash_frames (module_id);
+COMMIT;