:::::::::::::::::::::::::::::
::CHANGES IN THE DATA MODEL::
:::::::::::::::::::::::::::::
* WARNING
- I don't understand the syntax you are using to create the name of the
fields. Taking a look in the data model I should know what fields are
"foreign keys" (and of what table). Another important thing is to know the
"data type". ie. we can use at the beginning of the fields that preffix:
* varchar, mediumtext, bigtext, with malloc : "s_"
* char, works different with the memory: "c_"
* integer, long: "i_"
* boolean [ int(1) ] : "b_"
* decimal, float: "f_"
* datetime: "dt_"
* date: "d_"
* timestamp: "ts_"
- field names, table names and index names: always lower case and
descriptive names
- ie: the definition of "category" (the name "t_category") but the name of
the fields:
* i_id
* s_name
* s_description
* fk_i_id_category (fk_<referred_field_name>_<what_table>)
MORE FIELDS IN THE TABLES AND REESTRUCTURATION...
::ad:: -> the name "t_ad"
id -> ok, the name i_id
pub_date -> ok, the name dt_date
update_date -> needed, the name dt_update_date
category_id -> ok, the name fk_i_id_category
price -> ok, the name f_price
title -> ok, the name s_title
description -> ok, the name s_description
location_id -> no, I don't understand this field
num_views -> no, we need more tables with statistics... fase 2 -> we can
study if is needed that field desnormalized in that table
fk_i_id_t_countries -> the country. Foreign key of t_countries.
s_country -> I'm not sure if we need that field desnormalized.
fk_i_id_t_regions -> the region. Foreign key of t_regions (default value 0)
s_region -> the name desnormalized of the region (important for performance)
fk_i_id_t_cities -> the city. Foreign key of t_cities (default value 0)
s_city -> the name desnormalized of the city (important for performance and
just in case we don't have in our table the inserted city)
s_city_area -> the name of the neighbourhood (is impossible to do a table
with all the city areas in the world)
:LOCATION: -> deprecated :P I don't understand your idea of have the
location of the item in another table because all the items must be
geolocalizated.
:t_cities:, :t_regions:, :t_countries: -> needed. Fill those tables using
geonames.org
:ad_comment: (t_ad_comment)
id -> ok. i_id
dt_date -> needed
ad_id -> ok. fk_i_id_t_ad
author_name -> ok. s_author_name
author_email -> ok. s_author_email
body -> ok. s_body
b_active -> needed. b_active can be a int(1). The default should be 1 but
you can deactivate form the backoffice. At the backoffice you can select if
you want email validation by user or not.
b_spam -> needed. b_spam can be a int(1). The default value should be 0 but
you can mark it at the backoffice (or a plugin like akismet).
:ad_resource: -> what is that?
:user: -> we need 2 tables. First for us (backoffice) and the other for the
web users
:preference, page, and module: -> I cannot define them very well now. I
need to speak with you.