1 |
-- |
2 |
-- Project: Clipping |
3 |
-- Author: Nelson Ferraz <nferraz@phperl.com> |
4 |
-- Date: 2003-08-14 |
5 |
-- |
6 |
|
7 |
|
8 |
-- |
9 |
-- TABLE: CUSTOMER |
10 |
-- |
11 |
|
12 |
CREATE TABLE c_customer ( |
13 |
c_customer_id serial primary key, |
14 |
c_customer_name varchar(100) not null, |
15 |
c_customer_phone varchar(50), |
16 |
c_customer_email varchar(50), |
17 |
c_customer_notes text, |
18 |
c_customer_date_created timestamp DEFAULT NOW(), |
19 |
c_customer_date_updated timestamp, |
20 |
c_customer_date_deleted timestamp |
21 |
); |
22 |
|
23 |
|
24 |
-- |
25 |
-- TABLE: CUSTOMER LOG |
26 |
-- |
27 |
|
28 |
/* |
29 |
CREATE TABLE log_c_customer ( |
30 |
log_c_customer_id serial primary key, |
31 |
c_customer_id int, |
32 |
c_customer_name varchar(100) not null, |
33 |
c_customer_phone varchar(50), |
34 |
c_customer_email varchar(50), |
35 |
c_customer_notes text, |
36 |
c_customer_date_created datetime, |
37 |
c_customer_date_updated datetime, |
38 |
c_customer_date_deleted datetime, |
39 |
is_active boolean DEFAULT 't' NOT NULL |
40 |
); |
41 |
*/ |
42 |
|
43 |
|
44 |
|
45 |
-- |
46 |
-- TABLE: SOURCE |
47 |
-- |
48 |
|
49 |
CREATE TABLE c_source ( |
50 |
c_source_id serial primary key, |
51 |
c_source_description varchar(100) not null, |
52 |
c_source_notes text, |
53 |
c_source_date_created timestamp DEFAULT NOW(), |
54 |
c_source_date_updated timestamp, |
55 |
c_source_date_deleted timestamp |
56 |
); |
57 |
|
58 |
|
59 |
-- |
60 |
-- TABLE: SOURCE LOG |
61 |
-- |
62 |
|
63 |
/* |
64 |
CREATE TABLE log_c_source ( |
65 |
log_c_source_id serial primary key, |
66 |
c_source_id int, |
67 |
c_source_description varchar(100) not null, |
68 |
c_source_notes text, |
69 |
c_source_date_created datetime, |
70 |
c_source_date_updated datetime, |
71 |
c_source_date_deleted datetime, |
72 |
is_active boolean DEFAULT 't' NOT NULL |
73 |
); |
74 |
*/ |
75 |
|
76 |
|
77 |
|
78 |
-- |
79 |
-- TABLE: TYPE |
80 |
-- |
81 |
|
82 |
CREATE TABLE c_type ( |
83 |
c_type_id serial primary key, |
84 |
c_type_description varchar(50) not null, |
85 |
c_type_notes text, |
86 |
c_type_date_created timestamp DEFAULT NOW(), |
87 |
c_type_date_updated timestamp, |
88 |
c_type_date_deleted timestamp |
89 |
); |
90 |
|
91 |
|
92 |
-- |
93 |
-- TABLE: TYPE LOG |
94 |
-- |
95 |
|
96 |
/* |
97 |
CREATE TABLE log_c_type ( |
98 |
log_c_type_id serial primary key, |
99 |
c_type_id int, |
100 |
c_type_description varchar(50) not null, |
101 |
c_type_notes text, |
102 |
c_type_date_created datetime, |
103 |
c_type_date_updated datetime, |
104 |
c_type_date_deleted datetime, |
105 |
is_active boolean DEFAULT 't' NOT NULL |
106 |
); |
107 |
*/ |
108 |
|
109 |
|
110 |
|
111 |
-- |
112 |
-- TABLE: NEWS |
113 |
-- |
114 |
|
115 |
CREATE TABLE c_news ( |
116 |
c_news_id serial primary key, |
117 |
c_source_fk int references c_source, |
118 |
c_customer_fk int references c_customer, |
119 |
c_type_fk int references c_type, |
120 |
c_news_section varchar(100), |
121 |
c_news_page varchar(250), |
122 |
c_news_title varchar(100) not null, |
123 |
c_news_abstract text not null, |
124 |
c_news_full_text text, |
125 |
c_news_date_created timestamp DEFAULT NOW(), |
126 |
c_news_date_updated timestamp, |
127 |
c_news_date_deleted timestamp |
128 |
); |
129 |
|
130 |
|
131 |
-- |
132 |
-- TABLE: NEWS LOG |
133 |
-- |
134 |
|
135 |
/* |
136 |
CREATE TABLE log_c_news ( |
137 |
log_c_news_id serial primary key, |
138 |
c_source_id int, |
139 |
c_source_description varchar(100) not null, |
140 |
c_source_notes text, |
141 |
c_customer_id int, |
142 |
c_customer_name varchar(100) not null, |
143 |
c_customer_phone varchar(50), |
144 |
c_customer_email varchar(50), |
145 |
c_customer_notes text, |
146 |
c_type_id int, |
147 |
c_type_description varchar(50) not null, |
148 |
c_type_notes text, |
149 |
c_news_id int, |
150 |
c_news_section varchar(100), |
151 |
c_news_page varchar(250), |
152 |
c_news_title varchar(100) not null, |
153 |
c_news_abstract text not null, |
154 |
c_news_full_text text, |
155 |
c_news_date_created datetime, |
156 |
c_news_date_updated datetime, |
157 |
c_news_date_deleted datetime, |
158 |
is_active boolean DEFAULT 't' NOT NULL |
159 |
); |
160 |
*/ |
161 |
|
162 |
|
163 |
|
164 |
-- END -- |
165 |
|
166 |
-- |
167 |
-- This program is free software; you can redistribute it and/or |
168 |
-- modify it under the terms of the GNU General Public License |
169 |
-- |