-- 
-- Created by SQL::Translator::Producer::SQLite
-- Created on Sun Nov  9 13:32:29 2008
-- 
BEGIN TRANSACTION;


--
-- Table: basic
--
DROP TABLE basic;
CREATE TABLE basic (
  type_id INTEGER PRIMARY KEY NOT NULL,
  pack_code char(1) NOT NULL,
  length_bits integer NOT NULL
);


--
-- Table: encoded_string
--
DROP TABLE encoded_string;
CREATE TABLE encoded_string (
  type_id INTEGER PRIMARY KEY NOT NULL,
  base_type_id integer NOT NULL,
  encoding varchar(20) NOT NULL
);


--
-- Table: enum
--
DROP TABLE enum;
CREATE TABLE enum (
  type_id INTEGER PRIMARY KEY NOT NULL,
  base_type_id integer NOT NULL
);


--
-- Table: structure_fields
--
DROP TABLE structure_fields;
CREATE TABLE structure_fields (
  enum_id integer NOT NULL,
  value varchar(1024) NOT NULL,
  translation varchar(1024) NOT NULL,
  PRIMARY KEY (enum_id, value)
);


--
-- Table: fileformats
--
DROP TABLE fileformats;
CREATE TABLE fileformats (
  type_id INTEGER PRIMARY KEY NOT NULL,
  base_type_id integer NOT NULL
);


--
-- Table: recurring_count
--
DROP TABLE recurring_count;
CREATE TABLE recurring_count (
  type_id INTEGER PRIMARY KEY NOT NULL,
  base_type_id integer NOT NULL,
  count integer NOT NULL
);


--
-- Table: recurring_terminated
--
DROP TABLE recurring_terminated;
CREATE TABLE recurring_terminated (
  type_id INTEGER PRIMARY KEY NOT NULL,
  base_type_id integer NOT NULL,
  terminator varchar(1024) NOT NULL
);


--
-- Table: structure
--
DROP TABLE structure;
CREATE TABLE structure (
  type_id INTEGER PRIMARY KEY NOT NULL
);


--
-- Table: systems
--
DROP TABLE systems;
CREATE TABLE systems (
  id INTEGER PRIMARY KEY NOT NULL,
  name varchar(255) NOT NULL,
  comments varchar(16384) NOT NULL
);


--
-- Table: types
--
DROP TABLE types;
CREATE TABLE types (
  id INTEGER PRIMARY KEY NOT NULL,
  system_id integer NOT NULL,
  name varchar(255) NOT NULL,
  comments varchar(16384) NOT NULL
);


COMMIT;
