Changeset 771 for trunk/app/config

Show
Ignore:
Timestamp:
09/20/08 15:32:48 (2 months ago)
Author:
aarkerio
Message:

New Unit Testing models

Location:
trunk/app/config/sql/postgresql
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/config/sql/postgresql/entries.sql

    r750 r771  
    11-- entries in the users blogs 
    22CREATE TABLE entries ( 
    3 id serial PRIMARY KEY, 
    4 title varchar(50) NOT NULL, 
    5 body text NOT NULL, 
    6 subject_id int REFERENCES subjects(id) NOT NULL, 
    7 created timestamp(0) with time zone DEFAULT now() NOT NULL, 
    8 status int NOT NULL DEFAULT 0, 
    9 user_id int REFERENCES users(id) ON DELETE CASCADE, 
    10 discution int NOT NULL DEFAULT 0,  -- discution, Activ/Desactiv   1/0 
    11 "karanet" smallint NOT NULL DEFAULT 0 
     3 id serial PRIMARY KEY, 
     4 title varchar(50) NOT NULL, 
     5 body text NOT NULL, 
     6 subject_id int REFERENCES subjects(id) NOT NULL, 
     7 created timestamp(0) with time zone DEFAULT now() NOT NULL, 
     8 status int NOT NULL DEFAULT 0, 
     9 user_id int REFERENCES users(id) ON DELETE CASCADE, 
     10 discution int NOT NULL DEFAULT 0,  -- discution, Activ/Desactiv   1/0 
     11 "karanet" smallint NOT NULL DEFAULT 0 
    1212); 
    1313-- search engine index 
  • trunk/app/config/sql/postgresql/resources.sql

    r436 r771  
    1 -- table for school library 
    2 CREATE TABLE resources ( 
    3 id serial PRIMARY KEY, 
    4 clasification varchar(40) NOT NULL UNIQUE, 
    5 media smallint NOT NULL,  -- Book, CD, LP, magazine 
    6 title varchar (100), 
    7 author varchar(90) NOT NULL, 
    8 edition smallint,    
    9 editor varchar(100),     
    10 cost money, 
    11 copies smallint NOT NULL DEFAULT 1 
     1-- tables for school library 
     2 
     3CREATE TABLE types ( 
     4  id serial PRIMARY KEY, 
     5  type varchar(80) NOT NULL 
    126); 
    137 
     8INSERT INTO types (type) VALUES ('Book');  
     9INSERT INTO types (type) VALUES ('Magazine'); 
     10INSERT INTO types (type) VALUES ('Newspaper'); 
     11INSERT INTO types (type) VALUES ('DVD'); 
     12INSERT INTO types (type) VALUES ('CD'); 
     13 
     14 
     15CREATE TABLE resources ( 
     16  id serial PRIMARY KEY, 
     17  clasification varchar(40) NOT NULL UNIQUE, 
     18  type_id smallint NOT NULL references types(id) ON DELETE CASCADE,  -- Book, CD, LP, periodicals 
     19  title varchar (100), 
     20  author varchar(150) NOT NULL, 
     21  edition smallint, 
     22  editor varchar(100), 
     23  isonumber varchar(20), --ISBN, ISSN, NS 
     24  cost money DEFAULT '0.0', 
     25  copies smallint NOT NULL DEFAULT 1, 
     26  created timestamp(0) without time zone DEFAULT now() NOT NULL 
     27); 
     28 
     29-- Prestamos 
     30CREATE TABLE lendings ( 
     31  id serial PRIMARY KEY, 
     32  resource_id int NOT NULL references resources(id), 
     33  lend timestamp(0) without time zone DEFAULT now() NOT NULL, 
     34  days smallint NOT NULL DEFAULT 7, 
     35  user_id int NOT NULL references users(id) 
     36);