Ignore:
Timestamp:
Jul 20, 2000, 1:39:59 PM (25 years ago)
Author:
bird
Message:

Added description to author.
Added type column to function and dll.
Added updated column to file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/database/CreateTables.sql

    r3865 r3870  
    1 -- $Id: CreateTables.sql,v 1.11 2000-07-19 21:29:36 bird Exp $
     1-- $Id: CreateTables.sql,v 1.12 2000-07-20 11:39:59 bird Exp $
    22--
    33-- Create all tables.
     
    88USE Odin32;
    99
     10
     11--
     12-- Manually create author table.
     13--
     14CREATE TABLE author (
     15    refcode     SMALLINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
     16    name        VARCHAR(64) NOT NULL,
     17    initials    CHAR(4) NOT NULL,
     18    alias       VARCHAR(32),
     19    email       VARCHAR(64),
     20    country     VARCHAR(64),
     21    location    VARCHAR(64),
     22    description TEXT,
     23    UNIQUE u1(refcode),
     24    UNIQUE u2(name),
     25    UNIQUE u3(initials)
     26--   ,UNIQUE i4(alias), UNIQUE columns have to be defined NOT NULL in mySql.
     27--    UNIQUE i5(email)  UNIQUE columns have to be defined NOT NULL in mySql.
     28);
     29
     30
     31
     32--
     33--
     34-- Documentation
     35--
     36--
    1037
    1138--
     
    2653--
    2754-- This table holds the dll names.
     55--    Type has these known types:
     56--       'A' for Odin32 API dll
     57--       'I' for Internal Odin32 (API) dll
     58--       'S' for support stuff (ie. pe.exe and win32k.sys).
     59--       'T' for tools (executables and dlls)
    2860--
    2961CREATE TABLE dll (
    30     refcode     TINYINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
    31     name        VARCHAR(32) NOT NULL,
     62    refcode     TINYINT       NOT NULL AUTO_INCREMENT PRIMARY KEY,
     63    name        VARCHAR(32)   NOT NULL,
     64    type        CHAR          NOT NULL DEFAULT 'A',
    3265    description VARCHAR(255),
    3366    UNIQUE u1(refcode),
     
    4679    lastauthor      SMALLINT NOT NULL,
    4780    revision        CHAR(10) NOT NULL,
     81    updated         TINYINT  NOT NULL DEFAULT 0,
    4882    description     TEXT,
    4983    UNIQUE u1(refcode),
     
    5185    INDEX  i1(name)
    5286);
     87
    5388
    5489--
     
    70105--
    71106-- This table holds API information (per dll / file).
     107--
     108-- Type has these known values:
     109--       'A' for API
     110--       'I' for Internal Odin32 API
    72111--
    73112CREATE TABLE function (
     
    82121    apigroup SMALLINT,
    83122    return   VARCHAR(64),
     123    type     CHAR     NOT NULL DEFAULT 'A',
    84124    updated  TINYINT  NOT NULL DEFAULT 0,
    85125    description TEXT,
     
    98138    INDEX  i5(file),
    99139    UNIQUE u1(refcode),
    100     UNIQUE u2(name, dll)
     140    UNIQUE u2(name, dll),
     141    UNIQUE u3(type, refcode)
    101142);
    102143
     
    116157
    117158
     159--
     160-- Many to many relation between functions and authors.
     161--
     162CREATE TABLE fnauthor (
     163    author   SMALLINT NOT NULL,
     164    function INTEGER NOT NULL,
     165    UNIQUE u1(function, author)
     166);
     167
    118168
    119169--
     
    130180
    131181
    132 --
    133 -- Manually create author table.
    134 --
    135 CREATE TABLE author (
    136     refcode  SMALLINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
    137     name     VARCHAR(64) NOT NULL,
    138     initials CHAR(4) NOT NULL,
    139     alias    VARCHAR(32),
    140     email    VARCHAR(64),
    141     country  VARCHAR(64),
    142     location VARCHAR(64),
    143     UNIQUE u1(refcode),
    144     UNIQUE u2(name),
    145     UNIQUE u3(initials)
    146 --   ,UNIQUE i4(alias), UNIQUE columns have to be defined NOT NULL in mySql.
    147 --    UNIQUE i5(email)  UNIQUE columns have to be defined NOT NULL in mySql.
    148 );
    149 
    150 
    151 --
    152 -- Many to many relation between functions and authors.
    153 --
    154 CREATE TABLE fnauthor (
    155     author   SMALLINT NOT NULL,
    156     function INTEGER NOT NULL,
    157     UNIQUE u1(function, author)
    158 );
    159 
     182
     183--
     184--
     185-- History information
     186--
     187--
    160188
    161189--
Note: See TracChangeset for help on using the changeset viewer.