Added test data in groovy hierarchical directories.
[dbsrgits/SQL-Translator.git] / t / data / mysql / BGEP-RE-create.sql
1 ##  MySQL dump 7.1
2 ## 
3 ##  Host: db1-3.23.32    Database: RE
4 ## --------------------------------------------------------
5 ##  Server version      3.23.32
6
7
8 ##  Table structure for table 'ad' {{{
9 ## 
10 DROP TABLE IF EXISTS ad;
11 CREATE TABLE ad (
12 ## DROP TABLE IF EXISTS listing;
13 ## CREATE TABLE listing (
14   id varchar(32) DEFAULT '' NOT NULL,
15   -- lid varchar(32) DEFAULT '' NOT NULL,
16   vendor_id varchar(32) DEFAULT '' NOT NULL,
17   -- lvid varchar(32) DEFAULT '' NOT NULL,
18   realtor_id int(11) DEFAULT '0' NOT NULL,
19   -- rid int(11) DEFAULT '0' NOT NULL,
20   location_id int(11) DEFAULT '0' NOT NULL,
21   -- lcid int(11) DEFAULT '0' NOT NULL,
22   origin_id int(11) DEFAULT '0' NOT NULL,
23   -- oid int(11) DEFAULT '0' NOT NULL,
24   style_id int(11) DEFAULT '0' NOT NULL,
25   -- sid int(11) DEFAULT '0' NOT NULL,
26   style varchar(42) DEFAULT '' NOT NULL,
27   media_code_id int(11) DEFAULT '0' NOT NULL,
28   -- mcid int(11) DEFAULT '0' NOT NULL,
29   priority int(11) DEFAULT '1' NOT NULL,
30   listing_date date,
31   price int(11) DEFAULT '0' NOT NULL,
32   rooms int(11) DEFAULT '0' NOT NULL,
33   bedrooms int(11) DEFAULT '0' NOT NULL,
34   fullbaths int(11) DEFAULT '0' NOT NULL,
35   halfbaths int(11) DEFAULT '0' NOT NULL,
36   amenities varchar(255) DEFAULT '' NOT NULL,
37   lotsize int(11) DEFAULT '0' NOT NULL,
38   openhouse tinyint(4) DEFAULT '0' NOT NULL,
39   street varchar(255) DEFAULT '' NOT NULL,
40   no_units tinyint DEFAULT 1 NOT NULL,
41   ad_text text,
42   original_ad_text text,
43   photo varchar(255) DEFAULT '' NOT NULL,
44   thumbnail varchar(255) DEFAULT '' NOT NULL,
45   PRIMARY KEY (id),
46   -- PRIMARY KEY (lid),
47   KEY vendor_id_idx (vendor_id),
48   -- KEY vendor_id_idx (vid),
49   KEY amenities_idx (amenities),
50   KEY listing_date_idx (listing_date),
51   FULLTEXT ad_text_search (ad_text)
52 );
53 ## }}}
54
55 ##  Table structure for table 'ad_to_amenity' {{{
56 ## 
57 DROP TABLE IF EXISTS ad_to_amenity;
58 CREATE TABLE ad_to_amenity (
59 ## CREATE TABLE listing_to_amenity (
60   id int(11) NOT NULL auto_increment,
61   -- aaid int(11) NOT NULL auto_increment,
62   ad_id char(32) DEFAULT '' NOT NULL,
63   -- lid char(32) DEFAULT '' NOT NULL,
64   amenity_id int(11) DEFAULT '0' NOT NULL,
65   -- aid int(11) DEFAULT '0' NOT NULL,
66   PRIMARY KEY (id),
67   -- PRIMARY KEY (aaid),
68   KEY ad_id_idx (ad_id)
69   -- KEY ad_id_idx (lid)
70 );
71 ## }}}
72
73 ##  Table structure for table 'amenity' {{{
74 ## 
75 DROP TABLE IF EXISTS amenity;
76 CREATE TABLE amenity (
77   id int(11) NOT NULL auto_increment,
78   -- aid int(11) NOT NULL auto_increment,
79   amenity varchar(42) DEFAULT '' NOT NULL,
80   abbrev varchar(4) DEFAULT '' NOT NULL,
81   -- abbrev char(4) DEFAULT '' NOT NULL,
82   PRIMARY KEY (id)
83   -- PRIMARY KEY (aid)
84 );
85 ## }}}
86
87 ##  Table structure for table 'email' {{{
88 ## 
89 DROP TABLE IF EXISTS email;
90 CREATE TABLE email (
91   id int(11) NOT NULL auto_increment,
92   -- eid int(11) NOT NULL auto_increment,
93   realtor_id int(11) DEFAULT '0' NOT NULL,
94   property_id int(11) DEFAULT '0' NOT NULL,
95   firstname varchar(42) DEFAULT '' NOT NULL,
96   lastname varchar(42) DEFAULT '' NOT NULL,
97   phone varchar(10) DEFAULT '' NOT NULL,
98   timeframe varchar(255) DEFAULT '' NOT NULL,
99   schedule_appt tinyint(4) DEFAULT '0' NOT NULL,
100   date_sent timestamp(14),
101   comments text,
102   PRIMARY KEY (id)
103   -- PRIMARY KEY (eid)
104 );
105 ## }}}
106
107 ##  Table structure for table 'history' {{{
108 ## 
109 DROP TABLE IF EXISTS history;
110 CREATE TABLE history (
111   id int(11) NOT NULL auto_increment,
112   -- hid int(11) NOT NULL auto_increment,
113   type varchar(42) DEFAULT '' NOT NULL,
114   value varchar(255) DEFAULT '' NOT NULL,
115   ts timestamp(14),
116   PRIMARY KEY (id)
117   -- PRIMARY KEY (hid)
118 );
119 ## }}}
120
121 ##  Table structure for table 'location' {{{
122 ## 
123 DROP TABLE IF EXISTS location;
124 CREATE TABLE location (
125   id int(11) NOT NULL auto_increment,
126   -- lcid int(11) NOT NULL auto_increment,
127   abbrev varchar(4) DEFAULT '' NOT NULL,
128   city varchar(42) DEFAULT '' NOT NULL,
129   state char(2) DEFAULT 'MA' NOT NULL,
130   fullstate varchar(42) DEFAULT 'Massachusetts' NOT NULL,
131   PRIMARY KEY (id),
132   -- PRIMARY KEY (lcid),
133   KEY city_idx (city),
134   KEY abbrev_idx (abbrev),
135   KEY state_idx (state)
136 );
137 ## }}}
138
139 ##  Table structure for table 'media_code' {{{
140 ## 
141 DROP TABLE IF EXISTS media_code;
142 CREATE TABLE media_code (
143 ## DROP TABLE IF EXISTS mediacode;
144 ## CREATE TABLE mediacode ( -- should this table be category?
145   media_code int(11) DEFAULT '700' NOT NULL,
146   -- mcid int(11) DEFAULT '700' NOT NULL,
147   classification varchar(42) DEFAULT '' NOT NULL,
148   PRIMARY KEY (media_code)
149   -- PRIMARY KEY (mcid)
150 );
151 ## }}}
152
153 ##  Table structure for table 'origin' {{{
154 ## 
155 DROP TABLE IF EXISTS origin;
156 CREATE TABLE origin (
157   id int(11) NOT NULL auto_increment,
158   -- oid int(11) NOT NULL auto_increment,
159   origin varchar(24) DEFAULT '' NOT NULL,
160   display varchar(42) DEFAULT '' NOT NULL,
161   PRIMARY KEY (id)
162   -- PRIMARY KEY (oid)
163 );
164 ## }}}
165
166 ##  Table structure for table 'realtor' {{{
167 ## 
168 DROP TABLE IF EXISTS realtor;
169 CREATE TABLE realtor (
170   id int(11) NOT NULL auto_increment,
171   -- rid int(11) NOT NULL auto_increment,
172   vendor_id varchar(6) DEFAULT '' NOT NULL,
173   -- rvid varchar(6) DEFAULT '' NOT NULL,
174   name varchar(255) DEFAULT '' NOT NULL,
175   phone varchar(24) DEFAULT '' NOT NULL,
176   location_id int(11) DEFAULT '0' NOT NULL,
177   -- lcid int(11) DEFAULT '0' NOT NULL,
178   email varchar(255) DEFAULT '' NOT NULL,
179   url varchar(255) DEFAULT '' NOT NULL,
180   tagline text,
181   logo_url varchar(255) DEFAULT '' NOT NULL,
182   upsell tinyint(4) DEFAULT '0',
183   start_date date,
184   end_date date,
185   PRIMARY KEY (id),
186   -- PRIMARY KEY (vid),
187   KEY name_idx (name),
188   KEY phone_idx (phone)
189 );
190 ## }}}
191
192 ##  Table structure for table 'style' {{{
193 ## 
194 DROP TABLE IF EXISTS style;
195 CREATE TABLE style (
196   id int(11) NOT NULL auto_increment,
197   -- sid int(11) NOT NULL auto_increment,
198   style varchar(42) DEFAULT '' NOT NULL,
199   abbrev varchar(42) DEFAULT '' NOT NULL,
200   PRIMARY KEY (id),
201   -- PRIMARY KEY (sid),
202   KEY style_idx (style)
203 );
204 ## }}}
205
206
207
208
209