-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.sql
More file actions
332 lines (332 loc) · 6.89 KB
/
script.sql
File metadata and controls
332 lines (332 loc) · 6.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
CREATE KEYSPACE inmoitt WITH replication = { 'class': 'SimpleStrategy',
'replication_factor': '1' };
CREATE TYPE inmoitt.direccion (lat decimal, lng decimal);
CREATE TYPE inmoitt.mueble (nombre text, cantidad int);
CREATE TABLE inmoitt.agente_inmobiliaria (
inmobiliaria text,
rfc text,
apellido text,
correo text,
foto text,
nombre text,
password text,
telefono text,
PRIMARY KEY (inmobiliaria, rfc)
);
CREATE TABLE inmoitt.agentes_proyecto (
nombre text,
inmobiliaria text,
agente text,
PRIMARY KEY (nombre, inmobiliaria, agente)
);
CREATE TABLE inmoitt.cargadores (
empresa text,
rfc text,
apellido text,
foto text,
nombre text,
password text,
telefono text,
PRIMARY KEY (empresa, rfc)
);
CREATE TABLE inmoitt.cliente_inmobiliaria (
inmobiliaria text,
correo text,
apellido text,
foto text,
nombre text,
PRIMARY KEY (inmobiliaria, correo)
);
CREATE TABLE inmoitt.clientes (
correo text PRIMARY KEY,
apellido text,
nombre text,
password text
);
CREATE TABLE inmoitt.cuentas (
correo text PRIMARY KEY,
empresa text,
password text,
tipo text
);
CREATE TABLE inmoitt.empresas_fletes (
correo text PRIMARY KEY,
logo text,
nombre text,
password text,
telefono text,
estados list < text >
);
CREATE TABLE inmoitt.fletes (
activo boolean,
id text,
empresa text,
cliente text,
destino frozen < direccion >,
fecha date,
hora time,
origen frozen < direccion >,
telefono text,
PRIMARY KEY ((activo, id), empresa, cliente)
);
CREATE TABLE inmoitt.fletes_cliente (
activo boolean,
cliente text,
empresa text,
id text,
destino frozen < direccion >,
fecha date,
hora time,
origen frozen < direccion >,
telefono text,
PRIMARY KEY ((activo, cliente), empresa, id)
);
CREATE TABLE inmoitt.fletes_empresa (
activo boolean,
empresa text,
id text,
cliente text,
destino frozen < direccion >,
fecha date,
hora time,
origen frozen < direccion >,
telefono text,
PRIMARY KEY ((activo, empresa), id, cliente)
);
CREATE TABLE inmoitt.imagenes_inmueble (
inmobiliaria text,
proyecto text,
titulo text,
ruta text,
PRIMARY KEY (inmobiliaria, proyecto, titulo, ruta)
);
CREATE TABLE inmoitt.inmobiliarias (
correo text PRIMARY KEY,
direccion frozen < direccion >,
estado text,
foto text,
nombre text,
password text,
sedes list < text >
);
CREATE TABLE inmoitt.inmuebles (
inmobiliaria text,
proyecto text,
titulo text,
agente text,
borrado boolean,
cuartos smallint,
descripcion text,
direccion frozen < direccion >,
estado text,
foto text,
metros_cuadrados decimal,
notario text,
pisos smallint,
precio_renta decimal,
precio_venta decimal,
visible boolean,
servicios
set < text >,
PRIMARY KEY (inmobiliaria, proyecto, titulo)
);
CREATE TABLE inmoitt.inmuebles_agente (
agente text,
inmobiliaria text,
proyecto text,
titulo text,
borrado boolean,
cuartos smallint,
descripcion text,
direccion frozen < direccion >,
estado text,
foto text,
metros_cuadrados decimal,
notario text,
pisos smallint,
precio_renta decimal,
precio_venta decimal,
visible boolean,
servicios
set < text >,
PRIMARY KEY (agente, inmobiliaria, proyecto, titulo)
);
CREATE TABLE inmoitt.inmuebles_cliente (
cliente text,
inmobiliaria text,
proyecto text,
titulo text,
agente text,
borrado boolean,
cuartos smallint,
descripcion text,
direccion frozen < direccion >,
estado text,
foto text,
metros_cuadrados decimal,
notario text,
pisos smallint,
precio_renta decimal,
precio_venta decimal,
visible boolean,
servicios
set < text >,
PRIMARY KEY (cliente, inmobiliaria, proyecto, titulo)
);
CREATE TABLE inmoitt.inmuebles_cliente_inmobiliaria (
inmobiliaria text,
proyecto text,
titulo text,
cliente text,
agente text,
borrado boolean,
cuartos smallint,
descripcion text,
direccion frozen < direccion >,
estado text,
foto text,
metros_cuadrados decimal,
notario text,
pisos smallint,
precio_renta decimal,
precio_venta decimal,
visible boolean,
servicios
set < text >,
PRIMARY KEY (inmobiliaria, proyecto, titulo, cliente)
);
CREATE TABLE inmoitt.inmuebles_notario (
notario text,
inmobiliaria text,
proyecto text,
titulo text,
agente text,
borrado boolean,
cuartos smallint,
descripcion text,
direccion frozen < direccion >,
estado text,
foto text,
metros_cuadrados decimal,
pisos smallint,
precio_renta decimal,
precio_venta decimal,
visible boolean,
servicios
set < text >,
PRIMARY KEY (notario, inmobiliaria, proyecto, titulo)
);
CREATE TABLE inmoitt.inmuebles_proyecto (
proyecto text,
inmobiliaria text,
titulo text,
agente text static,
borrado boolean,
cuartos smallint,
descripcion text,
direccion frozen < direccion >,
estado text,
foto text,
metros_cuadrados decimal,
notario text,
pisos smallint,
precio_renta decimal,
precio_venta decimal,
visible boolean,
servicios
set < text >,
PRIMARY KEY (proyecto, inmobiliaria, titulo)
);
CREATE TABLE inmoitt.notario (
inmobiliaria text,
rfc text,
apellido text,
correo text,
foto text,
nombre text,
PRIMARY KEY (inmobiliaria, rfc)
);
CREATE TABLE inmoitt.notarios_proyecto (
nombre text,
inmobiliaria text,
notario text,
PRIMARY KEY (nombre, inmobiliaria, notario)
);
CREATE TABLE inmoitt.paquetes (
id text,
id_item text,
total decimal static,
alto_item decimal,
ancho_item decimal,
foto text,
item text,
PRIMARY KEY (id, id_item)
);
CREATE TABLE inmoitt.precarga (
empresa text,
id text,
cajas_chicas int,
cajas_grandes int,
cajas_medianas int,
cliente text,
destino frozen < direccion >,
fecha date,
hora time,
origen frozen < direccion >,
telefono text,
muebles list < frozen < mueble >>,
PRIMARY KEY (empresa, id)
);
CREATE TABLE inmoitt.precarga_cliente (
cliente text,
id text,
cajas_chicas int,
cajas_grandes int,
cajas_medianas int,
destino frozen < direccion >,
empresa text,
fecha date,
hora time,
origen frozen < direccion >,
telefono text,
muebles list < frozen < mueble >>,
PRIMARY KEY (cliente, id)
);
CREATE TABLE inmoitt.proyectos (
inmobiliaria text,
nombre text,
ciudad text,
inicio text,
PRIMARY KEY (inmobiliaria, nombre)
);
CREATE TABLE inmoitt.proyectos_agente (
agente text,
inmobiliaria text,
nombre text,
ciudad text,
inicio text,
PRIMARY KEY (agente, inmobiliaria, nombre)
);
CREATE TABLE inmoitt.proyectos_notario (
notario text,
inmobiliaria text,
nombre text,
ciudad text,
inicio text,
PRIMARY KEY (notario, inmobiliaria, nombre)
);
CREATE TABLE inmoitt.servicio (nombre text PRIMARY KEY);
CREATE TABLE inmoitt.transporte_flete (
flete text,
transporte text,
cargadores list < text >,
paquete list < text >,
PRIMARY KEY (flete, transporte)
);
CREATE TABLE inmoitt.transportes (
empresa text,
matricula text,
activo boolean,
capacidad decimal,
PRIMARY KEY (empresa, matricula)
);